More Info:
Verifies no pod sets hostPID, hostIPC or hostNetwork. Sharing a host namespace breaks the isolation boundary between the pod and the node.Risk Level
CriticalAddress
SecurityCompliance Standards
- Cloudanix Best Practice
Triage and Remediation
- Remediation
Remediation
Manual Steps
Manual Steps
-
List all non-system pods that share any host namespace (run on any machine with kubectl access):
-
For each offending pod, identify its controller (Deployment/DaemonSet/StatefulSet/Job/etc.) and namespace (run on any machine with kubectl access; replace NAMESPACE and POD_NAME):
If empty, the pod is standalone and must be deleted and recreated from a corrected manifest.
-
Edit the owning workload to remove host namespace sharing (run on any machine with kubectl access; choose the correct kind and set NAMESPACE/NAME):
In the editor, under
spec.template.spec, ensure these fields are either removed or explicitly set to false:Save and exit; Kubernetes will roll out updated pods. -
For standalone pods not managed by a controller (run on any machine with kubectl access; replace NAMESPACE and POD_NAME):
Edit
/tmp/pod-POD_NAME.yamland underspecremovehostPID,hostIPC, andhostNetworkor set them tofalse. Also removemetadata.resourceVersion,metadata.uid,metadata.creationTimestamp,metadata.managedFields,status, and anyownerReferences. Then recreate: -
Repeat steps 2–4 for each non-compliant pod until all workloads have
hostPID,hostIPC, andhostNetworkomitted or set tofalsein their pod specs. -
Verify no remaining non-system pods share host namespaces (run on any machine with kubectl access):
Using kubectl
Using kubectl
On any machine with kubectl access:Example: if the running pod is not controlled by a higher-level object (standalone Pod), export, modify, and re-apply:Edit Delete and recreate the pod from the fixed manifest:Note: changing these fields causes pods to be recreated by their controllers, which may briefly disrupt workloads using host namespaces.
- Identify all pods using host namespaces (excluding core namespaces, as per the audit):
- For each non-compliant pod, edit its controller manifest (Deployment, StatefulSet, DaemonSet, Job, etc.) to ensure
hostPID,hostIPC, andhostNetworkare not set to true.
/tmp/pod-fixed.yaml and in spec remove hostPID, hostIPC, and hostNetwork fields entirely, or set them to false:- Verification (on any machine with kubectl access):
is_compliant=true for all remaining rows or a single is_compliant=true line:Automation
Automation

