Skip to main content

More Info:

The ability to create pods can be abused to run arbitrary workloads and escalate privileges. Restrict create access on pod objects to trusted subjects only.

Risk Level

High

Address

Security

Compliance Standards

  • CIS EKS

Triage and Remediation

Remediation

Manual Steps

  1. List all Roles/ClusterRoles that can create pods
    • Run on: any machine with kubectl access
    Review each listed Role/ClusterRole to determine which subjects (users/groups/serviceaccounts) really need to create pods.
  2. Inspect a specific ClusterRole’s permissions
    • Run on: any machine with kubectl access
      Replace CLUSTERROLE_NAME with the actual name:
    Identify rules where resources includes pods and verbs includes create.
  3. Remove create on pods from a ClusterRole that should not have it
    • Run on: any machine with kubectl access
      Edit the ClusterRole:
    In each rules entry that has resources: ["pods", ...] (or includes pods), remove create from the verbs list (keep other verbs like get, list, watch if still required), then save and exit.
  4. Adjust namespace-scoped Roles similarly
    • Run on: any machine with kubectl access
      For each namespace where Roles were identified:
    In rules, remove create from verbs wherever resources includes pods. Save when done.
  5. Re-verify there are no unintended subjects that still require pod creation
    • Run on: any machine with kubectl access
      For any remaining Roles/ClusterRoles that must retain pods create access (e.g., system components or trusted CI/CD), document the justification and ensure their RoleBindings/ClusterRoleBindings are scoped only to the required subjects:
    Tighten bindings as needed (edit or delete) so only trusted subjects retain this access.
  6. Verification
    • Run on: any machine with kubectl access
    Confirm that any remaining pods create permissions correspond only to explicitly approved, trusted Roles/ClusterRoles.
On any machine with kubectl access:
  1. Identify Roles/ClusterRoles that can create pods
  1. For each offending Role/ClusterRole, fetch its manifest
  • Namespaced Role (replace NAMESPACE and ROLE_NAME):
  • ClusterRole (replace CLUSTERROLE_NAME):
  1. Edit the manifest(s) locally to remove create from any rule that grants it on pods.
Example before:
Example after (remove create):
If a rule is only for create on pods, delete that rule block entirely.
  1. Apply the updated manifest(s)
(Repeat for each edited file.)
  1. Re-run the verification