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.
More on Secrets management: Vault, External Secrets and SOPS
`vault kv get secret/app/db` returns `Code: 403. Errors: * permission denied` although the policy allows `secret/app/*`BeginnerVault pod restarted and `vault status` shows `Sealed: true`; every app now fails to fetch secretsBeginnerPod stuck in `Init:0/1`; the `vault-agent-init` container logs `error authenticating: ... Code: 403 ... * permission denied`IntermediateAfter a cluster upgrade, Vault Kubernetes auth fails for every pod with `error validating token: invalid issuer (iss) claim`AdvancedPods annotated with `vault.hashicorp.com/agent-inject: true` start without a Vault sidecar, and the app fails on a missing fileBeginnerExternalSecret shows `SecretSyncedError` with `AccessDeniedException: ... is not authorized to perform: secretsmanager:GetSecretValue`Intermediate