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 →
kubectl auth can-i delete pods -n app --as system:serviceaccount:app:builderkubectl auth can-i --list -n appkubectl get rolebindings,clusterrolebindings -A -o wide- Use
kubectl-who-canorrbac-lookupplugins - Review regularly
Why → can-i evaluates the real authorizer, including aggregated roles.
Interview tip → Mention impersonation permissions.
More on Security, RBAC and policy
A developer needs read-only access to one namespace. How do you grant it?BeginnerExplain the difference between Role, ClusterRole, RoleBinding and ClusterRoleBinding.IntermediateA CI pipeline needs to deploy to one namespace. What identity do you give it?IntermediateWhat does a ServiceAccount do and why should you disable the token automount?BeginnerHow do you let pods on EKS access S3 without static keys?IntermediateA pod has access to the node's IAM role through IMDS. How do you prevent credential theft?Advanced