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
cluster-adminto any ServiceAccount (run on any machine with kubectl access): -
For each violating ServiceAccount, determine the minimal permissions it actually needs (run on any machine with kubectl access):
- Inspect its namespace and associated workloads:
- Review application requirements (deployment manifests, documentation, and logs for authorization errors).
- Inspect its namespace and associated workloads:
-
Create a narrowly scoped Role or ClusterRole that grants only the required verbs and resources (run on any machine with kubectl access, then apply to the cluster):
- Example namespaced Role (adjust namespace, resources, verbs):
- Example RoleBinding to attach it to the ServiceAccount:
- Example namespaced Role (adjust namespace, resources, verbs):
-
After confirming the workload functions correctly with the new, least-privilege Role/RoleBinding (monitor pod logs and behavior), identify the offending ClusterRoleBinding names (run on any machine with kubectl access):
-
Delete each ClusterRoleBinding that binds any ServiceAccount to
cluster-admin(run on any machine with kubectl access): -
Verify no ServiceAccount is bound to
cluster-admin(run on any machine with kubectl access):The output must be exactly:
Using kubectl
Using kubectl
On any machine with kubectl access:Bind the ServiceAccount to the new Role (replace NAMESPACE and SA_NAME appropriately):
- Identify violating ClusterRoleBindings and affected ServiceAccounts
- For each ClusterRoleBinding that binds a ServiceAccount to
cluster-admin, design and apply a narrowly-scoped replacement (example only; adjust rules to what the workload actually needs):
- Delete the insecure ClusterRoleBinding(s)
BINDING_NAME with each offending ClusterRoleBinding name:- Verification
Automation
Automation

