Interview › Security & DevSecOps
How do you prevent privilege escalation in a Kubernetes cluster? [Advanced]
Answer
I prevent privilege escalation in Kubernetes with least-privilege RBAC, Pod Security Admission restricted mode, no privileged containers, no hostPath/hostNetwork unless approved, dropped capabilities, allowPrivilegeEscalation=false, image/admission policies, secret access controls, and network segmentation.
Technical explanation
Cluster-admin should be tightly controlled and regularly audited.
Service accounts should not use default broad permissions and automountServiceAccountToken should be disabled when unnecessary.
Admission policies should prevent dangerous pod specs from reaching the cluster.
Hands-on example
Checklist: enforce restricted Pod Security for app namespaces, use Role not ClusterRole where possible, block privileged=true, block hostPath, require runAsNonRoot, restrict exec access in production, rotate service-account tokens, and monitor audit logs for escalation attempts.
Check how well your resume matches the role with our free resume checker— match score, ATS check, and the skills you're missing.
More Security & DevSecOps interview questions
- What are Kubernetes Pod Security Standards (privileged, baseline, restricted)? [Advanced]
- What are Linux capabilities, and why drop them in containers? [Advanced]
- What is the difference between authentication and authorization? [Advanced]
- What is the difference between encoding, encryption, and hashing? [Advanced]
- What is certificate management, and how do tools like cert-manager help? [Advanced]
- Why do you hash and salt passwords rather than encrypt them? [Advanced]
- What is the difference between symmetric and asymmetric encryption? [Advanced]
- What is encryption at rest versus in transit, and how do you ensure both? [Advanced]