More Info:
Verifies every container drops ALL capabilities and adds back only what it needs. Excess capabilities expand the attack surface of a compromised container.Risk Level
HighAddress
SecurityCompliance Standards
- Cloudanix Best Practice
Triage and Remediation
- Remediation
Remediation
Manual Steps
Manual Steps
-
Identify noncompliant pods (run on any machine with kubectl access):
-
For a workload you control (example: Deployment in namespace “prod”), retrieve its manifest (run on any machine with kubectl access):
-
Edit the manifest to drop all capabilities and add back only what is needed (run on any machine with kubectl access):
- Open the file:
- Under each
containers[]andinitContainers[]item, add or update: - Remove any unneeded capabilities from
add:; keep only strictly required ones.
- Open the file:
-
Apply the updated manifest (run on any machine with kubectl access):
-
Repeat steps 2–4 for each noncompliant controller or standalone Pod you manage (e.g.,
deployment,statefulset,daemonset,job,cronjob, orpod). -
Verify all non-excluded namespaces are compliant (run on any machine with kubectl access):
Confirm remaining lines (if any) all show
is_compliant=true.
Using kubectl
Using kubectl
On any machine with kubectl access:This lists: Under every Maintain any existing Add the same block to each container and initContainer:Note: direct Pod edits are not persisted if something external (e.g., Helm, GitOps) recreates them; prefer fixing source manifests/IaC where applicable.Apply with:Confirm output is
- Identify non‑compliant pods and their owning controllers
NAMESPACE POD OWNER_KIND OWNER_NAME. For entries where OWNER_KIND is empty, you must edit the Pod directly; otherwise edit the owning object (Deployment, StatefulSet, DaemonSet, Job, CronJob, etc.).- Edit the owning controller manifest(s)
prod named web):spec.template.spec.containers[] and spec.template.spec.initContainers[] entry, add:securityContext fields; just merge the capabilities stanza. Save and exit to apply.- Edit standalone Pods (no controller)
default named test-pod with no owner:- Declarative example for future manifests
- Verification
is_compliant=true only, or that each listed container shows is_compliant=true.Automation
Automation

