More Info:
Do not generally permit containers with capabilitiesRisk Level
LowAddress
SecurityCompliance Standards
- CIS Kubernetes
Triage and Remediation
- Remediation
Remediation
Manual Steps
Manual Steps
-
Identify namespaces where dropping all capabilities is acceptable
- On any machine with kubectl access:
- With your app/service owners, list namespaces whose workloads are non-privileged, non-infrastructure and can reasonably run without extra Linux capabilities (for example, pure HTTP APIs, batch jobs, or frontends).
- On any machine with kubectl access:
-
Inventory current capability usage in those namespaces
- For each candidate namespace (replace
TARGET_NS): - Also capture full security contexts for deeper review:
- Review for any
capAddentries and for containers that do not specifydrop: ["ALL"].
- For each candidate namespace (replace
-
Decide which workloads actually need capabilities
- For each container with
capAdd(or nodrop: ["ALL"]), validate with the application owner and documentation whether these capabilities are functionally required. - Mark containers that:
- Do not need any capabilities → should drop all.
- Need only specific capabilities → should drop all by default and add back only the minimal required ones.
- Where uncertain, plan controlled tests with reduced capabilities in a non‑production environment.
- For each container with
-
Enforce “drop all capabilities” at the namespace level via policy
- If you already use a policy engine (Pod Security Standards / Pod Security Admission, Kyverno, OPA Gatekeeper, or a PSP-like replacement), define or adjust a policy for each selected namespace to require
drop: ["ALL"]and optionally forbidcapAddexcept for explicitly allowed cases. For example, using Kyverno (on any machine with kubectl access): - Adjust the example to your policy engine and list of target namespaces; review carefully before enforcing in production.
- If you already use a policy engine (Pod Security Standards / Pod Security Admission, Kyverno, OPA Gatekeeper, or a PSP-like replacement), define or adjust a policy for each selected namespace to require
-
Update existing workloads that violate the policy
- For each deployment/statefulset/daemonset in the target namespaces, edit the manifest to drop all capabilities (example for a deployment):
Edit
APP_NAME-deploy.yamlto include, under each container:Then apply: - For pods created by other controllers (CronJobs, Jobs, Operators), update the relevant higher-level resource templates similarly.
- For each deployment/statefulset/daemonset in the target namespaces, edit the manifest to drop all capabilities (example for a deployment):
-
Verify effective enforcement and absence of unintended capabilities
- Attempt to create a pod without dropping all capabilities in the protected namespace; confirm admission is rejected according to your policy engine.
- Confirm running pods comply:
- Periodically re-run this review when new workloads are added or when application requirements change.
Using kubectl
Using kubectl
- Any non-empty
add:line (for example[NET_ADMIN CAP_SYS_ADMIN]) means the container is requesting extra capabilities. - Missing or empty
drop:where you expect all capabilities to be dropped may be a concern if the app does not need capabilities.
securityContext.capabilities.addpresent with any capability values.- No
securityContext.capabilities.dropand no higher-level policy (see below) in a namespace that should be locked down.
allowedCapabilitiescontains capabilities beyond what is needed, especially*.requiredDropCapabilitiesis empty or does not includeALLfor namespaces that should drop all capabilities.
pod-security.kubernetes.io/enforce=privileged|baseline|restricted.Problem indication:- Namespaces that should run unprivileged workloads but are labeled with
privilegedor have no Pod Security labels and permit capabilities via other policies.
- No policy that restricts
securityContext.capabilitiesfor namespaces that do not need capabilities. - Policies explicitly allowing broad or unrestricted capabilities.
securityContext.capabilities.addwith capabilities likeNET_ADMIN,SYS_ADMIN,NET_RAW, or many entries.- Containers running as root plus added capabilities without a clear business need.
Automation
Automation
-
In the “Pods with capabilities configured” section:
- Any
add:list that is not[]means the container is explicitly adding Linux capabilities. - Any
drop:list that is[]or does not containALLmeans the container is not dropping all capabilities.
- Any
-
In the “Namespaces with pods that do NOT drop all capabilities” section:
- Any namespace listed here contains pods where at least one container does not drop
ALLcapabilities; these namespaces should be reviewed, and where workloads do not require capabilities, admission policies should be considered to forbid such pods.
- Any namespace listed here contains pods where at least one container does not drop

