D3aDefect 4 of 17, in the order they close

Bastion carries an external IP

The bastion has a public address so that someone can SSH to it.

Severity
medium
Closes in
phase 2, Secure access
Closed by
IAP TCP forwarding
  • Your VPC
  • Run by Google
  • Firewall and access rules
  • Allowed traffic
  • Where it breaks
outside GCPAnyonescanning for SSHEngineerSSH to thepublic addressIAP TCP forwarding35.235.240.0/20checks who you areharbour-vpcbastionexternal IP 34.124.10.7a route to everything insideD3aeverything elserabbitmq-1, legacy-apievery VM the bastion reachesanyone can find it and knock

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

As foundExternal IP on the bastion. Access controlled by network position.

Wide by design - scroll it sideways.

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.

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)"
detect
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.
fix
# 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
5.

When to fix it

Phase 2, Secure access - after D2

Phase 2, Secure access, together with D2 and D16. Depends on nothing, and everything after it is safer once administrative access no longer runs over a public SSH port.

Cannot start until

  • D2SSH open to the internet · phase 2

Unblocks

Nothing waits on it.