Interview Prep/DevSecOps/Kubernetes Security Posture

A team has `edit` rights in their namespace. Can they read Secrets, and how do you limit that?

IntermediateProductionKubernetes Security Posture
Answer

Yes. The built-in edit role includes reading Secrets, and anyone who can create pods can mount any Secret in that namespace anyway. So "edit but cannot see secrets" is not achievable with RBAC alone.

What we do:

  • Use a custom developer role without secrets verbs for humans in production; deployments happen through GitOps service accounts.
  • Keep real secrets in an external manager and mount them via the Secrets Store CSI driver, with access tied to the workload's service account identity.
  • Separate highly sensitive workloads into their own namespaces with tighter bindings.
  • Audit get secrets events on production namespaces.
All DevSecOps questions Roadmap: Supply chain, secrets & identity

More on Kubernetes Security Posture