Impact & Risk Analysis
- Severity: High
- CIS Benchmark: CIS 5.1.3
- Impact: Excessive Privileges & Lateral Movement. Using the wildcard character (
*) in Roles or ClusterRoles grants access to all resources or all actions. This is dangerous because it automatically grants access to any new resources (like Custom Resource Definitions) added to the cluster in the future. It significantly increases the blast radius if a credential using this role is compromised.
Common Misconfiguration
Using* for resources or verbs to save time or avoid “permission denied” errors. Administrators often create a “super-admin” role for service accounts that only need to read specific logs or metrics.
Vulnerable Example
Secure Example
Audit Procedure
Retrieve the Roles and ClusterRoles defined in the cluster and review them for wildcard usage:- Result: Look for instances of
resources: ["*"]orverbs: ["*"]orapiGroups: ["*"]. - Fail: If wildcards are present in roles that should be restricted. (Note: The default
cluster-adminrole uses wildcards, which is expected, but custom roles should generally avoid them).
Remediation
Where possible, replace any use of wildcards inClusterRoles and Roles with specific objects or actions.
- Identify the specific API groups required (e.g.,
apps,batch). - Identify the specific resources required (e.g.,
deployments,cronjobs). - Identify the specific verbs required (e.g.,
create,deleteonly if necessary).
*.
