Interview Prep/Docker/Image Security & Hardening

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.

All Docker questions Roadmap: Docker & containers

More on Image Security & Hardening