More Info:
Do not generally permit containers with capabilities assigned beyond the default set.Risk Level
MediumAddress
SecurityCompliance Standards
- CIS Kubernetes
Triage and Remediation
- Remediation
Remediation
Manual Steps
Manual Steps
-
List pods and identify containers with added capabilities
Run on: any machine with kubectl accessReview each listed pod/container and confirm whether the added capabilities are truly required for the workload. -
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.
-
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 removeadded capabilities fromsecurityContext.capabilities:In the editor, for each container, either:- Remove the entire
capabilities:block if onlyaddwas 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.
- Remove the entire
-
Adjust or create admission policies to minimize allowedCapabilities
Run on: any machine with kubectl access
If you use policy objects that supportallowedCapabilities(e.g., PodSecurityPolicy, Gatekeeper/Kyverno policies), edit them soallowedCapabilitiesis either absent or an empty array:In the YAML:or remove theallowedCapabilitiesfield entirely.
For Gatekeeper/Kyverno, update the constraint/policy definitions similarly so they do not allow added capabilities except in explicitly justified cases. -
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.
-
Verify no containers are running with added capabilities
Run on: any machine with kubectl accessConfirm that no lines withis_compliant: falseremain, except for any explicitly approved, documented exceptions.
Using kubectl
Using kubectl
On any machine with Then use the supplied audit snippet (or a trimmed version) to list only non‑compliant containers:Use this output as your review list.or simply omit the Repeat for each workload where you have determined that added capabilities are not strictly required.Apply:Gatekeeper / Kyverno or similar admission policiesReview constraint or policy manifests and either remove The cluster is aligned with the control when any remaining
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
2. Review and decide per workload
For each non‑compliantpod / namespace / container:-
Identify the owning resource:
Then inspect the owner (e.g., Deployment, DaemonSet, Job):
-
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?
3. Remove or minimize added capabilities in manifests
Edit the owning object manifests (Deployment, StatefulSet, DaemonSet, Job, CronJob, etc.) to removesecurityContext.capabilities.add where possible.Example patterns:- Current (non‑compliant)
- Preferred (no added capabilities)
securityContext.capabilities stanza entirely from the container spec.Apply the change declaratively from any machine with kubectl access:4. (Optional) Review PodSecurityPolicy / PodSecurity / admission policies
Where you still use policy objects that can specifyallowedCapabilities, 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:
allowedCapabilities or set them to [], then:5. Verification
After updating manifests and/or policies, re‑run the audit from any machine withkubectl access:NON-COMPLIANT entries are understood, documented as exceptions, and justified as operationally required.Automation
Automation

