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 containers (run on any machine with kubectl access):
  2. For a noncompliant Pod created directly (not via Deployment/ReplicaSet/etc.), edit the Pod spec (any machine with kubectl access):
    In /tmp/pod-fixed.yaml, under each .spec.containers[].securityContext and .spec.initContainers[].securityContext:
    Then apply and recreate (Pods cannot be updated in place for some fields, so delete and recreate if needed):
  3. For Pods managed by a higher-level controller (e.g., Deployment, StatefulSet, DaemonSet), find the owning resource (any machine with kubectl access):
    Then fetch the controller manifest:
  4. Edit the controller manifest to drop all capabilities (any machine with kubectl access). In /tmp/owner-fixed.yaml, under each container and initContainer template path like:
    • Deployments: .spec.template.spec.containers[] and .spec.template.spec.initContainers[]
    • StatefulSets/DaemonSets/ReplicaSets: same template path
    Add or modify:
    Save the file.
  5. Apply the updated controller spec and wait for Pods to be recreated (any machine with kubectl access):
  6. Verify compliance (any machine with kubectl access):