What are the dangers of `--pid=host`, `--net=host`, `--ipc=host`, `--uts=host`?
BeginnerProductionImage Security & Hardening
Answer
Each removes a namespace boundary: host PID lets a process signal or ptrace host processes (with caps) and read /proc/*/environ; host net exposes all host sockets and localhost services (including cloud metadata at 169.254.169.254); host IPC exposes shared memory. Allow only for vetted monitoring agents.
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?BeginnerWhat does `no-new-privileges` protect against?Beginner