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.
Learn it
3.How you would find it
gcloud compute instances list --filter="networkInterfaces[0].accessConfigs[0].natIP:*" --format="table(name,zone,tags.items.list())"
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-southeast14.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.
# 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-b5.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.