Impact & Risk Analysis
- Severity: High
- CIS Benchmark: CIS 5.16
- Impact: Process Manipulation & Host Shutdown. The Process ID (PID) namespace isolates the process ID space. If a container shares the host’s PID namespace, processes inside the container can see all processes on the host system. A malicious user with access to the container could identify, manipulate, or kill critical host processes (even
systemdor other containers), potentially shutting down the entire server.
Common Misconfiguration
Starting a container with the--pid=host flag. This is sometimes done for monitoring or debugging tools (like htop in a container) but is dangerous for standard applications as it breaks process-level isolation.
Vulnerable Example
Secure Example
Audit Procedure
Run the command below to inspect the PID mode of all containers:- Result: Check the
PidModevalue for each container. - Fail: If it returns
host. - Pass: If it returns an empty string or the container’s own ID (indicating private namespace).
Remediation
You should not start a container with the--pid=host argument unless explicitly required for debugging host processes. By default, all containers have the PID namespace enabled, meaning they cannot see or interact with processes outside their own sandbox.
