Skip to main content

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

High

Address

Security

Compliance Standards

  • Cloudanix Best Practice

Triage and Remediation

Remediation

Manual Steps

  1. Identify noncompliant pods and their owning workloads (run on any machine with kubectl access):
  2. For each listed pod, edit the owning workload manifest (Deployment, StatefulSet, DaemonSet, Job, CronJob, or the Pod itself) to drop all capabilities (run on any machine with kubectl access). Example for a Deployment:
    Under each spec.template.spec.containers[] (and initContainers[] if present), add or modify:
  3. If the pod is not controlled by a higher-level workload (no ownerReferences), edit the Pod spec directly and reapply it as a new manifest (pods cannot be updated in place for some fields). Export the pod spec, clean it, and save as a manifest (run on any machine with kubectl access):
    Edit /tmp/<pod-name>.yaml:
    • Remove status: section.
    • Remove fields under metadata: such as uid, resourceVersion, managedFields, creationTimestamp, and ownerReferences.
    • Under each container and initContainer, ensure:
  4. Apply the updated standalone Pod manifest (run on any machine with kubectl access):
  5. Confirm updated workloads have rolled out successfully (run on any machine with kubectl access), for example for a Deployment:
  6. Verify compliance across the cluster (run on any machine with kubectl access):
    Ensure that the output is either a single line is_compliant=true or that every listed container has is_compliant=true.
On any machine with kubectl access:
  1. Identify the non‑compliant Pod and its controller
    If the Pod is owned by a controller (Deployment, StatefulSet, DaemonSet, Job, CronJob, etc.), you must edit the controller, not the Pod, or the change will be overwritten.
  2. Edit the Pod spec (ephemeral / stand‑alone Pod only)
    For a Pod not managed by a controller:
    Under each container (and initContainer if present), add:
  3. Edit the owning controller (preferred, declarative) Deployment example:
    Add the same block under every container and initContainer:
    For other controllers, replace deployment with statefulset, daemonset, job, or cronjob and edit .spec.template.spec similarly. If you manage manifests declaratively, update your YAML files with the same securityContext.capabilities.drop: ["ALL"] blocks and apply:
  4. Verification Re‑run the benchmark audit command from any machine with kubectl access:
    Confirm that all listed containers now show capabilitiesDrop=ALL and is_compliant=true (or that the output is just is_compliant=true).