Skip to main content

More Info:

The ability to create pods in a namespace can provide a number of opportunities for privilege escalation, such as assigning privileged service accounts to these pods or mounting hostPaths with access to sensitive data (unless Pod Security Policies are implemented to restrict this access)

Risk Level

Low

Address

Security

Compliance 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)
  • 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

Manual Steps

  1. List all roles/clusterroles that grant create on pods (run on any machine with kubectl access):
  2. For each Role that should not allow pod creation, edit it to remove create from any rule that includes pods (run on any machine with kubectl):
    In the editor, find any rule like:
    Change to:
    or remove the entire rule if pods access is not needed, then save and exit.
  3. For each ClusterRole that should not allow pod creation, edit it similarly (run on any machine with kubectl):
    In the editor, remove create from any verbs list that applies to pods, or remove the pods rule entirely, then save and exit.
  4. For any Role/ClusterRole that must still allow some users to create pods, consider creating a separate, narrowly-scoped role for them and binding it only to the required subjects (run on any machine with kubectl):
  5. Review RoleBindings and ClusterRoleBindings to ensure only intended subjects are linked to any remaining roles/clusterroles that have pods create (run on any machine with kubectl):
    Adjust bindings as needed:
  6. Verification (run on any machine with kubectl access):
On any machine with kubectl access:
  1. List all Roles/ClusterRoles that can create pods
  1. For each Role in a namespace where pod creation should be removed, edit it to drop create on pods:
Example: remove create for pods from a specific Role
Edit /tmp/role-<ROLE_NAME>.yaml:
  • In every .rules[] where resources includes pods, remove create from the verbs list.
  • If verbs becomes empty, remove that rule entry entirely.
Apply the updated Role:
  1. For each ClusterRole where pod creation should be removed, do the same:
Edit /tmp/clusterrole-<CLUSTERROLE_NAME>.yaml:
  • In every .rules[] where resources includes pods, remove create from verbs, or delete the rule if it only provided create on pods.
Apply the updated ClusterRole:
  1. (Optional) If a role exists only to permit pod creation and is no longer needed, delete it:
  1. Verify that no Roles/ClusterRoles retain create on pods: