Skip to main content

More Info:

Verifies no (Cluster)RoleBinding targets system:anonymous or system:unauthenticated. Such bindings grant access to unauthenticated callers.

Risk Level

Critical

Address

Security

Compliance Standards

  • Cloudanix Best Practice

Triage and Remediation

Remediation

Manual Steps

  1. On any machine with kubectl access, list all RoleBindings and ClusterRoleBindings that target system:anonymous or system:unauthenticated and review them to understand what they grant and whether they are truly needed:
  2. For each listed binding, fetch the full YAML and record it (for rollback or to recreate with a safer subject such as a specific Group, User, or ServiceAccount):
  3. Decide whether each binding can simply be deleted (preferred), or whether you must instead rebind the same Role/ClusterRole to an authenticated subject (e.g., a specific service account or group). Document the chosen replacement subject for each binding that must be preserved.
  4. On any machine with kubectl access, delete each RoleBinding or ClusterRoleBinding whose subject is system:anonymous or system:unauthenticated:
  5. If you need to preserve the permission but for an authenticated subject, recreate an equivalent binding that omits system:anonymous / system:unauthenticated and uses your chosen subject instead. For example:
  6. Verification (on any machine with kubectl access): rerun the audit command and confirm that it returns only the compliance sentinel and no bindings with system:anonymous or system:unauthenticated:
On any machine with kubectl access to the cluster:
  1. List offending RoleBindings and ClusterRoleBindings (review before deleting):
  1. For each violating RoleBinding, delete it. Example commands (replace with the actual names/namespaces you saw):
If you manage these via manifests (GitOps/IaC), also remove the corresponding RoleBinding or ClusterRoleBinding objects (those whose subjects have name: system:anonymous or name: system:unauthenticated) from your declarative configuration and apply:
  1. Verification (same command as the audit):