BETA Shoulder is in beta — Findings may sometimes be wrong. Your feedback shapes what we fix next. Share feedback

Hardcoded Secrets in Manifest

Description

Detects hardcoded secrets, passwords, or API keys in Kubernetes manifests.

What Shoulder detects

Secrets, passwords, or API keys are hardcoded in the Kubernetes manifest.

How to fix

Use Kubernetes Secrets with valueFrom.

```yaml
env:
  - name: DB_PASSWORD
    valueFrom:
      secretKeyRef:
        name: db-secret
        key: password
```

Learn more: https://shoulder.dev/learn/kubernetes/cwe-798/hardcoded-secrets

Applies to

Languages

Frameworks

kubernetes

References

Scan for this issue

Detect with Shoulder CLI
npx @shoulderdev/cli trust --rule=kubernetes-hardcoded-secrets .

Related rules