Interview Prep/DevSecOps/Secrets management: Vault, External Secrets and SOPS

Developers with only the namespace `edit` role can read production Secrets through `kubectl get secret -o yaml`

IntermediateTroubleshootingSecrets management: Vault, External Secrets and SOPS
Answer

Likely causes → The built-in edit (and admin) ClusterRoles include get/list/watch on Secrets. Even without them, any role that can create pods can mount any Secret in the namespace and read it.

Diagnose →

kubectl auth can-i get secrets -n prod [email protected]
kubectl auth can-i create pods -n prod [email protected]
kubectl get rolebinding -n prod -o wide

Fix → Give developers view (which excludes Secrets) in prod, plus a custom role for what they really need. Deploys should go through CI or GitOps, not humans holding edit.

Prevent → Keep real credentials in Vault or a cloud secret manager with per-workload access, and audit get/list on secrets with an audit policy at Metadata level.

All DevSecOps questions Roadmap: Supply chain, secrets & identity

More on Secrets management: Vault, External Secrets and SOPS