Skip to main content

More Info:

Privileged containers run with elevated host capabilities and can compromise the underlying node. Use Pod Security Admission policies to restrict their admission.

Risk Level

Critical

Address

Security

Compliance Standards

  • CIS EKS

Triage and Remediation

Remediation

Manual Steps

  1. Identify namespaces with user workloads
    Run on: any machine with kubectl access
    Decide which namespaces are user / application namespaces (exclude system namespaces like kube-system, kube-public, kube-node-lease, etc., unless you explicitly want PSA there).
  2. Enforce restricted Pod Security Admission on each user namespace
    Run on: any machine with kubectl access
    For each chosen namespace, run (replace MY-NAMESPACE with the actual name):
    This blocks creation of pods that request privileged containers in that namespace.
  3. Optionally add warning-only policy cluster‑wide
    Run on: any machine with kubectl access
    This does not block pods, but surfaces warnings where they violate baseline:
  4. Handle existing privileged pods (if any) by policy decision
    Run on: any machine with kubectl access
    List privileged pods:
    For each listed pod:
    • Decide if it is truly required; if not, delete it:
    • If required, plan a safer replacement (e.g., remove privileged: true and use more granular capabilities) and update the Deployment/DaemonSet/StatefulSet manifest that owns it.
  5. Recreate workloads with compliant securityContext
    Run on: any machine with kubectl access
    For each owning controller (Deployment/DaemonSet/StatefulSet, etc.) that used privileged containers, edit its manifest to remove privileged: true, then apply:
    The controller will recreate pods that comply with the restricted policy.
  6. Verification
    Run on: any machine with kubectl access
    Confirm the output is: