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. Identify offending RoleBindings
    • Run on any machine with kubectl access:
  2. Review each violating binding and its purpose
    • For a namespaced RoleBinding (replace NAMESPACE and NAME):
    • For a ClusterRoleBinding (cluster-scoped):
    • Determine if the access is actually needed. If it is not required, plan to delete the binding. If access is required, design an alternative using authenticated identities (e.g., specific Kubernetes ServiceAccounts, IAM-authenticated users/groups via aws-auth).
  3. Safely back up the offending RoleBindings before deletion
    • Namespaced RoleBinding:
    • ClusterRoleBinding:
  4. Delete RoleBindings that reference system:anonymous or system:unauthenticated
    • Namespaced RoleBinding:
    • ClusterRoleBinding:
  5. (Optional but recommended) Recreate least-privilege bindings for authenticated subjects
    • Example for a ServiceAccount in namespace NAMESPACE (replace placeholders):
    • Or for an AWS IAM-mapped group (from aws-auth ConfigMap), use that group name as the subject instead of unauthenticated groups in a ClusterRoleBinding manifest you apply with:
  6. Verify the cluster is compliant
    • Run on any machine with kubectl access:
    • Confirm the output is exactly:
On any machine with kubectl access to the cluster:
  1. Identify the offending RoleBindings and ClusterRoleBindings
  1. For each noncompliant RoleBinding, delete it (namespaced)
Example (replace <namespace> and <name> with values from step 1):
  1. For each noncompliant ClusterRoleBinding, delete it (cluster-scoped)
Example (replace <name> with value from step 1):
  1. If you manage these bindings via manifests (GitOps/IaC), remove the corresponding RoleBinding / ClusterRoleBinding objects or edit their subjects to no longer include system:anonymous or the system:unauthenticated group, then apply:
  1. Verification (cluster should now report compliant)