More Info:
Verifies no ServiceAccount is bound to the cluster-admin ClusterRole. Such a binding hands full cluster control to any workload using that account.Risk Level
CriticalAddress
SecurityCompliance Standards
- Cloudanix Best Practice
Triage and Remediation
- Remediation
Remediation
Manual Steps
Manual Steps
-
List all ClusterRoleBindings that bind ServiceAccounts to
cluster-admin(run on any machine withkubectlaccess): -
For each violating ServiceAccount, review what it actually needs to do (on any machine with
kubectlaccess):- Inspect workloads using the ServiceAccount:
- Replace
SERVICEACCOUNT_NAMEwith the name from step 1, and note the namespaces and pods.
- Inspect workloads using the ServiceAccount:
-
Design and create a minimally-privileged Role/ClusterRole that grants only the necessary permissions (on any machine with
kubectlaccess). Example template (edit apiGroups, resources, verbs, and scope before applying):If access is only needed within one namespace, changekind: ClusterRoletokind: Roleand addmetadata.namespace: TARGET_NAMESPACE. -
Bind the ServiceAccount to the new limited Role/ClusterRole (on any machine with
kubectlaccess). Adjust names and namespace as needed:For namespace-scoped permissions instead, use: -
Remove the insecure
cluster-adminbinding once you have confirmed workloads still function as expected (on any machine withkubectlaccess). For each violating ClusterRoleBinding name from step 1: -
Verify no ServiceAccount is bound to
cluster-adminanymore (on any machine withkubectlaccess):Compliance is achieved when the output is exactly:
Using kubectl
Using kubectl
On any machine with kubectl access:Cluster-scoped permissions (only if truly required):Apply your minimal RBAC:Repeat for every offending binding reported by the audit.
- Identify ServiceAccounts bound to
cluster-admin:
- For each violating ClusterRoleBinding, inspect it to understand what it’s used for:
- (Optional but recommended) Create a narrowly-scoped Role/ClusterRole and binding for the workload, based on its actual needs. Example pattern (replace placeholders with real values):
- Delete the ClusterRoleBinding that grants
cluster-adminto a ServiceAccount:
- Verification (cluster is compliant when only
is_compliant=trueis printed):
Automation
Automation

