Skip to content

added option for external secret #119

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions wiz-kubernetes-connector/templates/secrets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ stringData:
{{- end }}
{{- end }}

{{- if not .Values.wizApiToken.secret.external.enabled }}
{{- if and .Values.wizApiToken.secret.create .Values.autoCreateConnector.enabled }}
---
apiVersion: v1
Expand All @@ -38,3 +39,28 @@ data:
clientId: {{ required "Missing required value wizApiToken.clientId is required" .Values.wizApiToken.clientId | b64enc | quote }}
clientToken: {{ required "Missing required value: wizApiToken.clientToken is required" .Values.wizApiToken.clientToken | b64enc | quote }}
{{- end }}
{{- end }}

{{- if .Values.wizApiToken.secret.external.enabled }}
---
apiVersion: external-secrets.io/v1alpha1
kind: ExternalSecret
metadata:
name: {{ .Values.wizApiToken.secret.name }}
spec:
secretStoreRef:
kind: {{ .Values.wizApiToken.secret.external.kind }}
name: {{ .Values.wizApiToken.secret.external.name }}
target:
name: {{ .Values.wizApiToken.secret.name }}
data:
- secretKey: clientId
remoteRef:
key: {{ .Values.wizApiToken.secret.external.secretIdentifier }}
property: clientId
- secretKey: clientToken
remoteRef:
key: {{ .Values.wizApiToken.secret.external.secretIdentifier }}
property: clientToken
{{- end }}

12 changes: 11 additions & 1 deletion wiz-kubernetes-connector/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,24 @@ wizApiToken:
clientEndpoint: "" # Set custom endpoint (gov for example)

secret:
# Specifies whether an api token secret should be created
# Specifies whether an api token secret should be created locally
# If create is false you need to create it with clientId, clientToken
create: true
# Annotations to add to the secret
annotations: {}
# The name of the secret to use.
# If not set, a name is generated using the fullname template
name: ""

# Relevant only if using an external secret
external:
enabled: false
# Possible values are SecretStore and ClusterSecretStore
kind: ""
# The name of the external secret store
name: ""
# The indentifier for the secret
secretIdentifier: ""

# API token should be read from an environment file, which is specified in podCustomEnvironmentVariablesFile
usePodCustomEnvironmentVariablesFile: false
Expand Down