Skip to main content

More Info:

Do not generally permit containers with capabilities

Risk Level

Low

Address

Security

Compliance Standards

  • APRA CPS 234 (Australia)
  • BSI C5 (Germany)
  • Brazil LGPD
  • CCPA / CPRA (California)
  • CIS Critical Security Controls v8
  • CIS EKS
  • CMMC 2.0
  • CSA Cloud Controls Matrix v4
  • DPDPA
  • Digital Operational Resilience Act (EU)
  • Essential 8
  • ISO/IEC 27017
  • ISO/IEC 27018
  • ISO/IEC 27701
  • KSA PDPL
  • MAS Technology Risk Management (Singapore)
  • MITRE ATT&CK (Cloud)
  • NIS2 Directive
  • NIST SP 800-171
  • NYDFS 23 NYCRR 500
  • SWIFT Customer Security Controls Framework
  • Sarbanes-Oxley IT General Controls
  • UK NCSC Cyber Assessment Framework

Triage and Remediation

Remediation

Manual Steps

  1. On any machine with kubectl access, list all namespaces and identify those that should be “locked down” (no workloads needing Linux capabilities), for example dev/test or simple stateless apps:
    Optionally label target namespaces for easier selection:
  2. For each candidate namespace, inspect all running workloads for explicit capability use in securityContext:
    If any container uses securityContext.capabilities.add or runs privileged / with allowPrivilegeEscalation: true, confirm with the app owner whether this is truly required.
  3. For containers that do not require capabilities, plan to standardize on dropping all capabilities, either at the pod spec or via a restrictive Pod Security configuration. Example pod-level setting to recommend to app owners:
  4. If your cluster still uses PodSecurityPolicy and it is enabled, create or select a PSP that requires dropping all capabilities and denies additional ones, and bind it only to namespaces whose workloads do not need capabilities. Example PSP manifest to adapt and apply:
    Then bind it to service accounts in the target namespace:
  5. If PSP is not available (or you are on newer Kubernetes), use Pod Security Admission / Pod Security Standards or an equivalent policy engine (e.g., OPA Gatekeeper, Kyverno) to enforce “drop all capabilities” on selected namespaces. For Pod Security Admission, set namespaces to a strict level and then verify the effect:
  6. Re‑audit periodically to ensure no capability use has crept back into “locked down” namespaces, and that your policy is correctly preventing admission:

Using kubectl

Run these from any machine with kubectl access.

1. List all pods and surface explicit capabilities

What indicates a problem:
  • Any container showing add: [...] with capabilities (for example CAP_SYS_ADMIN, CAP_NET_ADMIN, CAP_SYS_PTRACE) in namespaces that are not known to need them.
  • Containers with no drop list, or that don’t include ALL in drop, especially when add is present.

2. Inspect full securityContext for specific namespaces

Review “application” namespaces (replace with your namespaces):
In each pod, look under .spec.containers[].securityContext.capabilities and note:
  • add: entries: which capabilities are being granted.
  • drop: entries: whether ALL is dropped or only some caps.
Problem indicators:
  • Capabilities added without a clear, documented need.
  • Security context missing entirely for workloads that may rely on defaults you do not control.

3. Check for PodSecurityPolicy (or replacement) enforcing dropped capabilities

If PSP is still in use:
Look for:
  • spec.requiredDropCapabilities including ALL, or a broad set of drops.
  • spec.allowedCapabilities being empty or very restricted.
Problem indicators:
  • No PSPs present.
  • PSPs that allow broad capabilities (allowedCapabilities: ["*"] or many capabilities) and are bound to general-purpose namespaces.
If using Pod Security Admission (PSA) labels instead of PSP:
Problem indicators:
  • Application namespaces without restrictive pod security labels (for example, not set to restricted) while workloads in them are using elevated capabilities.

4. Map which PSPs (if any) apply to a namespace

If RBAC + PSP are used, list role bindings in a namespace:
Look for:
  • ClusterRole or Role that references a PSP.
  • Which service accounts in the namespace are bound to permissive PSPs.
Problem indicators:
  • Service accounts in a namespace bound (directly or indirectly) to highly permissive PSPs while workloads do not need extra capabilities.
Search for pods likely using custom security settings:
Then examine interesting pods in detail:
Problem indicators:
  • Annotations or settings that explicitly relax security controls while the application does not clearly require them.

6. Human review guidance

Use the above data to decide, per namespace:
  • Does any workload in this namespace truly require Linux capabilities (for example, low-level networking, mounting filesystems, time sync, etc.)?
  • If no, this namespace is a good candidate to:
    • Ensure workloads drop all capabilities, and
    • Attach policies (PSP or its replacement) that forbid adding capabilities / require dropping all.
There is no single kubectl command to decide this automatically; it requires understanding what each application does and whether the capabilities are strictly necessary.

Additional Reading: