More Info:
Wildcards in RBAC rules grant access to all resources or verbs, effectively broad privilege. Replace them with explicit resources and actions.Risk Level
CriticalAddress
SecurityCompliance Standards
- CIS Kubernetes
Triage and Remediation
- Remediation
Remediation
Manual Steps
Manual Steps
-
Identify ClusterRoles using wildcards (any machine with kubectl access)
-
For each non-system ClusterRole using wildcards, export its definition for review (any machine with kubectl access)
-
Manually analyze required permissions and replace wildcards (manual review)
- Consult application/team owners to determine the minimum set of:
apiGroupsactually needed (e.g."",apps,batch,rbac.authorization.k8s.io)resourcesactually used (e.g.pods,deployments,secrets,configmaps,cronjobs)verbsactually required (e.g.get,list,watch,create,update,patch,delete)
- In each exported YAML under
.rules:- Replace
apiGroups: ["*"]with an explicit list of required API groups. - Replace
resources: ["*"]with an explicit list of required resources. - Replace
verbs: ["*"]with an explicit list of required verbs.
- Replace
- Do not modify Kubernetes-critical or provider-managed ClusterRoles (e.g. those starting with
system:,eks:,gke-,azure-, etc.) unless you fully understand the impact.
- Consult application/team owners to determine the minimum set of:
-
Apply the edited ClusterRole definitions back to the cluster (any machine with kubectl access)
-
If necessary, split very broad ClusterRoles into multiple least-privilege roles (any machine with kubectl access)
- When different consumers need different subsets of permissions, create separate ClusterRoles:
- Update existing ClusterRoleBindings or RoleBindings to point to the new, narrower ClusterRoles:
- When different consumers need different subsets of permissions, create separate ClusterRoles:
-
Verify no ClusterRoles still use wildcards (any machine with kubectl access)
Using kubectl
Using kubectl
On any machine with kubectl access:to something like (adjust to the minimal required permissions):Ensure no Repeat steps 2–4 for each affected ClusterRole.
- Identify noncompliant ClusterRoles (those with
"*"in rules):
- For each noncompliant ClusterRole, export the manifest for editing:
- Edit
/tmp/clusterrole-<CLUSTERROLE_NAME>.yamland replace wildcard entries with explicit resources/verbs. For example, change:
["*"] remains in apiGroups, resources, verbs, resourceNames, or nonResourceURLs.- Apply the updated ClusterRole:
- Verification (rerun check for ClusterRoles):
Automation
Automation

