Skip to main content

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

Critical

Address

Security

Compliance Standards

  • Cloudanix Best Practice

Triage and Remediation

Remediation

Manual Steps

  1. List all non-system pods that share any host namespace (run on any machine with kubectl access):
  2. 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):
  3. 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.
  4. 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>.yaml with 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:
    Apply the corrected manifest and delete the old pod:
  5. 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.
  6. Verify that no non-system pod shares host namespaces (run on any machine with kubectl access):
    Confirm the output is either is_compliant=true or shows all remaining non-compliant pods as explicitly accepted exceptions.
On any machine with kubectl access:
  1. Identify non-compliant pods (for context)
  1. Edit or patch workload manifests (Deployments, DaemonSets, etc.) to remove or disable host namespaces.
Example manifest snippet (desired state – ensure all three are false or omitted):
Apply updated manifest:
  1. If you must adjust a naked Pod (not controlled by a higher-level object), recreate it with compliant spec:
a. Export current spec:
b. Edit /tmp/pod-fixed.yaml: remove status: section and remove or set to false these fields under spec:
c. Delete and recreate the pod:
  1. Verification (same machine with kubectl):