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 the offending RoleBindings (run on any machine with kubectl access):
  2. For each violating namespaced RoleBinding you want to remove, delete it (on any machine with kubectl access), replacing <namespace> and <name> with values from step 1:
  3. For each violating ClusterRoleBinding you want to remove, delete it (on any machine with kubectl access), replacing <name> with the value from step 1:
  4. If you need to preserve access for specific authenticated identities, recreate appropriate bindings without system:anonymous or system:unauthenticated as subjects (on any machine with kubectl access). For example, bind a ClusterRole to a specific Azure AD group:
  5. Re-run the verification command to confirm there are no remaining bindings that reference system:anonymous or system:unauthenticated (on any machine with kubectl access):
    The output must include only:
On any machine with kubectl access:
  1. Identify violating RoleBindings and ClusterRoleBindings
Note each violating object’s kind, name, and, if present, ns= namespace.
  1. Delete each violating RoleBinding
For namespaced RoleBindings (lines with kind=RoleBinding ns=<namespace> name=<name>):
Example:
  1. Delete each violating ClusterRoleBinding
For cluster-wide bindings (lines with kind=ClusterRoleBinding name=<name> and no ns=):
Example:
  1. (Optional, declarative) Remove from GitOps/manifests
If these bindings are managed declaratively (e.g., Helm, Kustomize, or IaC), remove the offending RoleBinding / ClusterRoleBinding definitions from the source manifests and re-apply:
  1. Verify remediation
Re-run the audit command; it should return only is_compliant=true: