Skip to main content

More Info:

Containers sharing the host IPC namespace can access inter-process communication resources of the node. Restrict admission of hostIPC containers via namespace policies.

Risk Level

High

Address

Security

Compliance Standards

  • CIS EKS

Triage and Remediation

Remediation

Manual Steps

  1. Identify pods using hostIPC (informational).
    Run on any machine with kubectl access:
  2. Review and plan to change offending workloads.
    For each listed pod, identify the owning workload (Deployment/StatefulSet/Job, etc.):
    Decide whether hostIPC is truly required. If absolutely required, document the exception and plan a Pod Security (or PSP/replacement) policy that narrowly permits it only where needed.
  3. Remove hostIPC: true from workload manifests.
    For each offending workload, edit the manifest and delete the hostIPC: true line under spec.template.spec (or under spec for naked Pods). Example using kubectl edit (on any machine with kubectl access):
    In the editor, remove:
    Save and exit. Repeat for StatefulSets, Jobs, DaemonSets, and any standalone Pods.
  4. Apply restrictive Pod Security (or equivalent) policy at the namespace level.
    For Kubernetes 1.25+ using Pod Security admission, label each namespace with at least restricted (which forbids hostIPC: true by default):
    Repeat for every namespace that hosts user workloads.
  5. Recreate or roll pods so changes take effect.
    For controller-managed workloads (Deployments/StatefulSets/DaemonSets), trigger a rollout:
    For any remaining naked Pods that specified hostIPC: true, delete and recreate them from the updated manifests:
  6. Verify no pods use hostIPC.
    Run on any machine with kubectl access:
    Ensure the output is:
On any machine with kubectl access:
  1. Create a restrictive PodSecurity admission label (for clusters using Pod Security Admission)
Apply similar labels to every namespace that runs user workloads, replacing default:
  1. (Alternative/Additional) Apply a PodSecurityPolicy-style restriction via Gatekeeper/PSP replacement
    If you use Gatekeeper or a similar admission controller, apply a policy that disallows hostIPC: true in pods. Example Gatekeeper ConstraintTemplate and Constraint (save as deny-hostipc.yaml and apply):
Apply:
  1. Verification (any machine with kubectl access)