Interview Prep/DevSecOps/Kubernetes Security

Every developer has `cluster-admin` on the shared cluster "because it is easier". How do you fix RBAC without a revolt?

BeginnerScenarioKubernetes Security
Answer

Situation read → cluster-admin for everyone means any compromised laptop owns the cluster. Fix it gradually with good defaults.

What I'd do →

  1. Find who has it: kubectl get clusterrolebindings -o wide | grep cluster-admin.
  2. Create a namespaced Role for app teams (deployments, services, configmaps, pods/log) and bind it per team namespace with a RoleBinding.
  3. Give a cluster-wide read-only ClusterRole for visibility, excluding secrets.
  4. Keep cluster-admin for a small platform group via JIT elevation.
  5. Test with kubectl auth can-i --list [email protected] -n orders before removing old bindings.

Why → Teams keep full control of their own namespaces, so daily work does not change.

Interview tip → kubectl auth can-i shows you verify RBAC rather than guess.

All DevSecOps questions Roadmap: Supply chain, secrets & identity

More on Kubernetes Security