Blocking websites if not North America or Europe

I am trying to recall what the rule should be, specifically whether it’s an AND or OR in the WAF configuration. It seems if I do country does not equal North America OR country does not equal Europe, the site goes down and I get a block. If I do an AND then the rule doesn’t match. Am I doing something wrong?

To recap, I am setting WAF rules to block site traffic from continents that aren North America or Europe.

Doing any kind of logic operators with NOT and OR is error prone, and I try to avoid them.

You are using this at the moment:
(ip.geoip.continent ne "NA") or (ip.geoip.continent ne "EU")

No matter what the input is to this the overall expression will be true. (If you are in NA you will not be in Europe and vice versa)

I always find using the list comparison to be the easiest to use, and the logic in lists is much easier to understand.

(not ip.geoip.continent in {"NA" "EU"})

1 Like