Check ID:
Provider: GCP
Service:
Severity: MEDIUM
Categories:
Resource type:
iam_sa_user_managed_key_unusedProvider: GCP
Service:
iamSeverity: MEDIUM
Categories:
secretsResource type:
iam.googleapis.com/ServiceAccountKeyWhat this check verifies
User-managed service account keys with no recorded activity during the lastmax_unused_account_days are identified using key-usage metrics per service account.
Risk
Stale user-managed keys expand exposure of long-lived credentials. If leaked, an attacker can authenticate as the service account off-platform, bypass network controls, access data, alter resources, and persist-compromising confidentiality and integrity, and risking availability via destructive changes.Recommendation
Prefer managed workload identities and service account impersonation over user-managed keys. Enforceiam.disableServiceAccountKeyCreation, remove unused keys, and use short key lifetimes with rotation when unavoidable. Apply least privilege, monitor key usage, and enforce separation of duties to limit blast radius.
Remediation
- CLI
- Dashboard steps
References
- https://www.trendmicro.com/trendaivisiononecloudriskmanagement/knowledge-base/gcp/CloudIAM/delete-user-managed-service-account-keys.html
- https://cloud.google.com/iam/docs/creating-managing-service-account-keys
- https://docs.cloud.google.com/iam/docs/samples/iam-delete-key
- https://cloud.google.com/iam/docs/service-account-overview#identify-unused
Where this check fires
This check runs on every scheduled scan against your GCP account. Findings appear at Cloud Security → Findings filterable byCheck ID = iam_sa_user_managed_key_unused. To re-evaluate after a fix, hit Run now on the account’s schedule under Cloud Security → Schedules — the next scan re-checks this control and marks the finding fixed or keeps it persistent.
← Back to GCP checks