D14Defect 12 of 17, in the order they close

No Cloud Armor on the legacy backend service

harbour-waf is attached to api-backend-service and nowhere else.

Severity
high
Closes in
phase 5, Egress and load balancer
Closed by
Per-backend-service WAF policies
  • Your VPC
  • Run by Google
  • Firewall and access rules
  • Allowed traffic
  • Where it breaks
Requests/api/* and/legacy/*External ALBURL map/api/* → api/legacy/* → legacyharbour-wafCloud Armoron api-backendharbour-apiCloud Runno Cloud Armorno securityPolicyon legacy-backendD14legacy-apiMIG · 3 VMsthe same attack reaches legacy-api unfiltered

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

As foundlegacy-backend-service has no securityPolicy field set.

Wide by design - scroll it sideways.

Notes

open one at a time

1.

What it can cause

Requests the URL map sends to legacy-api get none of the WAF rules the API path has.
  • Requests the URL map sends to legacy-api get none of the WAF rules the API path has.
  • An attacker only has to find one path that reaches the legacy backend.
  • The load balancer looks protected, which is exactly why nobody checks.
2.

Why it is wrong

Cloud Armor attaches to the backend service, several links down the chain - not to the load balancer. Coverage can differ between two paths on the same LB.

Cloud Armor attaches to the backend service, several links down the chain, not to the load balancer. So one path is protected and the other is not, and nothing about the load balancer’s configuration makes that visible. Same outcome as the run.app bypass, opposite cause: there the WAF is walked around, here it was never attached.

The idea

Cloud Armor attaches to the backend service, several links down the chain - not to the load balancer. Coverage can differ between two paths on the same LB.

Learn it

3.

How you would find it

gcloud compute backend-services list --format="table(name,region,protocol,securityPolicy)"
detect
gcloud compute backend-services list \  --format="table(name,region,protocol,securityPolicy)"
4.

The change that closes it

harbour-waf attached, so both paths get the same rule set.
As found
legacy-backend-service has no securityPolicy field set.
Fixed
harbour-waf attached, so both paths get the same rule set.
fix
gcloud compute backend-services update legacy-backend-service \  --region=asia-southeast1 --security-policy=harbour-waf # audit every backend service at oncegcloud compute backend-services list \  --format="table(name,region,securityPolicy)"
5.

When to fix it

Phase 5, Egress and load balancer - after D12

Phase 5, Egress and load balancer, together with D7, D9, 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

  • D12No proxy-only subnet · phase 1

Unblocks

Nothing waits on it.