Join our Newsletter — 33% off our NHI Course
Home› Guides› Google Cloud VPC and Cloud NGFW Security Guide:…
Guide Cloud Security

Google Cloud VPC and Cloud NGFW Security Guide: Shared VPC, Firewall Policies and Private Access

PDF for newsletter subscribers · free to read online

← All guides
By NHI Mgmt Group, edited by Lalit Choda Updated 8 November 2026 14 min read
On this page

Google Cloud networks are usually secured by several overlapping firewall layers that few teams can explain in order, which is how a folder-level allow or an old default-network rule ends up exposing SSH to the internet. This guide covers Google Cloud VPC security and Cloud Next Generation Firewall (Cloud NGFW): hierarchical and network firewall policies, the evaluation order, secure tags and service account targets, Shared VPC roles, Private Google Access, IAP TCP forwarding, organisation policy guardrails and VPC Flow Logs. It is written for platform and network engineers and cloud security reviewers. For cross-cloud principles, see the Cloud Network Security Guide; this page stays specific to Google Cloud.

This is an independent guide from NHI Mgmt Group, based on Google Cloud's public documentation as of November 2026. It is not sponsored or reviewed by Google Cloud. Product features change, so confirm settings against Google Cloud's current documentation.

Key takeaways

  • Know the evaluation order. By default Google Cloud evaluates hierarchical policies (organisation, then folders), regional system policies, VPC firewall rules, global network policies, regional network policies, then the implied action.
  • Delete the default network. It ships with default-allow-ssh, default-allow-rdp, default-allow-icmp and default-allow-internal at priority 65534; enforce skipDefaultNetworkCreation so new projects never get it.
  • Target by identity, not network tag. Anyone who can edit an instance can change its network tags; service account targets and IAM-governed secure tags are harder to tamper with.
  • Shared VPC separates duties. Keep firewall control (compute.securityAdmin) in the host project with the network team, and grant compute.networkUser at subnet level, not project level.
  • Private access needs DNS and routes. Private Google Access is per subnet; restricted.googleapis.com (199.36.153.4/30) only serves VPC Service Controls supported APIs and reduces exfiltration paths.

How identity and access work in Google Cloud VPC

A VPC network is a global resource in a project. Who can change it is decided by IAM; what traffic flows is decided by firewall rules and policies whose targets can themselves be identities. That second point is what makes Google Cloud different: firewall rules can target the service account a VM runs as, or IAM-controlled secure tags, so network policy can follow workload identity.

Firewall layers and evaluation order

StepLayerAttached toNotes
1Hierarchical firewall policiesOrganisation, then each folder down to the projectCentral guardrails; goto_next hands evaluation to the next level
2Regional system firewall policiesManaged by GoogleYou can only toggle logging; no charge
3VPC firewall rulesOne VPC networkPriority 0 to 65535, default 1000; deny wins only at equal priority
4Global network firewall policiesOne or more VPC networksSupport secure tags, FQDN, geolocation and threat intelligence by tier
5Regional network firewall policiesNetworks in one regionNo apply_security_profile_group action
6Implied actionEvery networkIngress to VM interfaces deny; egress allow

This is the default AFTER_CLASSIC_FIREWALL enforcement order. Setting networkFirewallPolicyEnforcementOrder to BEFORE_CLASSIC_FIREWALL moves global and regional network policies ahead of VPC firewall rules, which is useful when migrating off classic rules. Within a policy, rules have priorities from 0 to 2,147,483,547 and at most one rule matches; actions are allow, deny, goto_next and apply_security_profile_group.

Choosing targets

Target typeWho can change membershipStrengthUse when
All instancesNot applicableBroadBaseline denies and logging rules
Network tags (VPC rules)Anyone with instance edit permissionBroad: a workload owner can add a tag and inherit accessLegacy rules only; plan migration
Service accountsNeeds Service Account User and an instance stopStrong: tied to workload identityMost allow rules between tiers
Secure tags (network policies)Governed by IAM on the tag key and valueStrong and centrally controlledMicro-segmentation across projects and in hierarchical policies

Admin roles and privileged access

Network administration in Google Cloud is split across predefined roles. The split is useful only if you keep it.

  • compute.securityAdmin: manages firewall rules and SSL certificates. This is the role that can open the network; hold it in the host project for a small network security group.
  • compute.networkAdmin: manages other network resources (subnets, routes, peering, Private Google Access) but not firewall rules. By default a Network Admin for one network can peer it with any other network, so constrain peering with constraints/compute.restrictVpcPeering.
  • compute.xpnAdmin (Shared VPC Admin): enables host projects, attaches service projects and delegates subnet access. Grant at organisation or folder level to very few people.
  • compute.networkUser: lets service project admins create resources in shared subnets. Granted at project level it covers every current and future subnet in the host project; grant it per subnet instead and review bindings when subnets are added.
  • Firewall policy administrators: whoever can edit an organisation or folder hierarchical policy controls traffic for every project below it. Treat those bindings as tier zero and review them with organisation IAM.
  • Remote administration: use IAP TCP forwarding instead of external IPs. Allow ingress only from 35.235.240.0/20 on 22 or 3389, and grant roles/iap.tunnelResourceAccessor with IAM Conditions such as destination.port == 22. Note that Owners bypass these conditions. See the Identity-Aware Proxy Guide.

Use groups, not individual bindings, and time-bound elevation for the security admin roles. See the Google Cloud IAM and Service Accounts Guide.

Integrations, API tokens and service accounts

Most traffic leaving a Google Cloud VPC goes to Google APIs on behalf of service accounts. The network design decides which API front doors those identities can reach.

Domain optionIPv4 rangeAPIs reachableUse when
Default domainsGoogle's published dynamic rangesMost APIs and Workspace web appsSimple estates without VPC Service Controls
private.googleapis.com199.36.153.8/30Most APIs, not Workspace web apps; works whether or not the API supports VPC SCYou need APIs outside VPC SC support
restricted.googleapis.com199.36.153.4/30Only APIs supported by VPC Service ControlsSensitive projects inside a perimeter
  • Private Google Access: enabled per subnet, it lets VMs with only internal IPs reach Google APIs. It needs a route to the VIP range whose next hop is the default internet gateway, egress firewall allows for the range (Google also recommends 34.126.0.0/18), and a private DNS zone for googleapis.com with A records for the chosen VIP and a *.googleapis.com CNAME. Do not mix the two VIPs.
  • Pair with VPC Service Controls: network paths decide reachability; perimeters decide whether a credential used from outside can read the data. See the VPC Service Controls Guide.
  • Service account keys bypass network design: a downloaded key works from any internet host against default domains. Block key creation and use attached service accounts or workload identity federation. See the Google Cloud Service Account Keys Security Guide.
  • Metadata server: traffic to 169.254.169.254 is always allowed and cannot be blocked with firewall rules. Protect it in the application (SSRF defences) because it issues service account tokens (ATT&CK T1552.005).
  • Producer services: managed services such as Cloud SQL are reached through private services access or Private Service Connect. See the Cloud Private Connectivity Guide.

Logging and detection

Three log sources matter: Cloud Audit Logs (Admin Activity) for firewall, route and peering changes, firewall rules logging for allow and deny decisions per rule, and VPC Flow Logs for sampled traffic. See the Google Cloud Audit Logs and Log Sinks Guide.

  • VPC Flow Logs: enable at organisation, VPC network, subnet, VLAN attachment or Cloud VPN tunnel level. Aggregation intervals run from 5 seconds to 15 minutes. Configurations made through the Compute Engine API keep 50% of sampled entries by default; Network Management API configurations keep 100%. Egress packets are sampled before egress firewall rules (so denied outbound attempts can appear), ingress packets after ingress rules (so denied inbound packets do not). Logs stay 30 days in Cloud Logging unless you set retention or export them.
  • Firewall rules logging: enabled per rule and billed, so turn it on for deny rules on sensitive tiers, for rules allowing internet ingress, and during migrations. Firewall Insights shows shadowed and unused rules.
  • Cloud NGFW Enterprise threat logs: intrusion prevention detections from firewall endpoints; route them to your SIEM.
DetectionSourceATT&CK
Firewall rule or policy rule created allowing 0.0.0.0/0 to 22, 3389 or database portsAdmin Activity audit log (for example v1.compute.firewalls.insert)T1133, T1021.004
Hierarchical policy association removed or rule changed to goto_nextAdmin Activity audit log at organisation or folderT1599
New VPC peering, route with custom next hop, or VM with IP forwardingAdmin Activity audit logT1599
External IP attached to a VM in a restricted projectAudit log and org policy violationT1578
One source hitting many ports or hostsVPC Flow Logs, firewall deny logsT1046
Large egress to new external destinations, unusual DNS volumeVPC Flow Logs, Cloud DNS logs, NGFW threat logsT1048, T1071.004

Metrics

  • Default networks remaining: projects still holding a network named default. Target zero.
  • Internet-exposed admin ports: rules allowing 0.0.0.0/0 to 22 or 3389. Target zero, with IAP range rules instead.
  • Identity-targeted rules: share of allow rules targeting service accounts or secure tags rather than network tags or all instances.
  • External IP exceptions: VMs allowed by vmExternalIpAccess, each with an owner and review date.
  • Flow log coverage: subnets with VPC Flow Logs enabled and exported to the SIEM.
  • Unused rules: rules Firewall Insights reports with no hits in 90 days, removed each quarter.

Hardening baseline

Organisation policy guardrails

ConstraintEffect
compute.skipDefaultNetworkCreationNew projects do not get the default network and its permissive rules
compute.vmExternalIpAccessOnly listed VMs may hold external IPv4 addresses (IPv6 not covered: use the IPv6 constraints)
compute.restrictVpcPeeringLimits which networks can peer
compute.restrictSharedVpcHostProjects, compute.restrictSharedVpcSubnetworksWhich host projects and subnets service projects may use (not retroactive)
compute.restrictCloudNATUsageWhich subnets may use Cloud NAT for egress
compute.restrictLoadBalancerCreationForTypesBlocks external load balancer types where not approved
compute.managed.vmCanIpForwardRestricts IP forwarding, which turns a VM into a router
compute.requireOsLoginOS Login on new projects, so SSH access follows IAM

See the Google Cloud Organization Policy Guide for rollout of these constraints in dry-run mode.

Choosing a Cloud NGFW tier

  • Essentials (no charge): IP, port and protocol rules, secure tags and service account targets. Enough for segmentation in most estates.
  • Standard: adds FQDN objects and threat intelligence lists, so egress can be limited to named domains and known bad ranges blocked. A good fit for controlled egress without a separate proxy.
  • Enterprise: adds intrusion prevention through zonal firewall endpoints, URL filtering and TLS inspection, using security profile groups referenced by apply_security_profile_group rules. Use it for internet-facing and regulated tiers; endpoints are zonal, so plan one per zone in use.

Small organisations can run one Shared VPC host with a global network policy and Essentials rules; large estates should put organisation-wide denies in a hierarchical policy, delegate with goto_next to folder policies per business unit, and keep application rules in network policies.

Egress design

The implied egress rule allows everything, and Google Cloud blocks only a few flows regardless of rules (for example TCP port 25 to external addresses). An outbound deny posture has to be built deliberately.

  1. Remove external IPs: with vmExternalIpAccess enforced, VMs can only reach the internet through Cloud NAT, and restrictCloudNATUsage limits which subnets get NAT at all.
  2. Add a low-priority egress deny: a network policy rule denying 0.0.0.0/0 egress for all instances, then higher-priority allows for the Private Google Access VIP, 34.126.0.0/18, internal ranges and named dependencies.
  3. Use FQDN objects (Standard tier): allow egress to package mirrors, partner APIs and update services by domain name instead of chasing changing IP ranges.
  4. Block known bad destinations: Google Threat Intelligence lists in egress rules stop traffic to known malicious ranges before it reaches NAT.
  5. Inspect what remains: send internet egress from regulated tiers through apply_security_profile_group rules to Enterprise firewall endpoints.

Test each egress change with firewall rules logging enabled on the deny rule, since denied outbound attempts also appear in VPC Flow Logs (egress is sampled before firewall evaluation). This gives a quick list of dependencies the allow rules missed.

Framework mapping

Control areaNIST SP 800-53 Rev. 5NIST CSF 2.0CIS Controls v8.1ISO/IEC 27001:2022
Hierarchical denies, segmentation by secure tagSC-7, SC-7(5), AC-4PR.IR-0112A.8.22
Admin role separation, Shared VPC delegationAC-6PR.AA-056A.8.2
Org policy constraints, default network removalCM-6, CM-7PR.PS-014A.8.9
IAP for SSH and RDPAC-17PR.AA-0512A.8.20
Flow logs, firewall logs, NGFW IPSAU-12, SI-4DE.CM-0113A.8.16

Rollout

  1. Inventory and log: list every network, rule, policy and association; enable firewall rules logging on broad allow rules and VPC Flow Logs for two weeks.
  2. Guardrails in dry run: apply the organisation policy constraints above in dry-run mode, fix violations, then enforce.
  3. Organisation denies: add a hierarchical policy that denies 0.0.0.0/0 to 22 and 3389 except 35.235.240.0/20, with goto_next for everything else. Test on a sandbox folder first.
  4. Migrate rules: recreate VPC firewall rules as global network policy rules targeting secure tags or service accounts. Switch the network to BEFORE_CLASSIC_FIREWALL, confirm hits move to the new rules, then delete classic rules.
  5. Private access: enable Private Google Access with restricted.googleapis.com on sensitive subnets, remove external IPs, add Cloud NAT only where internet egress is needed.
  6. Roll back: keep policies in Terraform; rollback is reapplying the previous state, or detaching a hierarchical policy association, which takes effect without editing project rules.

Common misconfigurations

  • Default network left in place: default-allow-ssh and default-allow-rdp expose every VM with an external IP to the internet.
  • Network tags as security boundaries: a developer with instance edit rights adds the tag a database rule trusts, and gains access without any IAM review.
  • Project-level Network User: service projects can deploy into every shared subnet, including those meant for other trust zones.
  • Folder policy that allows instead of delegating: a broad allow in a hierarchical policy stops evaluation, so stricter project rules never run. Use goto_next for anything the folder should not decide.
  • Private Google Access with broken DNS or routes: replacing the default route without adding a route for 199.36.153.4/30, or mixing private and restricted VIPs, causes failures that teams "fix" by adding external IPs.
  • Relying on the network to protect API credentials: a leaked service account key works from any internet host against the default API domains, whatever the firewall says. Perimeters and keyless authentication are the fix, not firewall rules.

Practitioner checklist

  • skipDefaultNetworkCreation is enforced and no project still has a default network.
  • An organisation hierarchical policy denies internet ingress to admin ports, allowing only the IAP range.
  • Allow rules target service accounts or secure tags; network-tag rules are on a migration list.
  • compute.securityAdmin and Shared VPC Admin are held by small groups; compute.networkUser is granted per subnet.
  • vmExternalIpAccess, restrictVpcPeering, restrictSharedVpcSubnetworks and vmCanIpForward constraints are enforced.
  • Sensitive subnets use Private Google Access with restricted.googleapis.com inside a VPC Service Controls perimeter.
  • VPC Flow Logs and firewall logging on key rules are exported to the SIEM with retention beyond 30 days.
  • Alerts exist for firewall, policy association, route and peering changes in Admin Activity logs.
  • The Cloud NGFW tier is chosen per tier of workload, with IPS endpoints in every zone that hosts internet-facing workloads.

Standards and references

Related NHI Mgmt Group resources: Google Cloud Security Guide · Cloud Network Security Guide · Google Cloud Enterprise Foundations Blueprint Guide · VPC Service Controls Guide · GKE Security Hardening Guide

PDF for subscribers

Take this guide with you

Every section, table and checklist in one PDF, with links to the sources and related guides. Subscribe to our weekly NHI & AI Identity Journal and we’ll email you a download link.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

NHIMG Editorial Note
Researched and written by the NHI Mgmt Group editorial team using AI tools, under the editorial direction of Lalit Choda. Facts are drawn from the sources listed on this page and checked by our automated quality process. Last updated 8 November 2026. Spotted an error? Use our contact page.
NHI Mgmt Group, the independent authority on Non-Human Identity, IAM and Agentic AI security. nhimg.org

PDF Downloads for Newsletter Subscribers

Get the guide

Enter your details and we’ll email you a download link.

The full guide is free to read online. The PDF is a thank you for subscribing.

Fill in all fields marked * and tick the PDF box to continue.