Interview Prep/DevSecOps/Kubernetes Security

What are Linux capabilities, and why do we drop ALL?

IntermediateConceptKubernetes Security
Answer

Capabilities split root's power into about 40 units (CAP_NET_ADMIN, CAP_SYS_ADMIN, CAP_NET_RAW and so on). Container runtimes grant a default set that includes NET_RAW (ARP/DNS spoofing within the node network), CHOWN, SETUID and others most apps never use.

Dropping ALL and adding back only what is needed shrinks what an attacker can do after code execution. The common add-back is NET_BIND_SERVICE to bind ports below 1024, and even that is avoidable by listening on 8080. CAP_SYS_ADMIN is close to full root and should be treated like privileged: true.

All DevSecOps questions Roadmap: Supply chain, secrets & identity

More on Kubernetes Security