Notes
open one at a time
1.What it can cause
The bastion can be found by anyone scanning Google's address ranges, and it is the one box with a route to everything else.
- The bastion can be found by anyone scanning Google's address ranges, and it is the one box with a route to everything else.
- A flaw in its SSH server or its OS is reachable straight from the internet.
2.Why it is wrong
An external IP is one of only two things that make a VM reachable from the internet. Removing it is the strongest single hardening step.
That is the entire reason a bastion exists, and IAP removes the reason. A VM with no external IP needs three things to keep working: IAP for inbound admin access, Private Google Access for Google APIs, and Cloud NAT for the internet. The bastion needs almost nothing outbound, so IAP alone makes its public address unnecessary - which is why this closes now while D3b waits.
The idea
An external IP is one of only two things that make a VM reachable from the internet. Removing it is the strongest single hardening step.
Learn it
3.How you would find it
gcloud compute instances list --filter="networkInterfaces[0].accessConfigs[0].natIP:*" --format="table(name,zone,networkInterfaces[0].accessConfigs[0].natIP)"
gcloud compute instances list \ --filter="networkInterfaces[0].accessConfigs[0].natIP:*" \ --format="table(name,zone,networkInterfaces[0].accessConfigs[0].natIP)"4.The change that closes it
No external IP. Access controlled by identity, through the IAP tunnel.
- As found
- External IP on the bastion. Access controlled by network position.
- Fixed
- No external IP. Access controlled by identity, through the IAP tunnel.
# only after the IAP rule is in place and verified (D2)gcloud compute instances delete-access-config bastion \ --access-config-name="External NAT" --zone=asia-southeast1-b # prove it still works with no public addressgcloud compute ssh bastion --zone=asia-southeast1-b --tunnel-through-iap