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. List all RoleBindings and ClusterRoleBindings that reference system:anonymous or system:unauthenticated (run on any machine with kubectl access):
  2. For each violating binding you plan to remove, inspect it to understand what access it grants and whether an authenticated subject (e.g., specific user/group/service account) should replace it (run on any machine with kubectl access). Example for a namespaced RoleBinding:
    Example for a ClusterRoleBinding:
  3. If you decide the binding is not required, delete the offending RoleBinding or ClusterRoleBinding (run on any machine with kubectl access). Example for a namespaced RoleBinding:
    Example for a ClusterRoleBinding:
  4. If equivalent access is still needed, create or update a binding that grants the same Role/ClusterRole only to authenticated subjects (run on any machine with kubectl access). For example, to bind a ClusterRole to a specific group instead of system:unauthenticated:
  5. Repeat steps 2–4 until all RoleBindings and ClusterRoleBindings that reference system:anonymous or system:unauthenticated have been deleted or appropriately replaced.
  6. Verify compliance (run on any machine with kubectl access):
    The output should be:
On any machine with kubectl access:
  1. Identify violating RoleBindings / ClusterRoleBindings
  1. For each violating RoleBinding, delete it
  • Namespaced RoleBinding (replace <namespace> and <name>):
Example:
  1. For each violating ClusterRoleBinding, delete it
  • Cluster-wide ClusterRoleBinding (replace <name>):
Example:
  1. Re-apply any required access using authenticated subjects only (optional, declarative)
Create a manifest file (for example, rb-authenticated-only.yaml) with safe subjects, then apply:
Apply it:
  1. Verification (must return is_compliant=true)