Skip to main content

More Info:

Privileged containers can access host devices and escape isolation. Enforce Pod Security Admission policies in each namespace with user workloads to restrict privileged container admission.

Risk Level

Critical

Address

Security

Compliance Standards

  • CIS OKE

Triage and Remediation

Remediation

Manual Steps

  1. List all namespaces and identify user-workload namespaces
    • Run on: any machine with kubectl access
    • From the output, determine which namespaces contain user workloads (excluding system/control namespaces such as kube-system, kube-public, kube-node-lease, kube-admin, and any provider-specific system namespaces).
  2. Review existing Pod Security Admission labels on user-workload namespaces
    • Run on: any machine with kubectl access
    • For each user namespace, check whether pod-security.kubernetes.io/enforce is present and whether its value is at least restricted for namespaces where privileged workloads must not be allowed.
  3. Identify current privileged pod usage and decide on required policy level
    • Run on: any machine with kubectl access
    • For each user namespace, decide if privileged containers are truly required. If privileged pods are in use and needed, you may need to keep a less strict policy (e.g., baseline or no enforce label yet) or redesign those workloads. If they are not required, plan to enforce restricted.
  4. Apply or adjust Pod Security Admission labels per namespace
    • Run on: any machine with kubectl access
    • For namespaces where privileged containers must be prevented:
    • Optionally, to introduce a gentler rollout by warning before enforcing, you can use:
  5. Optionally set default warnings cluster-wide, then tighten per-namespace
    • Run on: any machine with kubectl access
    • Then override critical user namespaces individually with pod-security.kubernetes.io/enforce=restricted as in step 4, once you are confident workloads comply.
  6. Verify namespaces are correctly labeled and privileged pods are blocked
    • Run on: any machine with kubectl access
    • In a namespace where you set pod-security.kubernetes.io/enforce=restricted, attempt to create a privileged pod and confirm it is rejected:
    • Ensure the API server denies this pod, confirming privileged containers are minimized in that namespace.
Problem indication:
  • ENFORCE is empty (<none>) for namespaces that host user workloads.
  • ENFORCE is set to privileged in any user-workload namespace.
  • There is no WARN/AUDIT configuration where you expect at least visibility of violations.

Identify user workload namespaces (exclude system/control-plane):
Problem indication:
  • Any namespace returned here that, when checked in step 1, has no pod-security.kubernetes.io/enforce label, or has it set to privileged, needs review.

Drill into a single namespace’s PSA config:
Problem indication:
  • Missing pod-security.kubernetes.io/enforce label, or value not aligned with your policy (e.g., not restricted for sensitive/user-facing workloads).
  • Conflicting or unexpected combinations of enforce, warn, and audit labels.

Review currently admitted privileged workloads:
Problem indication:
  • Any line in the output shows a privileged container. For those namespaces:
    • Check whether PSA enforce is absent or too permissive (from steps 1–3).
    • Decide if those privileged pods are truly justified; if not, the namespace’s PSA policy is likely too weak.