Interview Prep/Kubernetes/Security, RBAC and policy

How do you check who can do what in a cluster?

BeginnerScenarioSecurity, RBAC and policy
Answer

Situation read → Someone asks whether a ServiceAccount can delete pods.

What I'd do →

  1. kubectl auth can-i delete pods -n app --as system:serviceaccount:app:builder
  2. kubectl auth can-i --list -n app
  3. kubectl get rolebindings,clusterrolebindings -A -o wide
  4. Use kubectl-who-can or rbac-lookup plugins
  5. Review regularly

Why → can-i evaluates the real authorizer, including aggregated roles.

Interview tip → Mention impersonation permissions.

All Kubernetes questions Roadmap: Kubernetes networking, storage & scaling

More on Security, RBAC and policy