More Info:
Roles that grant get, list or watch on Secret objects expose sensitive credentials. Access to Secrets should be minimized across the cluster.Risk Level
HighAddress
SecurityCompliance Standards
- CIS GKE
Triage and Remediation
- Remediation
Remediation
Manual Steps
Manual Steps
-
Identify all Roles with sensitive Secret access
- Run on: any machine with kubectl access
- Review each Role to understand which subjects (RoleBindings) depend on it and what applications/functions they support:
-
Decide which Roles truly need Secret access
- For each Role found, determine:
- Does the workload actually need to read Secret contents (e.g., a controller that manages Secrets)?
- Or is Secret reference in Pod specs (which does not require RBAC get/list/watch) sufficient?
- Mark Roles as:
- “Keep read to secrets” (strictly required), or
- “Can be removed or narrowed” (preferred).
- For each Role found, determine:
-
Remove unnecessary Secret rules from a Role
- Run on: any machine with kubectl access
- Export the Role manifest, edit locally, and remove
secretsfromresourcesand/or removeget,list,watchfromverbswhere not strictly needed:
- Edit
/tmp/role-<namespace>-<role-name>.yaml:- In
.rules[], deletesecretsfromresources:or delete the entire rule if only for secrets. - If some verbs are truly required, keep only the minimal needed subset.
- In
- Apply the updated Role:
-
Split roles when only some subjects need Secret access
- If some workloads bound to the Role require Secret access and others do not:
- Create a new, narrow Role only for those workloads:
- Update RoleBindings so only the specific service accounts/users that truly need Secret access bind to
<new-name>, and others bind to a Role without Secret permissions:Adjust.roleRef.nameand/or split into multiple RoleBindings as needed.
- Create a new, narrow Role only for those workloads:
- If some workloads bound to the Role require Secret access and others do not:
-
Re-test workloads depending on modified Roles
- Run on: any machine with kubectl access
- For each namespace where Roles were changed, check Pods for errors indicating missing Secret access:
- If a workload fails due to required Secret reads, minimally re-add the specific verbs it needs (e.g., only
geton specific secrets viaresourceNamesif appropriate).
-
Verification (no Roles with unnecessary Secret read access)
- Run on: any machine with kubectl access
Using kubectl
Using kubectl
Automation
Automation

