Skip to main content

More Info:

The special group system:masters should not be used to grant permissions to any user or service account, except where strictly necessary (e.g. bootstrapping access prior to RBAC being fully available)

Risk Level

High

Address

Security

Compliance Standards

  • CIS Kubernetes

Triage and Remediation

Remediation

Manual Steps

  1. List all subjects currently bound to system:masters
    • On any machine with kubectl access:
    • Identify any ClusterRoleBinding where:
      • .roleRef.name is cluster-admin, and/or
      • Any subject has kind: User or kind: Group with name: system:masters.
  2. Inventory which concrete identities rely on system:masters
    • For each binding referencing system:masters (either as roleRef == cluster-admin or subject group name), capture full details:
    • Note which are:
      • Human users (e.g., corporate SSO groups, individual user names).
      • Service accounts (kind: ServiceAccount).
      • External identities mapped to system:masters via authentication (e.g., OIDC, client cert CN/O, cloud IAM).
  3. Review necessity of cluster‑wide superuser access for each subject
    • For each user/group/service account discovered:
      • Determine its actual operational purpose (admin, CI/CD, monitoring, break‑glass, etc.).
      • Confirm with owners whether:
        • Ongoing cluster-admin/system:masters level access is required, or
        • Access can be reduced to specific namespaces/verbs/resources, or
        • Access is only needed for rare break‑glass scenarios.
  4. Design replacement RBAC where full superuser is not strictly required
    • For subjects that do not need full system:masters/cluster-admin:
      • Identify the minimal ClusterRole/Role (existing or to be created) that matches required permissions.
      • Prepare corresponding RoleBinding/ClusterRoleBinding manifests that:
        • Bind the subject to that minimal role.
        • Do not reference the system:masters group and avoid unnecessary cluster-admin usage.
      • Save the manifests locally (e.g. restricted-access-<subject>.yaml) for change review/approval.
  5. Apply reduced‑privilege bindings, then remove system:masters membership
    • On any machine with kubectl access, for each subject you have redesigned access for:
      1. Apply the replacement binding(s):
      2. Remove the previous binding that relied on system:masters / cluster-admin (only after confirming new access works in a test):
      • For identities mapped to system:masters at the auth layer (e.g., client certs with O=system:masters, OIDC groups, cloud IAM bindings), coordinate with the identity/IAM team to:
        • Stop mapping those identities into system:masters.
        • Map them into the new, least‑privilege roles instead.
  6. Verify no users are effectively granted via system:masters
    • On any machine with kubectl access, confirm there are no bindings referencing system:masters or unintended cluster-admin grants:
    • Manually confirm that:
      • Any remaining cluster-admin binding is strictly necessary (e.g., a controlled break‑glass account).
      • No regular user, group, or service account is granted access via system:masters.
Problem indication:
  • Any ClusterRoleBinding that:
    • Has roleRef.name: cluster-admin and a subject with name: system:masters, or
    • Has any subject with kind: Group and name: system:masters, means membership in system:masters gives full admin access.

In the output, look for:
  • subjects entries like:
    • kind: Group with name: system:masters
    • Any identity provider group (e.g. from OIDC) that you know is mapped to system:masters
  • roleRef with name: cluster-admin or any highly privileged role.
If system:masters is present in subjects, or if you know an external group is mapped to system:masters, that binding is high risk and needs human review.
Problem indication:
  • Any RoleBinding where a subject has kind: Group and name: system:masters is using this special group to grant namespace-scoped access and should be reviewed. Even if the Role is not cluster-admin, those subjects also inherit any cluster-wide privileges of system:masters.

Problem indication:
  • Any user identity that you know (from your IdP, certificates, or API server auth config) is mapped into the system:masters group is a candidate for review. kubectl cannot see that mapping; you must correlate with your authentication setup.

If this command prints no names, then no ClusterRoleBindings directly grant access to the system:masters group. If it still returns any names, those bindings still need human review and a decision on whether to keep or change them.
Interpreting the output
  • A definite problem for this specific control is any line in sections 1 or 2 where:
    • KIND=Group and NAME=system:masters
  • These bindings should be reviewed and, if not strictly required, updated to remove the system:masters group subject.

Additional Reading: