Skip to main content

More Info:

Do not generally permit containers with capabilities assigned beyond the default set.

Risk Level

Medium

Address

Security

Compliance Standards

  • CIS Kubernetes

Triage and Remediation

Remediation

Manual Steps

  1. List pods and identify containers with added capabilities
    Run on: any machine with kubectl access
    Review each listed pod/container and confirm whether the added capabilities are truly required for the workload.
  2. Review and decide on policy and workload changes
    Run on: any machine with kubectl access
    • Determine if the capability can be removed entirely from the workload spec.
    • If a capability is required, document the business/technical justification and ensure it is explicitly approved.
    • Decide if enforcement should be done via Pod Security Admission, PodSecurityPolicy (legacy), or another admission controller (e.g., OPA/Gatekeeper, Kyverno) to prevent future use of added capabilities.
  3. Edit workloads to remove added capabilities
    Run on: any machine with kubectl access
    For each non-exempt pod, edit its controller (Deployment/DaemonSet/StatefulSet/Job, etc.) and remove added capabilities from securityContext.capabilities:
    In the editor, for each container, either:
    • Remove the entire capabilities: block if only add was used, or
    • Remove the add: field, leaving other fields (e.g., drop:) intact.
      Save and exit to trigger a rollout and recreate pods without added capabilities.
  4. Adjust or create admission policies to minimize allowedCapabilities
    Run on: any machine with kubectl access
    If you use policy objects that support allowedCapabilities (e.g., PodSecurityPolicy, Gatekeeper/Kyverno policies), edit them so allowedCapabilities is either absent or an empty array:
    In the YAML:
    or remove the allowedCapabilities field entirely.
    For Gatekeeper/Kyverno, update the constraint/policy definitions similarly so they do not allow added capabilities except in explicitly justified cases.
  5. Handle exceptions via dedicated namespaces or policies (if needed)
    Run on: any machine with kubectl access
    • For workloads that must retain specific capabilities, place them in dedicated namespaces and apply narrowly-scoped policies only there.
    • Ensure that cluster-wide or default policies do not include non-empty allowedCapabilities; instead, use per-namespace/per-workload exceptions with clear labels and documentation.
  6. Verify no containers are running with added capabilities
    Run on: any machine with kubectl access
    Confirm that no lines with is_compliant: false remain, except for any explicitly approved, documented exceptions.
On any machine with kubectl access.This control is marked MANUAL: there is no single automatic fix, because legitimate workloads may require added Linux capabilities. Use these steps to review and, where appropriate, remove or tightly scope added capabilities.

1. Discover pods with added capabilities

Then use the supplied audit snippet (or a trimmed version) to list only non‑compliant containers:
Use this output as your review list.

2. Review and decide per workload

For each non‑compliant pod / namespace / container:
  1. Identify the owning resource:
    Then inspect the owner (e.g., Deployment, DaemonSet, Job):
  2. With the application owner, decide:
    • Are the added capabilities truly required?
    • Can they be removed entirely?
    • If not, can the set be reduced to the minimal necessary capabilities?
Document the decision for each workload as part of your risk acceptance or exception process.

3. Remove or minimize added capabilities in manifests

Edit the owning object manifests (Deployment, StatefulSet, DaemonSet, Job, CronJob, etc.) to remove securityContext.capabilities.add where possible.Example patterns:
  • Current (non‑compliant)
  • Preferred (no added capabilities)
or simply omit the securityContext.capabilities stanza entirely from the container spec.Apply the change declaratively from any machine with kubectl access:
Repeat for each workload where you have determined that added capabilities are not strictly required.

4. (Optional) Review PodSecurityPolicy / PodSecurity / admission policies

Where you still use policy objects that can specify allowedCapabilities, ensure they do not globally allow extra capabilities beyond the default set, unless set to an empty array as per the remediation.Examples:PodSecurityPolicy (legacy clusters)
  • Non‑compliant:
  • Compliant:
Apply:
Gatekeeper / Kyverno or similar admission policiesReview constraint or policy manifests and either remove allowedCapabilities or set them to [], then:

5. Verification

After updating manifests and/or policies, re‑run the audit from any machine with kubectl access:
The cluster is aligned with the control when any remaining NON-COMPLIANT entries are understood, documented as exceptions, and justified as operationally required.

Additional Reading: