Impact & Risk Analysis
- Severity: High
- CIS Benchmark: CIS 5.2.3
- Impact: Process Inspection & Privilege Escalation. A container running in the host’s PID namespace (
hostPID: true) can inspect all processes running on the host, not just those inside the container. If the container also hasptracecapabilities (which are often default or easily acquired), an attacker can attach to a host process (likesystemdor a privileged daemon) and inject code to gain root access to the entire node.
Common Misconfiguration
EnablinghostPID: true for monitoring agents or sidecars that need to collect metrics. While sometimes necessary for tools like Datadog or Prometheus Node Exporter, it should never be enabled for standard application workloads.
Vulnerable Example
Secure Example
Audit Procedure
Run the following command to check for pods using the host PID namespace:- Result: The output will list the pod name followed by its
hostPIDsetting. - Fail: If you see
truefor any pod that is not a known, trusted system component (likenode-exporterorkube-proxy).
Remediation
Configure the Admission Controller (such as Pod Security Admission) to restrict the admission ofhostPID containers.
Using Pod Security Admission:
Apply the baseline or restricted profile to your namespaces. Both profiles strictly forbid hostPID: true.

