ДавайПоДелуИнструменты для вебмастеров, копирайтеров, рерайтеров, маркетологов. Заметки об интернет-маркетинге.

Настройки правил WAF в Сloudflare

Настройки правил Zone-level Web Application Firewall (WAF) для фильтрации ботов и спам трафика при помощи Сloudflare.

1. Skip white Bots 
User Agent, Referer
Action Skip

(http.user_agent contains "Mail.RU_Bot") or (http.user_agent contains "StackRambler") or (http.user_agent contains "+http://yandex.com/bots") or (http.user_agent contains "msnbot") or (http.user_agent contains "Googlebot") or (http.user_agent contains "+http://www.google.com/bot.html")">http://www.google.com/bot.html") or (http.user_agent contains "Googlebot-Image") or (http.user_agent contains "Googlebot-News") or (http.user_agent contains "Googlebot-Video") or (http.user_agent contains "Storebot-Google") or (http.user_agent contains "Google-InspectionTool") or (http.user_agent contains "GoogleOther") or (http.user_agent contains "Google-Extended") or (http.referer contains "toloka") or (http.user_agent contains "toloka") or (http.user_agent contains "YandexDirect") or (http.user_agent contains "AdsBot-Google") or (http.user_agent contains "APIs-Google") or (http.user_agent contains "+http://www.bing.com/bingbot.htm") or (http.user_agent contains "AdsBot-Google-Mobile") or (http.user_agent contains "APIs-Google") or (http.user_agent contains "FeedFetcher-Google") or (http.user_agent contains "Google-Extended") or (http.user_agent contains "Google-InspectionTool") or (http.user_agent contains "Google-Safety") or (http.user_agent contains "Google-Site-Verification") or (http.user_agent contains "google-speakr") or (http.user_agent contains "Googlebot") or (http.user_agent contains "Googlebot-Image") or (http.user_agent contains "Googlebot-News") or (http.user_agent contains "Googlebot-Video") or (http.user_agent contains "GoogleOther") or (http.user_agent contains "Mediapartners-Google") or (http.user_agent contains "Storebot-Google ") or (http.user_agent contains "+https://google.com") or (http.user_agent contains "+https://support.google.com") or (http.user_agent contains "+https://www.google.com") or (http.user_agent contains "+http://www.google.com/bot.html")

2. Stop countries traffic (FI, US, PL)
Country
JS Challenge

(ip.geoip.country in {"FI"}) or (ip.geoip.country in {"US"}) or (ip.geoip.country in {"PL"} and ip.geoip.country in {"SG"} and ip.geoip.country in {"PL"})

3. Not ssl and ipv6
IP Source Address, AS Num, SSL/HTTPS
JS Challenge

(ip.src in {::/0} and not ip.geoip.asnum in {13238}) or (not ssl and not ip.geoip.asnum in {13238})

4. No http2+
HTTP Version, IP Source Address, AS Num, Referer
JS Challenge

(not http.request.version in {"HTTP/2" "HTTP/3" "SPDY/3.1"} and not ip.src in {77.222.103.13} and not ip.geoip.asnum in {13238}) or (http.referer eq "" and not ip.src in {77.222.103.13} and not ip.geoip.asnum in {13238})<br>

5. Bad bots
User Agent, URI Path
JS Challenge

(http.user_agent contains "Abonti") or (http.user_agent contains "AspiegelBot") or (http.user_agent contains "aggregator") or (http.user_agent contains "Aport") or (http.user_agent contains "asterias") or (http.user_agent contains "Baiduspider") or (http.user_agent contains "hloader") or (http.user_agent contains "httplib") or (http.user_agent contains "HTTrack") or (http.user_agent contains "LinkpadBot") or (http.user_agent contains "lmspider") or (http.user_agent contains "LNSpiderguy") or (http.user_agent contains "ltx71") or (http.user_agent contains "lwp-trivial") or (http.user_agent contains "magpie") or (http.user_agent contains "Mata Hari") or (http.user_agent contains "MaxPointCrawler") or (http.request.uri.path contains "/wp-")