A pentester got root inside a container. How bad is it?
AdvancedScenarioSecurity and scanning
Answer
Situation read → Depends on isolation settings.
What I'd do → Check: is it privileged? docker.sock mounted? host PID/net namespace? sensitive host paths bind-mounted? dangerous capabilities (SYS_ADMIN, SYS_MODULE)? kernel version (container escapes like runc CVEs)? If none, root in the container is still uid 0 mapped to host root unless userns is on, but confined by namespaces, cgroups, seccomp and capabilities.
Why → Container root is not host root only because of those layers.
Interview tip → Use capsh --print and cat /proc/self/status | grep Cap inside to assess.
More on Security and scanning
A scan reports 300 CVEs in your base image. How do you triage?IntermediateAdd vulnerability scanning to CI so critical findings block the merge.BeginnerWhy is mounting `/var/run/docker.sock` into a container dangerous?IntermediateA developer asks for `--privileged`. What do you do?IntermediateHarden a container run command for a stateless web API.IntermediateChoose a base image strategy for security across the company.Advanced