Skip to main content

More Info:

Verifies allowPrivilegeEscalation is false on every container. It defaults to true, letting a process gain more privileges than its parent.

Risk Level

High

Address

Security

Compliance Standards

  • Cloudanix Best Practice

Triage and Remediation

Remediation

Manual Steps

  1. List all non-system pods and identify non-compliant ones (run on any machine with kubectl access):
  2. For a pod you need to fix, find its owning controller (Deployment, StatefulSet, DaemonSet, Job, etc.) (run on any machine with kubectl access):
    Note the kind and name. You will edit that controller, not the pod itself.
  3. Edit the owning controller manifest to set allowPrivilegeEscalation: false on every container (run on any machine with kubectl access):
    Open /tmp/${KIND}-${NAME}.yaml in an editor and, under each container (and initContainer) in spec.template.spec.containers and spec.template.spec.initContainers, ensure:
    If securityContext exists, add only the allowPrivilegeEscalation: false line; do not remove other fields.
  4. Apply the updated controller manifest so new pods are compliant (run on any machine with kubectl access):
  5. (Optional but recommended) Rotate existing non-compliant pods so they are recreated from the updated controller (run on any machine with kubectl access):
  6. Verification (run on any machine with kubectl access):
    Confirm the output is is_compliant=true or that all listed containers show is_compliant=true.
On any machine with kubectl access:
  1. Identify non-compliant Pods (for context)
  1. Edit the owning workload manifest to set allowPrivilegeEscalation: false on every container.
Example Deployment spec snippet (applies to any workload kind: Deployment, StatefulSet, DaemonSet, Job, CronJob, etc.):
Apply the updated manifest:
Repeat for every workload so that each spec.template.spec.containers[] and spec.template.spec.initContainers[] entry has:
  1. For naked Pods created directly (no controller), recreate them from a manifest that sets the field:
Apply:
  1. Verification (on any machine with kubectl access):
You are compliant when the output is is_compliant=true or all listed containers show is_compliant=true.