More Info:
Containers sharing the host IPC namespace can access inter-process communication of other host processes. Their admission should be restricted via Pod Security Admission policies.Risk Level
HighAddress
SecurityCompliance Standards
- CIS AKS
Triage and Remediation
- Remediation
Remediation
Manual Steps
Manual Steps
-
Identify namespaces with user workloads
- Run on: any machine with kubectl access
Decide which namespaces are user-facing (exclude system namespaces likekube-system,kube-public,kube-node-lease, and cloud-provider/system add-on namespaces). -
Find existing pods that use
hostIPC: true- Run on: any machine with kubectl access
Review any listed pods with application owners and decide whetherhostIPCis strictly required. If not, plan to remove it from their Pod/Deployment/StatefulSet manifests and redeploy. -
Review current Pod Security labels on namespaces
- Run on: any machine with kubectl access
For each user namespace, check whetherpod-security.kubernetes.io/enforce(orpod-security.kubernetes.io/warn) is present and what level it is set to (privileged,baseline, orrestricted). Note thatrestricteddisallowshostIPC: true. -
Decide the appropriate policy level per namespace
- For each user namespace:
- If no workloads require
hostIPC, plan to enforcerestricted. - If some workloads temporarily require
hostIPC, considerbaselineor an exception namespace for those workloads, and plan to migrate them offhostIPCwhere possible. - Document any justified exceptions, including owning team, purpose, and review date.
- If no workloads require
- For each user namespace:
-
Apply or adjust namespace Pod Security labels
- Run on: any machine with kubectl access
- To enforce
restrictedwherehostIPCis not required: - To add a warning-level policy (e.g., cluster-wide baseline warnings):
NAMESPACEwith each chosen user namespace. Coordinate with application owners before enforcing in production to avoid unexpected admission failures. -
Verify the effect of the policy and current usage
- Confirm namespace labels:
- Attempt (in a test namespace) to create a pod with
hostIPC: trueand ensure it is rejected whereenforce=restrictedis set. - Re-run the
hostIPCusage scan to confirm no unintendedhostIPCpods remain:
- Confirm namespace labels:
Using kubectl
Using kubectl
Using kubectl
1. List pods using hostIPC
Run on: any machine with kubectl access.- Any line (other than the header) where
HOST_IPCistrueis a pod sharing the host IPC namespace and must be reviewed.
.spec.hostIPC: true→ this pod is sharing host IPC.
2. See current Pod Security Admission labels on namespaces
Run on: any machine with kubectl access.- Namespaces that run user workloads and:
- Have
ENFORCEunset or set toprivilegedmay allowhostIPC: trueunless other policies exist. - Use
baselineinstead ofrestrictedmay still allow some higher-risk options; verify separately with your policy requirements.
- Have
- Which namespaces should be hardened (e.g.,
enforce=restricted). - Whether any
hostIPC: truepods are strictly necessary for their workloads.
3. Check for namespace-level policies that might already restrict hostIPC (optional deeper review)
If you use Gatekeeper/OPA or other policy engines, list their constraints (example for Gatekeeper):- No constraints referencing
hostIPCor similar fields means nothing (beyond Pod Security Admission) is limiting host IPC usage, sohostIPC: truepods you found are likely admitted without additional controls.
These commands only surface the current state. A human must review which
hostIPC: true pods are justified and whether namespace labels and policies are appropriate for your risk tolerance.Automation
Automation
- In “Pods requesting hostIPC=true” and “Detail: pods with hostIPC=true and their containers”:
- Any listed pod is a potential issue. Each such pod should be reviewed to determine if hostIPC is strictly necessary.
- In “Summary: count of pods with hostIPC=true per namespace”:
- Namespaces with non‑zero
HOSTIPC_POD_COUNTrequire review; high counts suggest broader policy gaps.
- Namespaces with non‑zero
- In “Namespace Pod Security labels”:
- Namespaces running user workloads that:
- lack
pod-security.kubernetes.io/enforce=restricted, or - have no
ENFORCElabel at all, should be evaluated. If workloads do not require hostIPC or other privileged features, consider enforcing therestrictedprofile (or stronger controls via alternative mechanisms).
- lack
- Namespaces running user workloads that:

