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 a host namespace (run on any machine with kubectl access):
-
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.specand ensure:Save and exit to apply the change. Kubernetes will recreate pods with the updated spec. -
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.yamland underspec:removehostPID,hostIPC,hostNetworkfields or set them tofalse, and delete fields that must not be reused (metadata.resourceVersion,metadata.uid,metadata.creationTimestamp,metadata.managedFields,status). Then: -
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.
- 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).
-
Verify all non-system pods are compliant (run on any machine with kubectl access):
The cluster is compliant when the output is
is_compliant=trueand no rows showis_compliant=false.
Using kubectl
Using kubectl
On any machine with kubectl access:In the opened manifest, within 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 Delete and recreate:
- Identify non-compliant pods (excluding AKS system namespaces):
- For each listed pod, edit its controller (Deployment, StatefulSet, DaemonSet, Job, CronJob) so the template does not set host namespaces. Example for a Deployment:
spec.template.spec, ensure these fields are either removed or explicitly set to false:/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:
- Verification (same machine with kubectl):
Automation
Automation

