Skip to content

LS-IAC-005: Kubernetes Secret Data

Severity HIGH
Blast radius Depends on the credential; treat as exposed
Rotate at https://kubernetes.io/docs/concepts/configuration/secret/
Applies to files matching (?:k8s|kube|manifests?|charts?|helm|deploy)[^/]*/.*\.ya?ml$|(?:^|/)values[\w.-]*\.ya?ml$|secrets?\.ya?ml$

If this leaks

Kubernetes Secret values are base64, not encrypted. Anyone with the manifest can decode them.

What to do

  1. Rotate or revoke the credential at https://kubernetes.io/docs/concepts/configuration/secret/.
  2. Check the provider's audit logs for use you don't recognise.
  3. Remove it from git history (leakscan purge --help) and load it from an environment variable or secret manager instead.

Pattern

(?i)^\s+[\w.\-]*(?:password|passwd|token|secret|api[_-]?key|\.key)[\w.\-]*:\s+['\"]?([A-Za-z0-9+/]{12,}={0,2})['\"]?\s*$

Suppress

On one line: # leakscan:ignore LS-IAC-005. For the whole project:

disable_rules: [LS-IAC-005]