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 reported pod, identify whether it is managed by a higher-level controller (Deployment, StatefulSet, DaemonSet, Job, etc.) by reviewing the
owner=field from the previous output, or by describing it (run on any machine with kubectl access, example namespace/name): -
If the pod is managed by a controller (preferred approach), edit the controller’s manifest to remove host namespace sharing (run on any machine with kubectl access):
In the editor, under
spec.template.spec, ensure:Save and exit; Kubernetes will roll out updated pods. -
If the pod is standalone (no controller), delete and recreate it from a corrected manifest (run on any machine with kubectl access):
Edit
/tmp/<POD_NAME>.yamlwith a text editor:- Remove
metadata.resourceVersion,metadata.uid,metadata.managedFields,metadata.creationTimestamp,metadata.ownerReferences,status, and other runtime-only fields. - Under
spec, remove or set:
- Remove
- For workloads that legitimately require host namespaces (e.g., certain monitoring/telemetry agents), document the justification and ensure they are limited to the minimal namespaces needed and to trusted namespaces/nodes. Consider using dedicated node pools and labels/taints to isolate such pods.
-
Verify that no non-system pod shares host namespaces (run on any machine with kubectl access):
Confirm the output is either
is_compliant=trueor shows all remaining non-compliant pods as explicitly accepted exceptions.
Using kubectl
Using kubectl
On any machine with kubectl access:Apply updated manifest:b. Edit c. Delete and recreate the pod:
- Identify non-compliant pods (for context)
- Edit or patch workload manifests (Deployments, DaemonSets, etc.) to remove or disable host namespaces.
- If you must adjust a naked Pod (not controlled by a higher-level object), recreate it with compliant spec:
/tmp/pod-fixed.yaml: remove status: section and remove or set to false these fields under spec:- Verification (same machine with kubectl):
Automation
Automation

