Skip to main content

More Info:

Membership of system:masters grants unrestricted access that bypasses RBAC and cannot be revoked by removing bindings. It should not be used.

Risk Level

Critical

Address

Security

Compliance Standards

  • CIS Kubernetes

Triage and Remediation

Remediation

Manual Steps

  1. List all ClusterRoleBindings that reference system:masters
    • Run on: any machine with kubectl access
    • Command:
    • Note the names of any ClusterRoleBinding objects where subjects[*].kind is Group and subjects[*].name is system:masters.
  2. Review each identified ClusterRoleBinding in detail
    • Run on: any machine with kubectl access
    • For each binding name found in step 1 (replace BINDING_NAME):
    • Record the metadata.name, subjects, and roleRef fields, and identify which external identities (e.g., OIDC groups, SSO mappings, user certs) end up in system:masters.
  3. Identify business need and safer alternatives for each subject
    • Outside Kubernetes, review your identity provider / certificate issuance to see why each subject is mapped to system:masters (e.g., “cluster-admins” IdP group mapped to system:masters).
    • Decide per subject whether they truly need unrestricted cluster-wide admin, or if a scoped ClusterRole / Role (e.g., cluster-admin via RBAC or a custom admin role) is sufficient.
  4. Plan and apply RBAC changes to replace system:masters use
    • If subjects should keep admin rights, bind them to an explicit ClusterRole (commonly cluster-admin) instead of using system:masters. Example (edit as needed):
      • Run on: any machine with kubectl access
    • Coordinate with your IdP / certificate configuration so that identities are no longer placed into the system:masters group going forward.
  5. Remove or edit bindings that reference system:masters
    • After confirming replacement access is in place and tested for affected users:
      • To remove an entire binding (if it only exists to grant system:masters):
      • Or to surgically remove system:masters from subjects, edit the binding:
        In the editor, delete any subjects entries where kind: Group and name: system:masters, then save.
  6. Verify that system:masters is no longer used
    • Run on: any machine with kubectl access
    • Commands:
    • Optionally, have a former system:masters member log in and confirm that their access is now mediated via RBAC bindings you created, not via system:masters.
What to look for:
Any ClusterRoleBinding name printed by this command has at least one subjects entry where:
  • kind is Group, and
  • name is system:masters
These bindings indicate the system:masters group is being used and need human review.
What to look for (problematic examples): Under each ClusterRoleBinding, look at the subjects: list. Entries like these are high-risk:
or
Any non-system or external user or group that is made a member of system:masters (in your IdP/OS) effectively gets full, non-revocable cluster admin access. Every such usage must be consciously justified or removed.
What this tells you:
Each line shows a ClusterRoleBinding that directly binds the system:masters group. Any such binding is a candidate for redesign. Decide, per binding, whether membership in system:masters is truly required or whether a narrower Role/ClusterRole should be used instead.

Success condition:
The final message should be No ClusterRoleBindings reference system:masters. If you see system:masters still in use, there are still bindings that must be reviewed and a decision made on whether to keep or change them.
How to interpret the output
  • Any line under:
    • === Checking ClusterRoleBindings that reference group system:masters ===
      • e.g. ClusterRoleBinding: cluster-admin-binding
    • === Checking RoleBindings (all namespaces) that reference group system:masters ===
      • e.g. Namespace: kube-system RoleBinding: ops-admins
    indicates a problem: those bindings are granting permissions to the system:masters group and should be reviewed and, where possible, replaced with least-privilege RBAC targeting specific users/groups or custom roles.
  • If both sections print nothing (no ClusterRoleBinding or RoleBinding listed), the cluster has no RBAC bindings directly referencing system:masters, which is the desired state for this control.