Securing communications and establishing boundary protection · Topic 1 of 4

Cloud NGFW, IAP, Load Balancers and Certificate Authority Service

Configure Cloud NGFW policies and layer 7 inspection, IAP for apps and SSH, load balancer TLS, private CAs and private versus public IP addresses.

  • 6 min
In a nutshell
  • Hierarchical policies first, then network policies and VPC rules, then implied deny ingress and allow egress.
  • Target firewall rules with service accounts or secure tags, not network tags.
  • Cloud NGFW Enterprise adds intrusion prevention through firewall endpoints and security profiles.

What it is

The network perimeter on Google Cloud is not one box at the edge. It is a set of controls: Cloud Next Generation Firewall (Cloud NGFW) rules on every VM interface, load balancers that terminate TLS at Google's edge, Identity-Aware Proxy (IAP) that checks identity before traffic reaches an app, and Certificate Authority Service for your own certificates.

InternetLoad balancerTLS, Cloud ArmorIAPidentity and contextCloud NGFWfirewall policiesBackend VMsprivate IPs only

How it works

Cloud NGFW tiers

TierAdds
EssentialsVPC firewall rules, hierarchical and network firewall policies, address groups, secure tags and service accounts as targets
StandardFQDN objects, geolocation objects and Google Threat Intelligence lists in rules
EnterpriseIntrusion prevention (layer 7 inspection) with firewall endpoints, security profiles and TLS inspection

Firewall rules and policies

Policy typeAttached toUse
Hierarchical firewall policyOrganization or folderGuardrails every VPC inherits, such as blocking known bad ranges
Global network firewall policyA VPC networkThe main rule set for a network, across regions
Regional network firewall policyA VPC network in one regionRegion-specific rules
VPC firewall rulesA VPC networkOlder per-network rules, still supported

Hierarchical policies are evaluated first, organization then folder, and their rules can allow, deny or goto_next to pass the decision down. Then the network's VPC firewall rules and network firewall policies are evaluated, and finally the implied rules: deny all ingress, allow all egress. Lower priority numbers win within a policy.

Target VMs by service account or secure tags, not network tags. Network tags can be changed by anyone who can edit the instance; secure tags are controlled with IAM.

gcloud compute network-firewall-policies rules create 1000 \
  --firewall-policy=prod-policy --global-firewall-policy \
  --direction=INGRESS --action=allow \
  --src-ip-ranges=35.235.240.0/20 --layer4-configs=tcp:22 \
  --enable-logging

Layer 7 inspection with Cloud NGFW Enterprise

Cloud NGFW Enterprise inspects packets for exploits, malware and command-and-control traffic. You create a firewall endpoint in a zone, associate it with the VPC network, create a security profile (threat prevention) inside a security profile group, and use a rule with the action apply_security_profile_group.

Matched traffic is sent to the endpoint and blocked or alerted on according to the profile. For encrypted traffic, TLS inspection with a CA from Certificate Authority Service lets the endpoint see inside the session.

Identity-Aware Proxy

IAP checks who the user is and, with access levels, from where, before any request reaches the app.

IAP useHowRole needed
Web apps behind an external or internal Application Load Balancer, App Engine or Cloud RunEnable IAP on the backend serviceIAP-secured Web App User (roles/iap.httpsResourceAccessor)
SSH and RDP to VMs without external IPsTCP forwarding; allow ingress from 35.235.240.0/20IAP-secured Tunnel User (roles/iap.tunnelResourceAccessor)

The backend should verify the signed header x-goog-iap-jwt-assertion, so requests that bypass IAP are rejected.

Load balancers

External Application Load Balancers terminate TLS at Google's edge, absorb many layer 3 and 4 attacks, and are where Cloud Armor attaches. Use SSL policies to set the minimum TLS version and a profile (COMPATIBLE, MODERN, RESTRICTED or CUSTOM), and Google-managed certificates through Certificate Manager. Backends then need only private IPs.

Certificate Authority Service

CA Service runs private certificate authorities that you control, organised in CA pools with root and subordinate CAs. Keys can be protected by Cloud HSM.

TierFits
EnterpriseLong-lived certificates and full revocation tracking, such as device or server identity
DevOpsHigh volumes of short-lived certificates where revocation is not tracked, such as service mesh workloads

Use it for mTLS between services, internal load balancer certificates and TLS inspection by Cloud NGFW and Secure Web Proxy.

Private and public IP addressing

AddressReachable fromSecurity note
Internal (RFC 1918 or other private ranges)Your VPC, peered or connected networksThe default for workloads
External ephemeral or staticThe internetRestrict with compute.vmExternalIpAccess and firewall rules
Privately used public IP (PUPI)Only inside your VPCNot routed to the internet by Google

Keep VMs on internal addresses, put public entry points on load balancers, and reach the internet outbound through Cloud NAT.

A worked example

A web app runs on VMs with external IPs and SSH open to the world. The engineer removes the external IPs and adds an external Application Load Balancer with a RESTRICTED SSL policy and IAP. SSH is allowed only from the IAP range for the admin group.

A hierarchical policy on the organization denies inbound traffic from Threat Intelligence lists. Cloud NGFW Enterprise inspects east-west traffic in the production VPC.

UsersLoad balancerRESTRICTED SSL policyIAPemployees onlyVMsno external IPAdminsIAP TCP forwarding35.235.240.0/20VMsport 22

How the exam asks about this

  • "Administrators need SSH to VMs that have no external IP addresses, without a bastion host." IAP TCP forwarding with a firewall rule allowing 35.235.240.0/20 and the IAP-secured Tunnel User role.
  • "Block known malicious traffic to every VPC in the organization, and project teams must not override it." A hierarchical firewall policy on the organization with deny rules.
  • "Detect and block exploit attempts in traffic between VMs." Cloud NGFW Enterprise with a firewall endpoint and a threat prevention security profile.

What to remember for the exam

  • Hierarchical policies first, then network policies and VPC rules, then implied deny ingress and allow egress.
  • Target firewall rules with service accounts or secure tags, not network tags.
  • Cloud NGFW Enterprise adds intrusion prevention through firewall endpoints and security profiles.
  • IAP gives identity-checked access to web apps and to SSH or RDP without external IPs.
  • CA Service runs private CAs: Enterprise tier for revocation, DevOps tier for short-lived volume.
Watch out

IAP protects only traffic that goes through it. Firewall rules must stop clients from reaching the backend directly, and the app should verify the IAP JWT header.

Common mistakes

Relying on network tags for security. Anyone with instance edit rights can add a tag and gain the rule. Use service accounts or IAM-controlled secure tags.

Opening port 22 to 0.0.0.0/0 for admins. Use IAP TCP forwarding and allow only the IAP range.

Expecting VPC firewall rules to inspect payloads. Basic rules match addresses, ports and protocols. Payload inspection needs Cloud NGFW Enterprise.

Check yourself

  • Which IP range must a firewall rule allow for IAP TCP forwarding?

    35.235.240.0/20, the range IAP uses to reach VMs.

  • What does the goto_next action do in a hierarchical firewall policy?

    It passes evaluation to the next level, such as a lower folder policy or the network's own rules.

  • Which Cloud NGFW tier provides intrusion prevention, and what must you deploy for it?

    Cloud NGFW Enterprise, with a zonal firewall endpoint associated to the VPC and a security profile group used by a firewall rule.

Topic 1 of 4 in Securing communications and establishing boundary protection

Test yourself on Securing communications and establishing boundary protection

The full Google Cloud Professional Cloud Security Engineer question bank has 749 questions, with timed practice exams and an explanation for every answer.

This study guide is independent and is not affiliated with, endorsed by, or sponsored by Google Cloud. Vendor names, certification names and exam codes are trademarks of their respective owners and are used for identification only.