Pcornel
Security · Container Security

Secrets

Cheat sheet · https://pcornel.dk/topic.php?topic=5040

Back to the Topic

Answer

Container secrets should be injected at runtime from a secret store or orchestrator secrets, mounted as files with tight permissions, never baked into images or committed in Dockerfiles.

Remember

  • Inject at runtime, not at build time.
  • Mount as files with tight permissions.
  • Use external secret stores for GitOps.

First checks

  • kubectl get secrets -A — (check RBAC to secrets)
  • kubectl get pods -A -o yaml | grep -i -A2 'env:' — secrets in env (review)
  • External Secrets/CSI driver usage — vault integration

Commands

docker inspect

Verify in this order

secret store → CSI/external secrets → pod

Where it usually breaks

First mismatch in platform/workload identity → desired configuration → management/control plane → runtime enforcement → telemetry → workload/resource outcome; preserve identity/policy/pre-state before mutation.

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=5040

Confirmation

Confirm action

Continue?