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
HighAddress
SecurityCompliance Standards
- CIS EKS
Triage and Remediation
- Remediation
Remediation
Manual Steps
Manual Steps
-
Identify pods using
hostIPC(informational).
Run on any machine with kubectl access: -
Review and plan to change offending workloads.
For each listed pod, identify the owning workload (Deployment/StatefulSet/Job, etc.):Decide whetherhostIPCis truly required. If absolutely required, document the exception and plan a Pod Security (or PSP/replacement) policy that narrowly permits it only where needed. -
Remove
hostIPC: truefrom workload manifests.
For each offending workload, edit the manifest and delete thehostIPC: trueline underspec.template.spec(or underspecfor naked Pods). Example usingkubectl edit(on any machine with kubectl access):In the editor, remove:Save and exit. Repeat for StatefulSets, Jobs, DaemonSets, and any standalone Pods. -
Apply restrictive Pod Security (or equivalent) policy at the namespace level.
For Kubernetes 1.25+ using Pod Security admission, label each namespace with at leastrestricted(which forbidshostIPC: trueby default):Repeat for every namespace that hosts user workloads. -
Recreate or roll pods so changes take effect.
For controller-managed workloads (Deployments/StatefulSets/DaemonSets), trigger a rollout:For any remaining naked Pods that specifiedhostIPC: true, delete and recreate them from the updated manifests: -
Verify no pods use
hostIPC.
Run on any machine with kubectl access:Ensure the output is:
Using kubectl
Using kubectl
On any machine with kubectl access:Apply similar labels to every namespace that runs user workloads, replacing Apply:
- Create a restrictive
PodSecurityadmission label (for clusters using Pod Security Admission)
default:- (Alternative/Additional) Apply a
PodSecurityPolicy-style restriction via Gatekeeper/PSP replacement
If you use Gatekeeper or a similar admission controller, apply a policy that disallowshostIPC: truein pods. Example GatekeeperConstraintTemplateandConstraint(save asdeny-hostipc.yamland apply):
- Verification (any machine with kubectl access)
Automation
Automation

