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 a host namespace (run on any machine with kubectl access):
  2. For each non-compliant pod, identify and edit its owning workload (Deployment/DaemonSet/StatefulSet/Job/CronJob) in its namespace (run on any machine with kubectl access). Example for a Deployment:
    In the opened manifest, locate .spec.template.spec and ensure:
    Save and exit to apply the change. Kubernetes will recreate pods with the updated spec.
  3. If a non-compliant pod is standalone (no ownerReferences), fetch its manifest, modify, and re-create it (run on any machine with kubectl access):
    Edit /tmp/pod-fixed.yaml and under spec: remove hostPID, hostIPC, hostNetwork fields or set them to false, and delete fields that must not be reused (metadata.resourceVersion, metadata.uid, metadata.creationTimestamp, metadata.managedFields, status). Then:
  4. If the pod is managed by GitOps or other IaC, also update the source manifest so changes are not reverted (run in your IaC workflow environment). In the relevant YAML file, under the pod template:
    Commit and push through your normal deployment pipeline.
  5. For workloads that genuinely require host namespaces (for example, certain node-level monitoring/diagnostics agents), perform a risk review and formally document the exception. Keep the settings only where strictly necessary and ensure those pods are constrained (e.g., dedicated namespace, RBAC, NetworkPolicies).
  6. Verify all non-system pods are compliant (run on any machine with kubectl access):
    The cluster is compliant when the output is is_compliant=true and no rows show is_compliant=false.
On any machine with kubectl access:
  1. Identify non-compliant pods (excluding AKS system namespaces):
  1. For each listed pod, edit its controller (Deployment, StatefulSet, DaemonSet, Job, CronJob) so the template does not set host namespaces. Example for a Deployment:
In the opened manifest, within spec.template.spec, ensure these fields are either removed or explicitly set to false:
Save and exit; Kubernetes will roll out updated pods.If the pod is a standalone Pod (no controller), replace it with a compliant manifest:
Edit /tmp/pod-fixed.yaml:
  • Remove status fields and metadata fields that block creation (resourceVersion, uid, managedFields, etc.).
  • Under spec, set or remove host namespace fields:
Delete and recreate:
  1. Verification (same machine with kubectl):