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.
Learn it
- Matching objects: names instead of IP lists · GCP 5.2
- Implied rules and priority · GCP 5.1
3.How you would find it
gcloud compute firewall-rules list --filter="direction=EGRESS"
# an empty result IS the findinggcloud compute firewall-rules list --filter="direction=EGRESS"gcloud compute network-firewall-policies list --global4.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.
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=all5.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