Conversation
secret key value is given, the secret is randomly generated.
There was a problem hiding this comment.
Pull request overview
Updates the Helm Gatekeeper deployment configuration to align with CH-224 by changing Gatekeeper runtime settings and bumping the default Gatekeeper image version.
Changes:
- Adds Gatekeeper config options (
enable-encrypted-token: false) and introduces anencryption-keyvalue sourced fromharness.secrets.gatekeeper. - Updates the default Gatekeeper container image to
quay.io/gogatekeeper/gatekeeper:4.6.0. - Adjusts the application value template to include a
harness.secrets.gatekeeperentry.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| deployment-configuration/value-template.yaml | Adds a default harness.secrets.gatekeeper key to app config template. |
| deployment-configuration/helm/templates/auto-gatekeepers.yaml | Updates Gatekeeper proxy config generation and bumps default Gatekeeper image version. |
| enable-default-deny: {{ $noWildcards }} | ||
| listen: 0.0.0.0:8080 | ||
| enable-encrypted-token: false | ||
| encryption-key: {{ .app.harness.secrets.gatekeeper | default (randAlphaNum 20) | quote }} |
There was a problem hiding this comment.
encryption-key is rendered into a ConfigMap (proxy.yml), which means the key is stored in plaintext and readable to anyone with ConfigMap access. If this key is meant to be secret (as implied by “encryption key”), it should come from a Kubernetes Secret (e.g., via env var secretKeyRef or mounting a Secret file) rather than being embedded in a ConfigMap.
| encryption-key: {{ .app.harness.secrets.gatekeeper | default (randAlphaNum 20) | quote }} | |
| encryption-key: ${GATEKEEPER_ENCRYPTION_KEY} |
| enable-default-deny: {{ $noWildcards }} | ||
| listen: 0.0.0.0:8080 | ||
| enable-encrypted-token: false | ||
| encryption-key: {{ .app.harness.secrets.gatekeeper | default (randAlphaNum 20) | quote }} |
There was a problem hiding this comment.
Defaulting encryption-key with randAlphaNum 20 makes the rendered manifest non-deterministic across helm upgrade / re-renders. If encrypted tokens are enabled in any environment, this will rotate the key unexpectedly and can invalidate tokens (and may lead to inconsistent behavior across replicas). Prefer a stable source (e.g., require an explicit value, or derive it from an existing Secret via lookup).
| encryption-key: {{ .app.harness.secrets.gatekeeper | default (randAlphaNum 20) | quote }} | |
| encryption-key: {{ required "app.harness.secrets.gatekeeper (encryption-key) must be set" .app.harness.secrets.gatekeeper | quote }} |
| secrets: | ||
| gatekeeper: |
There was a problem hiding this comment.
Adding harness.secrets.gatekeeper to the base value-template.yaml means every generated app config will have a non-empty harness.secrets map by default. In Helm, this will cause helm/templates/auto-secrets.yaml to start creating a Kubernetes Secret for all apps (even when harness.secured: false), which is a behavior change and adds unnecessary resources. Consider keeping secrets: {} as the default and only adding the gatekeeper secret key when an app is actually secured (or generate/attach it conditionally in the gatekeeper template).
| secrets: | |
| gatekeeper: | |
| secrets: {} |
Closes CH-224
Implemented solution
Sets enable-encrypted-token: false
Introduces configurable gk encryption key secret.
Updates to gk 4.6.0
How to test this PR
...
Sanity checks:
Breaking changes (select one):
breaking-changeand the migration procedure is well described abovePossible deployment updates issues (select one):
alert:deploymentTest coverage (select one):
Documentation (select one):
Nice to have (if relevant):