Harden Google Cloud, one service at a time.
A hardening page for each of 13 Google Cloud services, written for platform and security engineers who own a GCP organization. Each one lists the baseline controls, then the gcloud commands, org policy constraints, CIS checks and detections to apply them.
Mapped to the CIS Google Cloud Platform Foundations Benchmark v5.0.1 and Security Command Center findings.
Every service sits at a node of the hierarchy.
Some services are configured once at the organization and inherited by everything below; others live in the projects that hold workloads and data. Set the strictest controls as high as you can, and grant exceptions as low as you can.
Organization
Configured once and inherited by everything below: the org policy constraints, the aggregated audit log sink, posture findings across every project, and who holds which role.
- 01Resource Manager and Organization Policy11 baseline controls
iam.managed.allowedPolicyMembers - 02Cloud Audit Logs and Cloud Logging12 baseline controls
gcloud logging sinks create --include-children - 03Security Command Center10 baseline controls
gcloud scc muteconfigs create - 04IAM12 baseline controls
iam.managed.disableServiceAccountKeyCreation
Folder
Groups projects that share policy. Production gets a service perimeter around its sensitive APIs and a Shared VPC with firewall policies that project owners cannot override.
- 07VPC Service Controls9 baseline controls
restricted.googleapis.com - 06VPC and firewall rules12 baseline controls
compute.vmExternalIpAccess
Project
Where workloads, data and keys live, and where exceptions belong: one public website bucket, not a folder-wide override.
- 08Cloud Storage11 baseline controls
storage.publicAccessPrevention - 09Cloud KMS10 baseline controls
gcp.restrictNonCmekServices - 10Cloud SQL12 baseline controls
sql.restrictPublicIp - 05Secret Manager9 baseline controls
roles/secretmanager.secretAccessor - 11Compute Engine12 baseline controls
enable-oslogin=TRUE - 12GKE12 baseline controls
--enable-private-nodes - 13Cloud Run and Cloud Functions11 baseline controls
run.allowedIngress
GCP Hardening is an independent, non-commercial resource. It is not affiliated with, endorsed by or sponsored by Google LLC. Google Cloud, Google Cloud Platform, GCP and related marks are trademarks of Google LLC. Other names are trademarks of their respective owners.
13 services, in five categories
Every page has the same shape: a baseline controls table, the detail for each control, logging and detection, common mistakes and references.
Governance and logging
The hierarchy and org policies every project inherits, the audit trail, and posture findings.
- 01Resource Manager and Organization PolicyHarden the Google Cloud organization: folder hierarchy, super admins, admin groups, default roles, liens, org policy constraints and a CIS audit workflow.
iam.managed.allowedPolicyMembersiam.managed.allowedPolicyMembers11 baseline controls - 02Cloud Audit Logs and Cloud LoggingEnable Data Access audit logs, route an org-wide sink to a locked, CMEK-protected log bucket, guard exclusions and build the CIS 2.5 to 2.12 alerts.
gcloud logging sinks create --include-childrengcloud logging sinks create --include-children12 baseline controls - 03Security Command CenterRun Security Command Center at org level: tiers, Security Health Analytics, threat detection, custom modules, mute rules, exports, postures and IAM.
gcloud scc muteconfigs creategcloud scc muteconfigs create10 baseline controls
Identity and secrets
Least-privilege IAM, workloads without long-lived keys, and secrets out of code and env vars.
- 04IAMLeast privilege in Google Cloud IAM: basic roles, recommendations, deny policies, PAM, service accounts and keys, Workload Identity Federation, API keys.
iam.managed.disableServiceAccountKeyCreationiam.managed.disableServiceAccountKeyCreation12 baseline controls - 05Secret ManagerHarden Secret Manager: per-secret IAM, replication and CMEK, rotation with Pub/Sub, version destruction, audit logs and Cloud Run or GKE consumption.
roles/secretmanager.secretAccessorroles/secretmanager.secretAccessor9 baseline controls
Network
Firewall policy, private egress and service perimeters around sensitive APIs.
- 06VPC and firewall rulesHarden VPC networks: default network, firewall policies, IAP for SSH and RDP, flow logs, Private Google Access, Cloud NAT, Cloud DNS and SSL policies.
compute.vmExternalIpAccesscompute.vmExternalIpAccess12 baseline controls - 07VPC Service ControlsBuild VPC Service Controls perimeters safely: access policies, access levels, ingress and egress rules, dry run, restricted VIP, violation analysis and CIS 3.8.
restricted.googleapis.comrestricted.googleapis.com9 baseline controls
Data
Buckets, encryption keys you control and databases without public endpoints.
- 08Cloud StorageSecure Cloud Storage buckets: public access prevention, uniform bucket-level access, precise IAM, HMAC keys, soft delete, Bucket Lock, CMEK and access logging.
storage.publicAccessPreventionstorage.publicAccessPrevention11 baseline controls - 09Cloud KMSHarden Cloud KMS and CMEK: key project layout, separation of duties, rotation, destruction safeguards, Autokey, org policies requiring CMEK, and key monitoring.
gcp.restrictNonCmekServicesgcp.restrictNonCmekServices10 baseline controls - 10Cloud SQLHarden Cloud SQL: private IP or PSC, no 0.0.0.0/0 authorized networks, SSL mode, Auth Proxy, IAM database auth, engine flags, pgAudit, backups and CMEK.
sql.restrictPublicIpsql.restrictPublicIp12 baseline controls
Compute and containers
Virtual machines, Kubernetes clusters and serverless services with hardened defaults.
- 11Compute EngineHarden Compute Engine VMs: dedicated service accounts, OS Login with 2SV, no external IPs, Shielded and Confidential VM, serial port, patching and CMEK disks.
enable-oslogin=TRUEenable-oslogin=TRUE12 baseline controls - 12GKEHarden GKE clusters: private nodes, DNS-based control plane, Workload Identity Federation, node service accounts, RBAC, Pod Security and secrets encryption.
--enable-private-nodes--enable-private-nodes12 baseline controls - 13Cloud Run and Cloud FunctionsHarden Cloud Run and Cloud Run functions: runtime service accounts, ingress, invoker IAM, IAP, VPC egress, secrets, Binary Authorization, CMEK and org policies.
run.allowedIngressrun.allowedIngress11 baseline controls
Start at the top of the hierarchy.
Resource Manager and Organization Policy sets the nodes, admin groups and constraints every other service page builds on.