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
-
Identify offending RoleBindings
- Run on any machine with kubectl access:
- Run on any machine with kubectl access:
-
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).
- For a namespaced RoleBinding (replace NAMESPACE and NAME):
-
Safely back up the offending RoleBindings before deletion
- Namespaced RoleBinding:
- ClusterRoleBinding:
- Namespaced RoleBinding:
-
Delete RoleBindings that reference
system:anonymousorsystem:unauthenticated- Namespaced RoleBinding:
- ClusterRoleBinding:
- Namespaced RoleBinding:
-
(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:
- Example for a ServiceAccount in namespace NAMESPACE (replace placeholders):
-
Verify the cluster is compliant
- Run on any machine with kubectl access:
- Confirm the output is exactly:
- Run on any machine with kubectl access:
Using kubectl
Using kubectl
On any machine with kubectl access to the cluster:
- Identify the offending RoleBindings and ClusterRoleBindings
- For each noncompliant RoleBinding, delete it (namespaced)
<namespace> and <name> with values from step 1):- For each noncompliant ClusterRoleBinding, delete it (cluster-scoped)
<name> with value from step 1):- If you manage these bindings via manifests (GitOps/IaC), remove the corresponding
RoleBinding/ClusterRoleBindingobjects or edit theirsubjectsto no longer includesystem:anonymousor thesystem:unauthenticatedgroup, then apply:
- Verification (cluster should now report compliant)
Automation
Automation

