WAF Country block not working

What is the name of the domain?

flmluxuryrent.eu

What is the issue you’re encountering

Hi everyone, I’m new to Cloudflare and I’m experiencing spam issues on my site from different countries around the world. I activated cloudflare to be able to activate the WAF firewall to block these countries via geolocation. First I associated my domain and activated DNS on cloudlfare. Once this was done I activated the firewall with the rule you see in the attachment. But after these steps I continue to receive entries from these countries, the activity count in the last 24 hours of the rule has still been at zero for days. Can you tell me if I did something wrong or if there is some other additional configuration to do to make the block actually active? Thank you very much in advance for your support Giorgio

What is the current SSL/TLS setting?

Full (strict)

Screenshot of the error

If not, double-check and make sure DNS records are set to :orange: proxied to make sure WAF Custom Rules would apply, among other Cloudflare features for your domain.

From the shared screenshot above, I am afraid you’re using a wrong operator AND between each of your criteria.

You should consider using OR operator to make it work as expected and block all the requests coming to your domain from those countries.

Otherwise, you can use “is in” operator as follows:

Expression:

(ip.geoip.country in {"BD" "PK" "EG" "DZ" "MA" "NP" "OM" "LK" "TN" "ZW" "JP"})

In picture:

Otherwise, using your way just with OR operator:

Expression:

(ip.geoip.country eq "DZ") or (ip.geoip.country eq "BD") or (ip.geoip.country eq "EG") or (ip.geoip.country eq "JP") or (ip.geoip.country eq "MA") or (ip.geoip.country eq "NP") or (ip.geoip.country eq "OM") or (ip.geoip.country eq "PK") or (ip.geoip.country eq "LK") or (ip.geoip.country eq "TN") or (ip.geoip.country eq "ZW")

In picture:

Helpful article:

Hi fritex, thank you very much for your reply. Now it works perfectly.

Best regards

1 Like

I am happy to assist you :hugs:

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