More Info:
Verifies no (Cluster)RoleBinding targets system:anonymous or system:unauthenticated. Such bindings grant access to unauthenticated callers.Risk Level
CriticalAddress
SecurityCompliance Standards
- Cloudanix Best Practice
Triage and Remediation
- Remediation
Remediation
Manual Steps
Manual Steps
-
On any machine with kubectl access, list all RoleBindings and ClusterRoleBindings that target
system:anonymousorsystem:unauthenticatedand review them to understand what they grant and whether they are truly needed: -
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):
- 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.
-
On any machine with kubectl access, delete each RoleBinding or ClusterRoleBinding whose subject is
system:anonymousorsystem:unauthenticated: -
If you need to preserve the permission but for an authenticated subject, recreate an equivalent binding that omits
system:anonymous/system:unauthenticatedand uses your chosen subject instead. For example: -
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:anonymousorsystem:unauthenticated:
Using kubectl
Using kubectl
On any machine with kubectl access to the cluster:If you manage these via manifests (GitOps/IaC), also remove the corresponding
- List offending RoleBindings and ClusterRoleBindings (review before deleting):
- For each violating RoleBinding, delete it. Example commands (replace with the actual names/namespaces you saw):
RoleBinding or ClusterRoleBinding objects (those whose subjects have name: system:anonymous or name: system:unauthenticated) from your declarative configuration and apply:- Verification (same command as the audit):
Automation
Automation

