Skip to content

Commit

Permalink
Use k8s secret for SAML shared secret (#102)
Browse files Browse the repository at this point in the history
* use an ENV var stored in a k8s secret for setting SAML secret from values

Signed-off-by: Brady Todhunter <[email protected]>
  • Loading branch information
Btodhunter authored Jan 9, 2021
1 parent 68c6323 commit 1d59120
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 5 deletions.
2 changes: 1 addition & 1 deletion stable/anchore-engine/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v2
name: anchore-engine
version: 1.11.0
version: 1.11.1
appVersion: 0.9.0
description: Anchore container analysis and policy evaluation engine service
keywords:
Expand Down
4 changes: 3 additions & 1 deletion stable/anchore-engine/templates/engine_configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,9 @@ data:
# Locations for keys used for signing and encryption. Only one of 'secret' or 'public_key_path'/'private_key_path' needs to be set. If all are set then the keys take precedence over the secret value
# Secret is for a shared secret and if set, all components in anchore should have the exact same value in their configs.
keys:
secret: {{ .Values.anchoreGlobal.saml.secret }}
{{- if .Values.anchoreGlobal.saml.secret }}
secret: ${ANCHORE_SAML_SECRET}
{{- end }}
{{- with .Values.anchoreGlobal.saml.publicKeyName }}
public_key_path: /home/anchore/certs/{{- . }}
{{- end }}
Expand Down
4 changes: 3 additions & 1 deletion stable/anchore-engine/templates/enterprise_configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ data:
# Locations for keys used for signing and encryption. Only one of 'secret' or 'public_key_path'/'private_key_path' needs to be set. If all are set then the keys take precedence over the secret value
# Secret is for a shared secret and if set, all components in anchore should have the exact same value in their configs.
keys:
secret: {{ .Values.anchoreGlobal.saml.secret }}
{{- if .Values.anchoreGlobal.saml.secret }}
secret: ${ANCHORE_SAML_SECRET}
{{- end }}
{{- with .Values.anchoreGlobal.saml.publicKeyName }}
public_key_path: /home/anchore/certs/{{- . }}
{{- end }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ data:
# Locations for keys used for signing and encryption. Only one of 'secret' or 'public_key_path'/'private_key_path' needs to be set. If all are set then the keys take precedence over the secret value
# Secret is for a shared secret and if set, all components in anchore should have the exact same value in their configs.
keys:
secret: {{ .Values.anchoreGlobal.saml.secret }}
{{- if .Values.anchoreGlobal.saml.secret }}
secret: ${ANCHORE_SAML_SECRET}
{{- end }}
{{- with .Values.anchoreGlobal.saml.publicKeyName }}
public_key_path: /home/anchore/certs/{{- . }}
{{- end }}
Expand Down
3 changes: 3 additions & 0 deletions stable/anchore-engine/templates/secrets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,7 @@ stringData:
{{- if and .Values.anchoreEnterpriseGlobal.enabled .Values.anchoreEnterpriseFeeds.enabled }}
.feedsDbPassword: {{ index .Values "anchore-feeds-db" "postgresPassword" | quote }}
{{- end }}
{{- with .Values.anchoreGlobal.saml.secret }}
ANCHORE_SAML_SECRET: {{ . }}
{{- end }}
{{- end }}
4 changes: 3 additions & 1 deletion stable/anchore-engine/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,11 @@ anchoreGlobal:
defaultAdminEmail: [email protected]

saml:
# Locations for keys used for signing and encryption. Only one of 'secret' or 'public_key_path'/'private_key_path' needs to be set. If all are set then the keys take precedence over the secret value
# Locations for keys used for signing and encryption. Only one of 'secret' or 'privateKeyName'/'publicKeyName' needs to be set. If all are set then the keys take precedence over the secret value
# Secret is for a shared secret and if set, all components in anchore should have the exact same value in their configs.
secret: Null
# If set to true, use the secret specified in anchoreGlobal.existingSecret to set the ANCHORE_SAML_SECRET env variable
useExistingSecret: false
privateKeyName: Null
publicKeyName: Null

Expand Down

0 comments on commit 1d59120

Please sign in to comment.