Blocking Bad Bots
HEIMWALL assigns every request a bot score from 0 to 100: 0 means human, 100 means definite bot. The safe way to block bad bots is to watch the score distribution in monitor mode first, then move to enforcement gradually.
Know the scores and categories
Section titled “Know the scores and categories”- 0–49: likely human
- 50–69: ambiguous
- 70–89: suspicious
- 90–100: strong bot signal
The default threshold is 70. Verified bots (waf.client.bot == on) fall into 17 categories: search, seo, ai_crawler, ai_assistant, ai_search, advertising, social, monitoring, preview, feed, aggregator, archiver, security, accessibility, academic, webhook, other. Verified bots have a known identity (like Googlebot); the real threat is unverified bots hiding who they are.
Step by step: monitor, then enforce
Section titled “Step by step: monitor, then enforce”-
Under Console → WAF → [domain], open the Bot Score setting and set the mode to monitor. In this mode no request is blocked; scores are only recorded.
-
Watch the score distribution on the Analytics page for a few days. Heavy traffic in the 90–100 range means you are under bot pressure. Note which range your legitimate traffic clusters in.
-
Create the exemption rule first — Console → WAF → [domain] → Rules → New Rule:
# Allow search and monitoring botsIF waf.client.bot_category in search, monitoringTHEN allow -
Then add the block rule and drag it below the exemption:
# Block requests with a strong bot signalIF waf.bot_score ge 80THEN blockUsing
captchainstead ofblockis safer at first: real users who get misscored can pass the challenge. -
After a week, review the access logs and hit counters. If there are no false positives, you can lower the threshold (e.g.
ge 70) or switchcaptchatoblock. You can also set the Bot Score mode to enforce for centralized enforcement with js/captcha/block actions.
Additional recipes
Section titled “Additional recipes”# Challenge the ambiguous range with CAPTCHAIF waf.bot_score ge 50AND waf.bot_score lt 80THEN captcha
# Block traffic from Tor exit nodesIF waf.client.tor == onTHEN block
# Challenge suspicious traffic behind VPNsIF waf.client.vpn == onAND waf.bot_score ge 60THEN captchaOnly block VPN/Tor if your business model requires it; some legitimate users rely on VPNs for privacy.
Verification
Section titled “Verification”- On the Analytics page, check that blocked requests are increasing while legitimate traffic (e.g. conversions) is not dropping.
- Send a request with a simple bot signature like
curl -A "BadBot/1.0"and confirm you receive a challenge or block. - Verify in Google Search Console that crawl statistics remain normal.
- Review the hit counters on the Rules page weekly.