Skip to main content

More Info:

Containers with allowPrivilegeEscalation set to true can gain more privileges than their parent process. Restrict their admission via namespace policies.

Risk Level

High

Address

Security

Compliance Standards

  • CIS EKS

Triage and Remediation

Remediation

Manual Steps

  1. Identify namespaces with user workloads that allow privilege escalation
    Run on: any machine with kubectl access
  2. 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 labels pod-security.kubernetes.io/enforce=restricted, or a validating admission webhook such as Kyverno or OPA/Gatekeeper) to reject pods where any container has securityContext.allowPrivilegeEscalation: true. Follow your chosen tool’s documentation to create that policy and apply it to each user-workload namespace.
  3. 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.
  4. 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 omits allowPrivilegeEscalation or explicitly sets it to false:
    In the editor, under each spec.template.spec.containers[].securityContext (and initContainers if present), ensure:
  5. 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 with kubectl edit, apply them:
    For Helm-managed workloads, update the values and upgrade:
  6. Verification
    Run on: any machine with kubectl access
    Confirm the output is: