Calendar Icon White
December 5, 2026
Clock Icon
9
 min read

GCP Security Best Practices: A Checklist for 2026

GCP security best practices with gcloud commands: remove allUsers bindings, kill service account keys, lock down Cloud SQL and enforce org policies.

GCP Security Best Practices: A Checklist for 2026
ChatGPT
Perplexity
Grok
Google AI
Claude
Summarize and analyze this article with:

TL;DR

The most important GCP security best practices are to remove public allUsers bindings, replace service account keys with workload identity, keep Cloud SQL off public IPs, close SSH and RDP to the internet, and enforce all of it with organization policies so new projects start secure. Each item below comes with the gcloud command to check it.

This checklist is written for a growing company on Google Cloud that needs to pass a SOC 2 or ISO 27001 audit without a dedicated cloud security team. It comes from Strac, a Y Combinator-backed data security company trusted by enterprises, whose cloud posture checks run daily across Google Cloud, AWS and Azure.

✨ GCP security best practices: where to start

Google secures the infrastructure; you secure what you configure on it, from IAM bindings to firewall rules. Most real exposure in Google Cloud comes from six settings. Here is what they look like as findings in Strac, next to AWS and Azure:

Strac Comply cloud posture view with Google Cloud, AWS and Azure findings, each with severity and a fix button
One list across clouds, each finding with its fix.
Six GCP misconfigurations: allUsers bindings, service account keys, public Cloud SQL, open firewall rules, default service accounts and quiet audit logs

The checks below follow the CIS Google Cloud Platform Foundation Benchmark and Google's own security best practices, trimmed to what an auditor and an attacker care about most.

1. Remove allUsers and allAuthenticatedUsers bindings

In Google Cloud, a resource is public when its IAM policy grants a role to allUsers (anyone on the internet) or allAuthenticatedUsers (anyone with any Google account, which is effectively the same thing). This applies to Cloud Storage buckets, Cloud Run services, Cloud Functions, BigQuery datasets and more. One command finds them all across the organization:

gcloud asset search-all-iam-policies \
  --scope=organizations/ORG_ID \
  --query="policy:(allUsers OR allAuthenticatedUsers)" \
  --format="table(resource, policy.bindings.role)"

Some results are intentional: a public website bucket or an unauthenticated Cloud Run API. Record those as accepted exceptions with a reason. For everything else, remove the binding and turn on public access prevention for the bucket:

gcloud storage buckets remove-iam-policy-binding gs://BUCKET \
  --member=allUsers --role=roles/storage.objectViewer

gcloud storage buckets update gs://BUCKET --public-access-prevention

The same problem on AWS has its own guide: how to find and fix public S3 buckets.

✨ 2. Stop using service account keys

A service account key is a JSON file that authenticates as the service account from anywhere, for as long as it exists. That is why keys are the credential most often found leaked in git and on laptops. Google's guidance on managing service account keys is to avoid them wherever an alternative exists, and there almost always is one.

Four steps to remove service account keys: inventory, replace with workload identity, enforce with org policy, delete
# list user-managed keys for a service account
gcloud iam service-accounts keys list \
  --iam-account=SA_NAME@PROJECT_ID.iam.gserviceaccount.com --managed-by=user

# disable a key first (reversible), delete once nothing breaks
gcloud iam service-accounts keys disable KEY_ID --iam-account=SA_EMAIL
gcloud iam service-accounts keys delete  KEY_ID --iam-account=SA_EMAIL

Replace keys with Workload Identity Federation for GitHub Actions, other clouds and on-prem workloads, and with attached service accounts for anything running on Google Cloud. If a key has already leaked, our guide to hardcoded secrets covers rotation and cleanup.

3. Keep Cloud SQL off the public internet

A Cloud SQL instance with a public IP and an authorized network of 0.0.0.0/0 accepts connection attempts from anywhere. Check every instance:

gcloud sql instances list \
  --format="table(name, ipAddresses[].type, settings.ipConfiguration.authorizedNetworks[].value, settings.ipConfiguration.sslMode)"

The safest setup is private IP only, with applications connecting over the VPC or through the Cloud SQL Auth Proxy, which handles encryption and IAM-based authorization. If a public IP is unavoidable, restrict authorized networks to known addresses and require encrypted connections:

gcloud sql instances patch INSTANCE --ssl-mode=ENCRYPTED_ONLY
gcloud sql instances patch INSTANCE --authorized-networks=203.0.113.10/32

Turn on automated backups and point-in-time recovery while you are there: auditors check recovery as closely as exposure.

Checking every project by hand before each audit?

Book a demo of Strac's GCP posture checks

4. Close SSH and RDP to the internet

Firewall rules that allow port 22 or 3389 from 0.0.0.0/0 are among the most common findings in any cloud. The default network created in older projects includes rules like this. Find them:

gcloud compute firewall-rules list \
  --filter="sourceRanges:(0.0.0.0/0) AND direction=INGRESS" \
  --format="table(name, network, allowed[].map().firewall_rule().list(), sourceRanges.list())"

Replace them with Identity-Aware Proxy TCP forwarding, which only needs ingress from Google's IAP range 35.235.240.0/20, and use OS Login so SSH access follows IAM instead of keys scattered in metadata.

5. Tame default service accounts and broad roles

In older projects, the Compute Engine default service account is granted the basic Editor role on the whole project, and every VM that uses it inherits that power. Remove the grant, give each workload its own service account with only the roles it needs, and look for basic roles (Owner, Editor, Viewer) granted to people. IAM Recommender suggests narrower roles based on what each principal actually used in the last 90 days.

# who holds basic roles in a project?
gcloud projects get-iam-policy PROJECT_ID \
  --flatten="bindings[].members" \
  --filter="bindings.role:(roles/owner OR roles/editor)" \
  --format="table(bindings.role, bindings.members)"

6. Turn on the audit logs that matter

Admin Activity audit logs are always on. Data Access audit logs, which record who read or changed data, are off by default for most services. Turn them on for services that hold sensitive data, such as Cloud Storage, Cloud SQL and Secret Manager, and route logs to a bucket with retention that matches your policy. Without them, the first question in any incident, what did they access, has no answer.

✨ 7. Enforce it with organization policies

Checklists drift; organization policies do not. Set these once at the organization and every new project inherits them:

Six GCP organization policies: service account keys, domain restricted sharing, default account grants, uniform bucket access, public access prevention and Cloud SQL public IPs

Google now enforces several of these secure-by-default policies automatically for organizations created on or after May 3, 2024, including blocking service account key creation and upload, restricting IAM to your own domain, and uniform bucket-level access. Older organizations have to opt in. Check what is enforced:

gcloud resource-manager org-policies list --organization=ORG_ID

8. Harden GKE clusters

If you run Kubernetes on Google Cloud, the cluster adds its own short list. Use Workload Identity Federation for GKE so pods get Google credentials without service account keys mounted as secrets. Restrict the control plane with authorized networks or a private endpoint, use private nodes so workers have no public IPs, and turn on Shielded GKE Nodes. Check the basics across clusters:

gcloud container clusters list \
  --format="table(name, location, privateClusterConfig.enablePrivateNodes, masterAuthorizedNetworksConfig.enabled, workloadIdentityConfig.workloadPool)"

Kubernetes Secret objects are only base64-encoded, so keep real credentials in Secret Manager and mount them at runtime; our guide to hardcoded secrets covers why.

9. Fence sensitive data with VPC Service Controls

IAM decides who can call an API; VPC Service Controls decide where the call can come from. A service perimeter around the projects that hold customer data stops a stolen credential from copying a BigQuery dataset or a bucket to a project outside the perimeter, even when the credential itself is valid. Perimeters take planning, because legitimate tools also have to fit inside, so start in dry-run mode, watch what would have been blocked, then enforce. For most teams this comes after the basics above, not before.

GCP traps for teams coming from AWS

Many teams run Google Cloud as a second cloud, and AWS habits cause specific mistakes. Projects are not accounts: IAM granted at the folder or organization inherits down to every project beneath it, so one broad grant at the top quietly applies everywhere. Basic roles such as Editor are far wider than most AWS managed policies, and the default compute service account used to receive Editor automatically. There is no single "block public access" switch per account as on S3; the equivalent is the public access prevention organization policy. And service account keys play the role of IAM user access keys, with the same tendency to end up in git. If you also run AWS, our AWS security checklist covers the same ground there.

The GCP security checklist at a glance

AreaCheckWhy an auditor cares
Public exposureNo allUsers / allAuthenticatedUsers bindingsCC6.1, CC6.6: access restricted
StoragePublic access prevention and uniform bucket-level accessCC6.1: data protected
IdentityNo user-managed service account keysCC6.1: credentials controlled
IdentityNo basic roles for people; default accounts without EditorCC6.3: least privilege
Identity2-step verification for all users in Cloud Identity or WorkspaceCC6.1: strong authentication
NetworkNo SSH/RDP from 0.0.0.0/0; IAP for admin accessCC6.6: boundary protection
DatabasesCloud SQL private IP or restricted networks; encrypted connectionsCC6.7: data in transit
RecoveryCloud SQL backups and point-in-time recoveryA1.2: recovery
LoggingData Access logs for sensitive services, retainedCC7.2: monitoring
DetectionSecurity Command Center enabledCC7.2: anomaly detection

Identity is often managed in Google Workspace for Google Cloud customers, so the same audit usually reviews it; our guide to Google Workspace SOC 2 compliance covers that side.

Native tools: Security Command Center

Google's Security Command Center Standard tier is free and flags common misconfigurations such as public buckets and open firewall rules. Turn it on whatever else you use. Premium and Enterprise add threat detection, attack paths and compliance reporting. What none of the tiers does is turn findings into SOC 2 evidence or cover AWS and Azure alongside Google Cloud in one list for a small team; for that comparison, see our roundup of CSPM tools.

A 30-day GCP hardening plan

Trying to fix everything at once is how hardening projects stall. This order front-loads the changes that remove the most risk for the least disruption:

  1. Week 1: public exposure. Remove allUsers and allAuthenticatedUsers bindings that are not deliberate, turn on public access prevention for buckets, and close SSH and RDP from 0.0.0.0/0. These are the findings attackers scan for.
  2. Week 2: identity. Require 2-step verification for every user, replace basic roles for people with predefined roles, and inventory every service account key with its last-used date.
  3. Week 3: keys and databases. Move CI to Workload Identity Federation, delete keys nobody has used in 90 days, and put Cloud SQL on private IP or tightly restricted networks.
  4. Week 4: lock it in. Enforce the organization policies above, turn on Data Access logs for sensitive services, and start daily checks so drift shows up the day it happens.

Record each change with the date and the reason. That record is exactly what a SOC 2 auditor asks for when they test change management and access controls.

✨ How Strac runs these checks every day

Strac connects to Google Cloud with a read-only service account and never changes your settings. It runs its Google Cloud checks every day, alongside 95 for AWS and 34 for Azure, covering public exposure, identity, network and logging. Each finding names the exact resource, explains why it matters and gives the fix. Fixed findings close on the next run, and resources that are public on purpose go into a waiver register with a reason and a review date. Every daily result is saved as SOC 2, ISO 27001 and HIPAA evidence:

Strac Comply readiness dashboard with controls, evidence status and open findings
Cloud findings land next to the controls they prove.

Because Strac is one platform, the same view covers secret scanning, dependency scanning, the AI pen test and compliance automation. If you also run AWS or Azure, our AWS security checklist and Azure security best practices follow the same format, and our guide to what CSPM is explains the category. See Strac's cloud posture checks.

Run every GCP check daily, with the fix and the audit evidence attached.

Book a demo of Strac CSPM for Google Cloud

🌶️ Spicy FAQs about GCP security best practices

What are the most important GCP security best practices?

Remove allUsers and allAuthenticatedUsers bindings, stop using service account keys in favor of workload identity, keep Cloud SQL off public IPs, close SSH and RDP to the internet, take the Editor role away from default service accounts, and turn on Data Access audit logs for sensitive services. Enforce as much as possible with organization policies.

Why are service account keys risky in Google Cloud?

A service account key is a long-lived credential file that works from anywhere until it is deleted. Keys get committed to git, copied to laptops and left in CI. Google recommends alternatives such as Workload Identity Federation and attached service accounts, which issue short-lived tokens instead.

How do I find public resources in GCP?

Search IAM policies across the organization for allUsers and allAuthenticatedUsers with Cloud Asset Inventory: gcloud asset search-all-iam-policies with a query for those members. It covers buckets, Cloud Run services, Cloud Functions, BigQuery datasets and more.

Is Security Command Center free?

Security Command Center Standard is free and covers basic posture findings for Google Cloud. Premium and Enterprise tiers add threat detection, attack paths, compliance monitoring and, for Enterprise, multi-cloud coverage.

Does Strac support Google Cloud?

Yes. Strac connects to Google Cloud with a read-only service account and runs its GCP checks daily alongside AWS and Azure, with fix steps for each finding and daily results saved as SOC 2 evidence.

Customer story

“Don’t just alert on problems, fix them.”

Scott Roberts, Chief Information Security Officer, UiPath

  • UiPath
  • Crypto.com
  • Inmar Intelligence
  • thredUP
  • Paymentology
  • Enveda
  • Genesis Molecular AI
  • MeridianLink
More customer stories →
What are the most important GCP security best practices?
Why are service account keys risky in Google Cloud?
How do I find public resources in GCP?
Is Security Command Center free?
Does Strac support Google Cloud?
Discover & Protect Data on SaaS, AI, MCP, Endpoints & Cloud
Strac provides end-to-end data loss prevention for all SaaS and Cloud apps. Integrate in under 10 minutes and experience the benefits of live DLP scanning, live redaction, and a fortified SaaS environment.
Get compliant from $4,995

Latest articles

Browse all

Get Your Datasheet

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
Close Icon