More Info:
Verifies no container sets securityContext.privileged=true. A privileged container can compromise the node and every other pod scheduled on it.Risk Level
CriticalAddress
SecurityCompliance Standards
- Cloudanix Best Practice
Triage and Remediation
- Remediation
Remediation
Manual Steps
Manual Steps
-
Identify all privileged containers (any machine with kubectl access):
-
For each affected pod, determine the owning controller (any machine with kubectl access). Replace NAMESPACE and POD_NAME:
- If empty: pod is standalone.
- If present: note
.kindand.nameto edit the right controller (e.g., Deployment, DaemonSet, StatefulSet).
-
Edit the owning controller or pod manifest to remove privileged mode (any machine with kubectl access). Examples (run one appropriate command per affected workload):
- Deployment:
- DaemonSet:
- StatefulSet:
- Standalone Pod:
initContainers) and remove or change:to either removeprivilegedentirely or explicitly set:If specific kernel capabilities are required, add only those instead of privileged: - Deployment:
-
If workloads are managed via manifest files or GitOps, update the source manifests (on your config/IaC repo workstation) so changes are not reverted. In each relevant YAML file, apply the same
securityContextedits as in step 3, then re-apply: -
Allow pods to be recreated with the new spec. For controllers this happens automatically; for standalone pods you may need to delete and recreate them if the spec is immutable (any machine with kubectl access):
-
Verify no containers are running privileged (any machine with kubectl access):
Ensure the output is either
is_compliant=trueor that every listed line ends withis_compliant=true.
Using kubectl
Using kubectl
On any machine with kubectl access:If this prints a kind such as Deployment/StatefulSet/DaemonSet/Job, you must edit that controller, not the pod.For other controller types:Ensure no container has This will cause a rolling update for Deployments/StatefulSets/DaemonSets; pods will be recreated with the new security context.Adjust the label selector to match your workload.Confirm that all listed containers show
- Identify the owning controller of the privileged pod
owner=.... If you only have the pod name, re-fetch it:- Export the current manifest for the owning controller
- Edit the manifest to remove privileged mode and (optionally) add specific capabilities
initContainers) that has securityContext.privileged: true, remove that field or set it to false. If you need specific kernel capabilities, set them explicitly.Minimal example patch in the pod template:privileged: true under securityContext.- Apply the updated manifest
- (Optional) Delete any existing non-compliant pods to accelerate rollout
- Verification
privileged=false and is_compliant=true, or that the output is is_compliant=true.Automation
Automation

