D9Defect 11 of 17, in the order they close

Egress is completely unrestricted

No egress rules exist, so the implied allow at 65535 governs everything.

Severity
high
Closes in
phase 5, Egress and load balancer
Closed by
FQDN objects and a deny-all egress rule
  • Your VPC
  • Run by Google
  • Firewall and access rules
  • Allowed traffic
  • Where it breaks
harbour-apicalls api.paygate.example :443a compromised VMsends toexfil.attacker.exampleegress rules, by priority1000 · allow named FQDNsdoes not exist65000 · deny all egressdoes not exist65535 · implied allowto 0.0.0.0/0decides everythingD9the internetPayGateapi.paygate.exampleexfil.attacker.examplereceives the data

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

As foundNo egress rules. Implied allow to 0.0.0.0/0 at priority 65535 decides everything.

Wide by design - scroll it sideways.

Notes

open one at a time

1.

What it can cause

A compromised container or VM can send data to any host on the internet, and nothing blocks or records it.
  • A compromised container or VM can send data to any host on the internet, and nothing blocks or records it.
  • Malware can fetch its next stage and call home without a single rule in the way.
  • Nobody has a list of what Harbour talks to, so normal traffic and data leaving the building look the same.
2.

Why it is wrong

The implied allow-egress at 65535 governs everything until you write a deny. FQDN objects are how you allow named destinations without maintaining IP lists.

A compromised container can reach any host on the internet. The shape of the fix is deny-all plus a short list of named destinations, not an IP list you maintain by hand.

The idea

The implied allow-egress at 65535 governs everything until you write a deny. FQDN objects are how you allow named destinations without maintaining IP lists.

3.

How you would find it

gcloud compute firewall-rules list --filter="direction=EGRESS"
detect
# an empty result IS the findinggcloud compute firewall-rules list --filter="direction=EGRESS"gcloud compute network-firewall-policies list --global
4.

The change that closes it

deny EGRESS 0.0.0.0/0 at 65000, plus allow rules for named FQDNs at 1000.
As found
No egress rules. Implied allow to 0.0.0.0/0 at priority 65535 decides everything.
Fixed
deny EGRESS 0.0.0.0/0 at 65000, plus allow rules for named FQDNs at 1000.
fix
gcloud compute network-firewall-policies rules create 1000 \  --firewall-policy=harbour-egress --direction=EGRESS --action=allow \  --dest-fqdns=api.paygate.example,api.billing.example --layer4-configs=tcp:443 gcloud compute network-firewall-policies rules create 65000 \  --firewall-policy=harbour-egress --direction=EGRESS --action=deny \  --dest-ip-ranges=0.0.0.0/0 --layer4-configs=all
5.

When to fix it

Phase 5, Egress and load balancer

Phase 5, Egress and load balancer, together with D7, D14, D13 and D15. The egress deny needs every external destination enumerated first, which you only know once the NAT path is proven.

Cannot start until

Nothing. It can start as soon as its phase does.

Unblocks

  • D1One allow rule opens everything · phase 6