D3bDefect 9 of 17, in the order they close

legacy-api instances carry external IPs

Every VM in the MIG has its own public address.

Severity
medium
Closes in
phase 4, Private data path
Closed by
Cloud NAT + Private Google Access
  • Your VPC
  • Run by Google
  • Firewall and access rules
  • Allowed traffic
  • Where it breaks
outside GCPAnyoneknows an instance IPExternal ALB+ Cloud Armorthe way inharbour-vpc · sn-a-applegacy-api × 3each has a public IP34.87.x.1, .2, .3D3bCloud NATharbour-egress-1harbour-egress-2outside GCPPayGateallows twoaddressesaround the load balancerleaves as itself, from a different address each

Only what D3b touches. Red is the defect and what it lets through; switch to fixed to see the same parts with only D3b closed. Struck IDs are closed.

As foundEphemeral external IP per instance. Each egresses as itself, so Cloud NAT is ignored.

Wide by design - scroll it sideways.

Notes

open one at a time

1.

What it can cause

Each instance can be reached from the internet directly, around the load balancer and its WAF.
  • Each instance can be reached from the internet directly, around the load balancer and its WAF.
  • Outbound calls leave from a different address per instance, and the address changes when the instance is replaced, so partners who allow-list Harbour see sources they do not know.
  • Those addresses sit on the database's allow-list, which is part of why D5's list is so long.
2.

Why it is wrong

Removing an external IP has prerequisites in both directions - inbound admin access, and outbound to both Google APIs and the internet.

Unlike the bastion, these VMs need real outbound access to Google APIs and the internet. Removing the addresses therefore depends on PGA being on, a NAT existing in the region, and the database migration in D5 so the VM reaches Postgres privately rather than through its whitelisted public address. Sequenced work, not a quick win.

The idea

Removing an external IP has prerequisites in both directions - inbound admin access, and outbound to both Google APIs and the internet.

3.

How you would find it

gcloud compute instances list --filter="networkInterfaces[0].accessConfigs[0].natIP:*" --format="table(name,zone,tags.items.list())"
detect
gcloud compute instances list \  --filter="networkInterfaces[0].accessConfigs[0].natIP:*" \  --format="table(name,zone,tags.items.list())" # and check the prerequisites are in place firstgcloud compute routers nats list --router=rtr-a --region=asia-southeast1
4.

The change that closes it

No external IPs. All egress leaves through Cloud NAT’s two reserved addresses.
As found
Ephemeral external IP per instance. Each egresses as itself, so Cloud NAT is ignored.
Fixed
No external IPs. All egress leaves through Cloud NAT’s two reserved addresses.
fix
# 1. PGA first, or the VM loses Google API access the moment the IP goesgcloud compute networks subnets update sn-a-app \  --region=asia-southeast1 --enable-private-ip-google-access # 2. confirm a NAT exists in this regiongcloud compute routers nats describe harbour-nat \  --router=rtr-a --region=asia-southeast1 # 3. only then, and only after D5gcloud compute instances delete-access-config legacy-api-abc1 \  --access-config-name="External NAT" --zone=asia-southeast1-b
5.

When to fix it

Phase 4, Private data path - after D4, D5

Phase 4, Private data path, together with D5. Needs Private Google Access from phase 1, and the external IPs cannot come off until the database is reachable privately.

Cannot start until

  • D4Private Google Access is off on the data subnet · phase 1
  • D5Cloud SQL is on a public IP · phase 4

Unblocks

Nothing waits on it.