More Info:
Verifies allowPrivilegeEscalation is false on every container. It defaults to true, letting a process gain more privileges than its parent.Risk Level
HighAddress
SecurityCompliance Standards
- Cloudanix Best Practice
Triage and Remediation
- Remediation
Remediation
Manual Steps
Manual Steps
-
Identify all noncompliant Pods
- On any machine with kubectl access:
- On any machine with kubectl access:
-
For Pods managed by higher-level controllers, patch the controller manifests
- For each noncompliant Pod line with
owner=Deployment/…,ReplicaSet/…,StatefulSet/…, orDaemonSet/…, note theownerkind, namespace, and name. - On any machine with kubectl access, edit the owning object (example for a Deployment; adapt
kind,namespace, andnameas needed): - In each
spec.template.spec.containers[]andspec.template.spec.initContainers[]entry, ensure:(addsecurityContextif missing; if present, add or setallowPrivilegeEscalation: false).
- For each noncompliant Pod line with
-
For Pods created directly (no controller owner), edit and recreate them
- For each noncompliant Pod line with no
owner=field: - Edit the file locally:
- Open the file and, under
spec.containers[]andspec.initContainers[]as needed, set: - Delete and recreate the Pod:
- For each noncompliant Pod line with no
-
If manifests are managed via Git/IaC, update source files
- Locate the YAML/Helm/Kustomize definitions for the noncompliant workloads.
- In each container and initContainer spec, set:
- Commit and apply/sync through your normal pipeline so the change persists.
-
Consider namespace-wide policy to prevent regression (optional but recommended)
- On any machine with kubectl access, create or update a
PodSecurityadmission label on namespaces where you want to enforce restricted settings, for example: - Review workload compatibility before enforcing to avoid inadvertent disruptions.
- On any machine with kubectl access, create or update a
-
Verify remediation
- After workloads are updated and reconciled, re-run the audit on any machine with kubectl access:
- Confirm the output is
is_compliant=trueor that all listed containers showallowPrivilegeEscalation=false is_compliant=true.
- After workloads are updated and reconciled, re-run the audit on any machine with kubectl access:
Using kubectl
Using kubectl
On any machine with kubectl access:If the Pod is controlled by a higher‑level object (Deployment, DaemonSet, Job, etc.), edit that controller; otherwise edit the Pod directly.Repeat similarly for other controllers, replacing
- Identify non‑compliant Pods and their owners (if any):
- Patch a standalone Pod to disallow privilege escalation (all containers and initContainers):
- Patch a Deployment so all its containers disallow privilege escalation:
deployment with daemonset, statefulset, job, or cronjob as appropriate.- Verification (runs on any machine with kubectl):
Automation
Automation

