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
- APRA CPS 234 (Australia)
- BSI C5 (Germany)
- Brazil LGPD
- CCPA / CPRA (California)
- CIS Critical Security Controls v8
- CIS GKE
- CMMC 2.0
- CSA Cloud Controls Matrix v4
- DPDPA
- Digital Operational Resilience Act (EU)
- Essential 8
- ISO/IEC 27017
- ISO/IEC 27018
- ISO/IEC 27701
- KSA PDPL
- MAS Technology Risk Management (Singapore)
- MITRE ATT&CK (Cloud)
- NIST SP 800-171
- NYDFS 23 NYCRR 500
- SWIFT Customer Security Controls Framework
- Sarbanes-Oxley IT General Controls
- UK NCSC Cyber Assessment Framework
Triage and Remediation
- Remediation
Remediation
Manual Steps
Manual Steps
-
List all namespaces and their pod security controls
- On any machine with kubectl access:
- Review whether namespaces are using PodSecurityPolicy (PSP, older clusters) or Pod Security Admission labels (e.g.,
pod-security.kubernetes.io/enforce=*). Note any namespaces without clear pod security controls.
- On any machine with kubectl access:
-
Identify workloads that explicitly allow privilege escalation
- On any machine with kubectl access:
- For each hit, inspect the full pod spec (or its controller) to see where
allowPrivilegeEscalation: trueis set:
- On any machine with kubectl access:
-
Review higher‑level controllers/manifests that generate these pods
- On any machine with kubectl access, for namespaces with hits:
- For each controller that sets
allowPrivilegeEscalation: true, decide whether it is strictly required (e.g., low‑level system daemon) or can be removed/changed. Document any business or technical justification wheretrueis needed.
- On any machine with kubectl access, for namespaces with hits:
-
Review or design policy to prevent unwanted privilege escalation
- If using PSP (legacy):
- On any machine with kubectl access:
- Confirm at least one PSP has
.spec.allowPrivilegeEscalationomitted or set tofalse, and that it is actually bound via RBAC to the service accounts in the affected namespaces.
- On any machine with kubectl access:
- If using Pod Security Admission or another admission controller (OPA/Gatekeeper, Kyverno, etc.), review those policies to ensure they disallow
allowPrivilegeEscalation: trueexcept for explicitly approved namespaces/service accounts.
- If using PSP (legacy):
-
Adjust manifests and/or policies where appropriate
- For application workloads that do not need privilege escalation, edit their manifests (Git/IaC repo or
kubectl editas a temporary measure) to remove the field or set it tofalse, then redeploy: - Update PSP or policy definitions so that, by default, containers cannot set
allowPrivilegeEscalation: true, and only explicitly carved‑out components (if any) are allowed.
- For application workloads that do not need privilege escalation, edit their manifests (Git/IaC repo or
-
Re‑verify the cluster state and policy coverage
- On any machine with kubectl access:
- Confirm that only intentionally approved workloads are able to run with
allowPrivilegeEscalation: true, and that this is documented and justified.
- On any machine with kubectl access:
Using kubectl
Using kubectl
Using kubectl
1. Identify pods that request allowPrivilegeEscalation: true
Run on: any machine with kubectl access.- Any line in the output shows a pod/container explicitly setting
allowPrivilegeEscalationtotrue. - These should be reviewed; in most workloads this should be
falseor unset.
jq:- Any occurrence of
allowPrivilegeEscalation: truein containersecurityContextblocks.
2. Check pods that omit allowPrivilegeEscalation (rely on defaults)
Cluster defaults may allow escalation if not explicitly denied. List all pods and inspect security context details:- Containers whose
securityContextis null or does not containallowPrivilegeEscalation: false, and you know there is no cluster-wide policy (e.g., PSP, PodSecurity admission, or other policy engine) enforcingallowPrivilegeEscalation=false. - These need human review: either set
allowPrivilegeEscalation: falsein pod specs or rely on a clear cluster policy.
3. Review namespace-level posture
List all pods per namespace where escalation is explicitly allowed:- Namespaces with counts > 0 have workloads explicitly allowing privilege escalation.
- Focus review on those namespaces; they may need policy tightening and manifest changes.
4. Review pod specs in problematic namespaces
For a specific namespace you want to examine (replaceTARGET_NAMESPACE):- Containers in that namespace with
allowPrivilegeEscalation: true. - Containers lacking an explicit
allowPrivilegeEscalation: falsewhere you expect strict hardening.
5. Verification after you make policy/manifest decisions
Once you have updated policies/manifests and redeployed:- For namespaces you want hardened, the above command should return no lines.
- Any remaining entries must be explicitly accepted exceptions after human review.
Automation
Automation
- In the “PodSecurityPolicy review” section, any PSP where
allowPrivilegeEscalationistrueornull/missing should be reviewed; per the benchmark, it should be omitted or set tofalse. - In the “Pods with containers that allow privilege escalation” section:
- Any line shown is a problem: that container has
allowPrivilegeEscalation=true. - The columns are:
NAMESPACE POD TYPE CONTAINER_NAME allowPrivilegeEscalation=true.
- Any line shown is a problem: that container has
- In the “Summary count” section:
- Any namespace listed has at least one container with
allowPrivilegeEscalation=true; higher counts indicate higher remediation priority.
- Any namespace listed has at least one container with

