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 EKS
- 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 namespaces that host user workloads (to decide where to apply restriction)
- Run on: any machine with kubectl access
Identify all non-system namespaces (exclude those starting with kube- and the default system ones used by your provider) where you deploy applications. -
For each selected namespace, create a baseline Pod Security admission label set (if not already present) that disallows privilege escalation (Pod Security “restricted” level)
- Run on: any machine with kubectl access
- Example for one namespace named
prod-apps(repeat for each target namespace, adjusting the name):
-
If Pod Security Admission is not available in your cluster, create a restrictive policy object (e.g., Kyverno or Gatekeeper) that denies
allowPrivilegeEscalation: truein target namespaces- Run on: any machine with kubectl access
- Example: Kyverno ClusterPolicy (save as
/tmp/deny-allow-priv-escalation.yaml, then apply):
Apply it: -
Update existing workload manifests in target namespaces so that containers cannot request privilege escalation
- Run on: any machine with kubectl access
- Export and edit a workload (example Deployment in
prod-apps):
- In
/tmp/myapp-deploy.yaml, under each container, ensure:
- Apply the updated manifest:
-
Proactively block future changes that reintroduce
allowPrivilegeEscalation: trueby placing the namespace-level restriction under version control and reviewing any exception requests- Run on: any machine with kubectl access
- Export namespace config (for Git/IaC management):
-
Verification (no pods with
allowPrivilegeEscalation: trueremain)- Run on: any machine with kubectl access
Using kubectl
Using kubectl
If your cluster does not support PodSecurityPolicy (PSP is removed in newer Kubernetes/EKS versions), use a ValidatingAdmissionPolicy or a policy engine like Gatekeeper/Kyverno instead. Below is an example with ValidatingAdmissionPolicy (Kubernetes ≥ 1.30 or EKS with this feature enabled).
Automation
Automation

