Interview › Security & DevSecOps
What are Linux capabilities, and why drop them in containers? [Advanced]
Answer
Linux capabilities split root privileges into smaller permission units such as NET_ADMIN, SYS_ADMIN, CHOWN, and NET_BIND_SERVICE. Containers should drop unnecessary capabilities because a process running with extra capabilities can escape intended restrictions or increase impact after compromise.
Technical explanation
By default, containers may receive capabilities they do not need.
Dropping ALL and adding back only what is required follows least privilege.
Some capabilities, especially SYS_ADMIN, are broad and should be avoided unless there is a strong reason.
Hands-on example
Example: a web service does not need NET_ADMIN or SYS_PTRACE. Configure capabilities.drop: ['ALL']. If it must bind to port 80, prefer a higher container port mapped by the Service, or add only NET_BIND_SERVICE if absolutely required.
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 is the difference between authentication and authorization? [Advanced]
- How do you prevent privilege escalation in a Kubernetes cluster? [Advanced]
- What is certificate management, and how do tools like cert-manager help? [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]
- What is the difference between encoding, encryption, and hashing? [Advanced]
- Why do you hash and salt passwords rather than encrypt them? [Advanced]