More Info:
The token sub-resource of service accounts can mint tokens that impersonate those accounts. Limit who can create service account tokens.Risk Level
MediumAddress
SecurityCompliance Standards
- CIS Kubernetes
Triage and Remediation
- Remediation
Remediation
Manual Steps
Manual Steps
-
Identify roles/clusterroles that can create service account tokens
- Run on: any machine with kubectl access
-
Review which subjects are bound to those roles/clusterroles
- For each ClusterRole name from step 1:
- For each Role (namespace, name) from step 1:
- Manually decide whether each subject (user/group/serviceaccount) truly needs to mint tokens.
-
Inspect the exact permissions granted on serviceaccounts/token
- For each role/clusterrole from step 1:
- Confirm whether
resources: ["serviceaccounts/token"]is necessary and whetherverbscan be reduced or removed.
-
Tighten or remove token-creation permissions
- If token creation is not needed, edit and remove the
serviceaccounts/tokenrule:
- In the editor, delete only the rule(s) that contain
resources: ["serviceaccounts/token"](or that list it among resources), or at least removecreatefromverbsif you must retain other verbs.
- If token creation is not needed, edit and remove the
-
Re-assess bindings; re-scope if needed
- Where token creation is required but too broadly granted, create a new, minimal Role/ClusterRole and bind it only to the specific service accounts/users that need it:
- Then remove broader bindings discovered in step 2 that no longer need this access.
-
Verify that access to serviceaccounts/token is minimized
- Re-run the discovery from step 1 and confirm only intentionally authorized roles remain:
- Optionally verify for a given subject whether it can still create a token:
Using kubectl
Using kubectl
rules entry that includes:- Any entry where
verbscontainscreatedirectly or via*. - Wide or sensitive scope, for example:
- ClusterRole used cluster‑wide by many subjects.
- Roles/ClusterRoles bound to:
system:serviceaccounts(all service accounts in a namespace or cluster).system:authenticatedorsystem:authenticated:oauth.- Broad user groups (e.g., corporate SSO groups) not specifically needing token minting.
- Bindings where subjects are:
Group=system:authenticated,system:serviceaccounts, or large identity provider groups.ServiceAccountthat do not clearly need to mint tokens (generic app SAs).Useraccounts that should not impersonate arbitrary service accounts.
- Roles/ClusterRoles from this list that:
- Are not strictly necessary for components that really need to mint service account tokens.
- Are bound to broad or sensitive subjects as described above.
serviceaccounts/token with verbs including create (or *), or only tightly scoped, explicitly justified roles, the risk from this control has been reduced.Automation
Automation
-
A potential problem is indicated whenever you see:
- A
ClusterRoleorRolelistingresources: ["serviceaccounts/token"](or including it in the list) andverbsincluding"create". - Corresponding
ClusterRoleBindingorRoleBindingsections that attach these roles to:subjectswithkind=UserorGrouprepresenting broad human populations (e.g.system:authenticated, large SSO groups), orsubjectswithkind=ServiceAccountthat do not strictly require minting tokens for other workloads.
- A
-
These cases should be manually reviewed; where possible, remove
createonserviceaccounts/tokenfrom those roles or refactor the access to narrower, justified subjects.

