Skip to main content

GCP Service Account Key Checker

Validate a GCP service account key JSON file for structural correctness, required fields, and security best practices. All checking runs locally in your browser — your key file is never transmitted anywhere.

✓ 60K+ developers trust DevPlaybook ✓ 100% local — key never leaves your browser ✓ 9 validation checks

Frequently Asked Questions

What is a GCP service account key?▼

A service account key is a JSON file containing credentials that allow applications to authenticate to Google Cloud APIs as a service account. The key file contains a private RSA key, the service account email, project ID, and OAuth endpoints. Applications use the key with client libraries or gcloud CLI to obtain access tokens. Keys are powerful — they grant the permissions of the service account and don't expire by default.

Why should I avoid using service account key files?▼

Service account key files are long-lived credentials that are easy to leak (committed to Git, stored in environment variables, included in container images). Google recommends avoiding key files when running on GCP infrastructure. Alternatives: Workload Identity Federation for GKE workloads (Pod uses its Kubernetes service account to authenticate without a key), Application Default Credentials on Compute Engine/Cloud Run (no key needed — ADC uses the VM's attached service account), and Workload Identity Federation for external workloads (GitHub Actions, AWS, Azure).

How should I rotate service account keys?▼

Create a new key before disabling the old one to avoid downtime. Steps: 1) Create a new key (gcloud iam service-accounts keys create), 2) Update all systems using the old key to use the new one, 3) Verify the new key works, 4) Delete the old key (gcloud iam service-accounts keys delete). GCP recommends rotating keys every 90 days. You can list all keys with 'gcloud iam service-accounts keys list --iam-account=SA_EMAIL'.

What is the difference between service_account and authorized_user key types?▼

service_account keys represent non-human identities designed for application authentication. They have long-lived RSA private keys and grant the permissions of the service account's IAM bindings. authorized_user keys represent OAuth2 credentials for a human Google account (generated by gcloud auth application-default login). These are user-context credentials with user-level permissions. Never use authorized_user credentials in production — use service accounts with minimal permissions instead.

What is Workload Identity Federation?▼

Workload Identity Federation lets external workloads (GitHub Actions, AWS EC2, Azure VMs, Kubernetes outside GCP) authenticate to GCP without service account key files. Instead of a long-lived key, the workload exchanges a short-lived credential from its native platform for a GCP access token. This eliminates the key rotation problem and reduces the risk of credential leaks. For GKE specifically, Workload Identity maps Kubernetes service accounts to GCP service accounts.

How do I check what permissions a service account has?▼

Use 'gcloud projects get-iam-policy PROJECT_ID --flatten=bindings[].members --filter=bindings.members:serviceAccount:SA_EMAIL --format=table(bindings.role)' to list all roles bound to a service account at the project level. Also check at the folder and organization level. Use IAM Recommender to identify unused permissions for least-privilege cleanup. The Google Cloud Console IAM page also shows effective permissions with inherited roles.

Share this tool: X / Twitter LinkedIn
✓ 60,000+ developers use DevPlaybook ★★★★★ 4.8 / 5 on Gumroad ✓ MIT licensed · Instant download ✓ No login required

Related Products

on Gumroad

You Might Also Need

More Free Tools

Enjoying this tool? Get more like it.

Weekly developer tool guides, productivity playbooks & AI tricks. Free. No spam.

DevPlaybook Pro 7 days free

Unlock AI-Powered Dev Tools

  • ⚡ AI Code Review, Doc Generator & SQL Builder
  • ⚡ All premium templates & early access
  • ⚡ Member discounts on Gumroad products
Start Free Trial →

$9/mo after trial · Cancel anytime

Want the full toolkit?

Get DevPlaybook Pro

Every template, guide, boilerplate, and automation script in one bundle. 13 premium products — grab them all at once and save big.

$79
$241 separately Save $162 (67% off)
Get DevPlaybook Pro — $79 →

MIT licensed · Instant download · No subscription

See what's included → Browse all deals →