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
-
Identify non-compliant pods (run on any machine with kubectl access):
-
For each non-compliant pod, determine its owner (run on any machine with kubectl access):
- If there is no ownerReference, the Pod is standalone and must be fixed directly.
- If there is an owner (Deployment, DaemonSet, StatefulSet, Job, etc.), you must edit that owner resource instead of the Pod.
-
Edit the owning workload (preferred) to remove host namespace sharing (run on any machine with kubectl access):
In the opened manifest:
- Locate
.spec.template.spec.hostPID,.spec.template.spec.hostIPC, and.spec.template.spec.hostNetwork. - Set each present field to
false:or delete the lines entirely so they are omitted. Save and exit; Kubernetes will recreate pods from this workload. Be aware this may restart application pods and briefly disrupt traffic.
- Locate
-
If the Pod is standalone (no controller), edit or recreate it from a manifest (run on any machine with kubectl access):
- If you have a manifest in version control, update it so the pod spec does not set these fields (omit them or set to
false):Then: - If there is no manifest, export, edit, and re-create:
This will delete and recreate the pod; expect a restart and potential brief downtime.
- If you have a manifest in version control, update it so the pod spec does not set these fields (omit them or set to
-
Repeat steps 2–4 for all pods reported as
is_compliant=false, ensuring all updated specs havehostPID,hostIPC, andhostNetworkeither omitted or explicitly set tofalse. -
Verify remediation (run on any machine with kubectl access):
Confirm the output is
is_compliant=trueand that no lines showis_compliant=false.
Using kubectl
Using kubectl
On any machine with kubectl access:For bare Pods (not managed by a controller):If you had to delete and recreate a bare Pod:
- Identify offending pods and their controllers (exclude system namespaces per the audit):
- For each owning controller (Deployment, DaemonSet, StatefulSet, Job, CronJob, or bare Pod), export its manifest:
- Edit the manifest to remove or explicitly set the host namespace fields under
spec.template.spec(orspecfor a bare Pod):
- Apply the updated manifest:
- Verification (re-run the audit and confirm all non-system pods are
is_compliant=true):
Automation
Automation

