Google Cloud — Service Account Key
GCP service account JSON keys grant long-lived programmatic access to Google Cloud resources. They are high-risk because they don't expire by default.
Immediate Action Required
Deleting a leaked credential from a repository does not invalidate it. Assume it has already been copied. Follow the revocation steps below immediately, then investigate for unauthorized access.
What Is This Credential?
GCP service account JSON keys grant long-lived programmatic access to Google Cloud resources. They are high-risk because they don't expire by default.
Permissions Granted
- Access to all GCP services granted to the service account
- Potential project-wide access depending on IAM bindings
- Cross-project access if configured
Exposure & Blast Radius
- Unauthorized access to GCP resources (GCS, BigQuery, Compute Engine)
- Data exfiltration from Cloud Storage buckets
- Unauthorized compute resource provisioning
- Access to sensitive data in BigQuery or Firestore
- Significant unexpected billing
Immediate Response Steps
Disable the service account key
Go to IAM & Admin → Service Accounts → Select account → Keys → Disable the key.
Review Cloud Audit Logs
Check Cloud Logging for API calls made with the service account in the past 90 days.
Create a new key if needed
Generate a replacement key. Consider using Workload Identity Federation instead.
Delete the old key
After updating all consumers, permanently delete the disabled key.
Revocation vs Rotation
Revocation
Disable or delete the key in IAM & Admin → Service Accounts → Keys. Disabling is immediate.
Rotation
Create a new key in the same service account. Prefer Workload Identity Federation over long-lived keys.
Grace Period & Session Persistence
Grace Period
None. Key disabling is immediate.
Session Persistence
OAuth 2.0 access tokens derived from the key remain valid for up to 1 hour. They cannot be individually revoked — wait for expiry or disable the service account entirely.
Investigation Checklist
- Review Cloud Audit Logs (Admin Activity and Data Access logs)
- Check for unexpected GCS bucket access
- Review BigQuery job history
- Look for new IAM bindings or service account creations
- Check billing for unexpected resource usage
- Review Compute Engine instance creation logs
Recovery Steps
- Update all services with the new key or Workload Identity credentials
- Consider migrating to Workload Identity Federation to eliminate long-lived keys
- Review and tighten IAM roles on the service account
- Enable Security Command Center for ongoing monitoring
Prevention
- Use Workload Identity Federation instead of service account keys
- Apply least-privilege IAM roles
- Enable key rotation policies
- Never commit service account JSON files to repositories
- Use Secret Manager for storing credentials
Sources & Evidence
Always verify critical instructions with official provider documentation before taking action. Provider behavior may change without notice.
Found an issue with this playbook?
If these instructions are incorrect, outdated, or missing important information, please report it so we can improve the playbook.
Report an Issue on GitHub