Skip to main content

More Info:

ClusterRoleBindings or RoleBindings to the user system:anonymous grant permissions to unauthenticated callers. Such bindings should be removed or replaced with authenticated, least-privilege bindings.

Risk Level

Critical

Address

Security

Compliance Standards

  • CIS GKE

Triage and Remediation

Remediation

Manual Steps

  1. On any machine with kubectl access, list all bindings to system:anonymous and capture them for review:
  2. For each identified binding, inspect its full specification and permissions to understand what it allows and whether it is still needed. Replace the placeholder names with actual values from step 1:
  3. Decide on safer access patterns based on your organization’s auth model. For each binding that must continue to exist in some form, choose or create an authenticated subject with least-privilege access (for example, a user-defined group like my-anon-like-viewers) and ensure that group is actually used by your authentication system. Create such a group or user in your IdP or GKE IAM configuration as appropriate before proceeding.
  4. For each unsafe binding you will replace, create a new binding to the authenticated, least-privilege subject. Example (adjust names, namespace, and role according to your review):
  5. After confirming the new bindings work for intended users or groups, delete the unsafe bindings to system:anonymous. Replace names/namespaces with those found in step 1:
  6. Verification (on any machine with kubectl access): re-run the audit to confirm no bindings remain to system:anonymous:
On any machine with kubectl access:
  1. List all bindings to system:anonymous (for review)
  1. After deciding which bindings are unsafe and can be removed, delete them
Replace the placeholder names with the exact ones from step 1.
  1. (Optional) Replace with least-privilege, authenticated bindings
Example: bind a specific group my-authenticated-users to an appropriate Role/ClusterRole you have defined.ClusterRoleBinding example (cluster-wide):
Apply:
RoleBinding example (namespace-scoped):
Apply:
  1. Verification (same command as audit)