User namespaces: when would you enable `userns-remap`?
AdvancedScenarioSecurity and scanning
Answer
Situation read → You want container root to map to an unprivileged host UID without going fully rootless.
What I'd do → Set {"userns-remap": "default"} in daemon.json; Docker creates dockremap and uses /etc/subuid. Be aware: images and volumes get re-owned under a separate storage dir, and features like --privileged, host networking and some volume drivers are restricted.
Why → Root escape lands as a non-root UID on the host.
Interview tip → Rootless mode is the stronger alternative for new setups.
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.IntermediateA pentester got root inside a container. How bad is it?Advanced