More Info:
Do not generally permit containers to be run with the allowPrivilegeEscalation flag set to true. Allowing this right can lead to a process running a container getting more rights than it started with.Risk Level
HighAddress
SecurityCompliance Standards
- CIS Kubernetes
Triage and Remediation
- Remediation
Remediation
Manual Steps
Manual Steps
-
List all pods with
allowPrivilegeEscalation=true(any machine with kubectl access) -
Decide which workloads are allowed an exception (manual review)
For each listed pod/container:- Determine if it is a user workload vs. a system/infra component.
- For user workloads, strongly prefer no privilege escalation.
- Only allow escalation if there is a documented, reviewed need (e.g., a process that must gain extra Linux capabilities after start).
- For system/infra workloads, prefer to run them in dedicated namespaces with a clearly documented exception policy.
-
Create or update a baseline policy in each user-workload namespace (any machine with kubectl access)
Example using aPodSecurityPolicy-style Kyverno policy (adjust to your chosen admission controller/tooling):Replaceuser-namespace-1,user-namespace-2with the actual namespaces that host user workloads. If you use PSA/PSP, configure the equivalent “restricted” behavior that forbids privilege escalation. -
Update existing workload manifests to disable privilege escalation (any machine with kubectl access)
For each non-exempt Deployment/StatefulSet/DaemonSet/Job in user namespaces, patch containers to setallowPrivilegeEscalation: false:Adjustnamespace,deployment, container index, and, if needed, merge with any existingsecurityContextinstead of overwriting it. -
Handle justified exceptions explicitly (any machine with kubectl access)
- For workloads you decided must keep
allowPrivilegeEscalation: true, place them in dedicated namespaces and/or label them, and update your admission policy to match on those namespaces/labels and allow the setting. - Document each exception: purpose, owner, review date, and risk acceptance.
- For workloads you decided must keep
-
Verify no pods are running with
allowPrivilegeEscalation=true(except approved exceptions) (any machine with kubectl access)Investigate anyis_compliant: falseentries and ensure they are either corrected or explicitly approved exceptions.
Using kubectl
Using kubectl
Automation
Automation

