Secret value committed in a manifest (ARCH10024)
Key config.k8s.secret-in-manifest · Severity error · Category security · CWE CWE-798
A Secret whose data or stringData holds a value is that value in the repository - base64 is an encoding, not encryption. A container env entry whose name ends in a secret word with a written value is the same.
Incorrect
Section titled “Incorrect”apiVersion: v1kind: Secretmetadata: name: db-credentialstype: OpaquestringData: password: change-me-123Correct
Section titled “Correct”apiVersion: apps/v1kind: Deploymentmetadata: name: apispec: selector: matchLabels: app: api template: metadata: labels: app: api spec: containers: - name: api image: example/api:3.2.0 env: - name: DB_PASSWORD valueFrom: secretKeyRef: name: db-credentials key: passwordKeep secret values out of the repository: a sealed or external secret, or one the deployment creates, read with valueFrom.secretKeyRef.
Not flagged
Section titled “Not flagged”valueFrom.secretKeyRef,valueFrom.configMapKeyRefand empty values.