WAF rule blocks one Google Cloud subnet even if it is allowed

Hello everyone,

I just discovered the (free) Cloudflare services that I want to use ‘in front of’ my website, a Home Assistant installation.

I’m trying to get the Google Cloud/Assistant IP ranges to be accepted by an allow rule in the WAF, but for some reason, a specific range is blocked (by my second rule, a geoip rule allowing only my country The Netherlands). Other Google IP ranges pass my Google Cloud rule and pass the country rule without problems.

The first rule, the Google allow rule, is:

(ip.src in { ****} and ip.geoip.asnum eq 15169 and http.host eq "my.homeassistant.domain" and http.request.uri.path eq "/api/google_assistant") or (http.request.uri.path eq "/auth/token")

My second, the all-other-countries-blocked-except-NL, is:

(not ip.geoip.country in {"NL"} and http.host eq "my.homeassistant.domain")

My problem is, that when Google Assistant uses an IP in the 66.249.81.* range, that is does not match the first rule, and is blocked by the second rule, eventhough 66.249.81.* is part of the subnet in the first rule.

Only difference I can find is that the rande 66.249.81.* is listed as

Country: Unknown states, other entities or organizations

and all other Google Cloud IPs have a country.

Can someone please advise me?
Thank you :slight_smile:

I added ** ** in the first rule to highlight the specific subnet, it is not really there in the rule itself :wink:

The Firewall Events Activity Log should show you which rule is allow/blocking that IP address. If it triggers the first rule, it shouldn’t trigger the second rule.

The second rule, the country blocking rule, blocks that specific range, because it isn’t The Nehterlands. The other Google IPs, which aren’t originating from NL either, are not being blocked by the second rule and are allowed by the first rule…

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.