More Info:
Do not generally permit containers with capabilitiesRisk Level
LowAddress
SecurityCompliance 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
Remediation
Manual Steps
Manual Steps
-
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:
-
For each candidate namespace, inspect all running workloads for explicit capability use in
securityContext:If any container usessecurityContext.capabilities.addor runs privileged / withallowPrivilegeEscalation: true, confirm with the app owner whether this is truly required. -
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:
-
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:
-
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:
-
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
Using kubectl
Using kubectl
Run these from any machine withkubectl access.1. List all pods and surface explicit capabilities
- Any container showing
add: [...]with capabilities (for exampleCAP_SYS_ADMIN,CAP_NET_ADMIN,CAP_SYS_PTRACE) in namespaces that are not known to need them. - Containers with no
droplist, or that don’t includeALLindrop, especially whenaddis present.
2. Inspect full securityContext for specific namespaces
Review “application” namespaces (replace with your namespaces):.spec.containers[].securityContext.capabilities and note:add:entries: which capabilities are being granted.drop:entries: whetherALLis dropped or only some caps.
- 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:spec.requiredDropCapabilitiesincludingALL, or a broad set of drops.spec.allowedCapabilitiesbeing empty or very restricted.
- No PSPs present.
- PSPs that allow broad capabilities (
allowedCapabilities: ["*"]or many capabilities) and are bound to general-purpose namespaces.
- 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:ClusterRoleorRolethat references a PSP.- Which service accounts in the namespace are bound to permissive PSPs.
- Service accounts in a namespace bound (directly or indirectly) to highly permissive PSPs while workloads do not need extra capabilities.
5. Spot risky capabilities via label/annotation search
Search for pods likely using custom security settings:- 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.
Automation
Automation

