More Info:
Containers with allowPrivilegeEscalation set to true can gain more privileges than their parent process. Restrict their admission via namespace policies.Risk Level
HighAddress
SecurityCompliance Standards
- CIS EKS
Triage and Remediation
- Remediation
Remediation
Manual Steps
Manual Steps
-
Identify namespaces with user workloads that allow privilege escalation
Run on: any machine with kubectl access -
Create or update a Pod Security Admission configuration to forbid allowPrivilegeEscalation
Run on: any machine with kubectl access
Save this to a file, for example/tmp/psa-restrict-allow-priv-escalation.yaml:PodSecurityPolicy is deprecated/removed in most EKS clusters and there is no single standard policy object defined in the benchmark text. You must choose and configure a namespace-level admission control mechanism supported by your environment (for example: built-in Pod Security Admission labelspod-security.kubernetes.io/enforce=restricted, or a validating admission webhook such as Kyverno or OPA/Gatekeeper) to reject pods where any container hassecurityContext.allowPrivilegeEscalation: true. Follow your chosen tool’s documentation to create that policy and apply it to each user-workload namespace. -
Label user-workload namespaces to use the chosen restrictive policy mechanism
Run on: any machine with kubectl access
Example for built-in Pod Security Admission (if enabled in your cluster):If using another mechanism (Kyverno, Gatekeeper, etc.), apply the equivalent namespace selectors/labels that make your “no allowPrivilegeEscalation=true” policy apply to those namespaces. -
Manually review and update existing workloads that currently set allowPrivilegeEscalation: true
Run on: any machine with kubectl access
List offending pods with owners to identify the controllers you must edit:For each controller (Deployment/DaemonSet/StatefulSet/Job/etc.), edit the manifest so that every container and initContainer either omitsallowPrivilegeEscalationor explicitly sets it tofalse:In the editor, under eachspec.template.spec.containers[].securityContext(andinitContainersif present), ensure: -
Recreate or restart workloads if needed to pick up policy-compliant settings
Run on: any machine with kubectl access
If you changed manifests in Git/IaC instead of withkubectl edit, apply them:For Helm-managed workloads, update the values and upgrade: -
Verification
Run on: any machine with kubectl accessConfirm the output is:
Using kubectl
Using kubectl
Automation
Automation

