What does `no-new-privileges` protect against?
BeginnerProductionImage Security & Hardening
Answer
It sets the kernel no_new_privs bit so a process and its children cannot gain privileges through setuid binaries or file capabilities (sudo, su, ping with caps). It blocks local privilege escalation inside the container, even if a setuid binary exists in the image. Kubernetes equivalent: allowPrivilegeEscalation: false.
More on Image Security & Hardening
Why should containers not run as root, and how do you enforce it?BeginnerWhat is a distroless image and what are the trade-offs?BeginnerHow do you scan an image with Trivy and fail a CI build on serious findings?BeginnerHow do you manage Trivy false positives and accepted risks?IntermediateWhich `docker run` flags make up a hardened runtime baseline?BeginnerHow should secrets be handled in container workloads?Beginner