SHEET 03blog/waf-blocked-our-own-crawler/ REVISED 

Our firewall blocked WhatsApp previews, Lighthouse and our own crawler

AWS WAF Bot Control's default rules blocked link previews, PageSpeed and our own audit engine, so zaher.ai scored 0 in its own product. How we found and fixed it.

Published
Length
4 min read

For a while, every WhatsApp, Slack and Discord link preview of zaher.ai came out blank. Lighthouse and PageSpeed couldn’t load the site. And when our own audit engine checked zaher.ai, it got blocked too, so our site scored 0 in our own product. The cause was the same in every case: the firewall in front of the site, running AWS’s managed bot rules with their default settings.

How it showed up

Nothing alerted. A real visitor in a browser saw the site fine, so from the inside everything looked healthy. The failures showed up in places that are easy to ignore: a link shared in a chat with no preview card, a PageSpeed run that failed, an audit of our own domain with zeros across the board.

The last one hurt the most. Zaher.AI sells audits of how visible a site is to search engines and AI. A 0 for our own domain meant either the product was broken or the site was unreachable to machines. It was the second.

How we found it

zaher.ai sits behind AWS WAF on a load balancer. A 403 response with Server: awselb/2.0 comes from that WAF, not from the app.

The AWS console offers sampled requests, and for our low-volume test traffic they returned nothing. The full WAF logs in CloudWatch had everything. This Logs Insights query counts blocks by the rule that stopped them:

filter action = "BLOCK"
| stats count(*) by terminatingRuleId, ruleGroupList.0.terminatingRule.ruleId

For Bot Control the specific rule was nested deeper in the log entry, at ruleGroupList.2.terminatingRule.ruleId in our case. Expect a few minutes of delay before new requests show up in the logs.

What it was blocking

Bot Control sorts bots into categories, and its category rules default to Block. Over one week:

Bot Control category What it blocked Blocks in 7 days
Social media Every WhatsApp, Slack and Discord link preview 442
HTTP library HTTP client libraries, including our own audit engine 523
Content fetcher Lighthouse and PageSpeed not recorded
Scraping framework The bots you’d actually want blocked 3

So the category aimed at genuinely hostile scrapers caught 3 requests in a week, while two of the other categories blocked 965 requests, including every link preview and our own audits.

It also blocked our payment provider’s webhooks, the server-to-server calls that confirm a payment.

AI crawlers were never the problem

This surprised me. Bot Control’s AI and search engine categories were already set to allow, and robots.txt and llms.txt allowed AI crawlers as well. The block wasn’t there.

The logs looked alarming at first: about 3,500 of roughly 11,000 requests with AI-crawler user agents over 14 days had been blocked. When I checked, every blocked request claiming to be OpenAI’s crawler came from two scanner IPs outside OpenAI’s published IP ranges, probing for credential and config files. The same IPs also pretended to be Claude, Perplexity and Google crawlers. Real ChatGPT traffic, checked against the IP list OpenAI publishes, was allowed and was reading the home page, pricing and blog posts.

A user agent string is just text anyone can send. Verify crawlers by IP range, never by user agent alone.

The fix

We changed the categories we wanted from Block to Allow: social media, HTTP library, content fetcher, SEO, archiver, link checker and monitoring. That brought back the previews, PageSpeed and our own audits.

Allowing the SEO category didn’t help the SEO crawlers, though. AhrefsBot, MJ12bot and rogerbot were still blocked. The reason was rule order. Their user agents match a “bad bots” rule in AWS’s Common rule set, and that rule set runs before Bot Control. A request blocked there never reaches Bot Control, so an allow rule in Bot Control can’t save it.

The fix for that was a separate, narrow allow rule placed before the Common rule set. Be careful with these. An Allow in AWS WAF ends evaluation, so every rule after it is skipped for matching requests. Keep the rule as tight as you can, and back it with verified IP sets before you widen it. We kept the “bad bots” rule itself on, because 129 of about 161 blocks it made in a week were known scanning tools.

What was actually holding back AI visibility

With the firewall fixed, the audit found the real problem, and it was on the site. Only 3 of 68 routes served their main content in the HTML. On the rest, a crawler that doesn’t run JavaScript saw a heading and one sentence. That’s the issue I wrote about in why ChatGPT can’t read your website, and it was ours too.

What to check on your own site

  • Paste one of your links into WhatsApp or Slack. If no preview appears, something is blocking the preview bot.
  • Run PageSpeed Insights. If it can’t load the page and a browser can, look at your firewall or CDN bot settings.
  • If you use a managed bot rule set, list every category and its action. Don’t assume the defaults match what you want.
  • Read the full firewall logs grouped by terminating rule, not sampled requests.
  • Check rule order. An allow rule can’t help a request that an earlier rule already blocked.
  • Before you panic about blocked AI crawlers, check the IPs against the vendors’ published ranges.

The AI visibility checker tests what AI crawlers get from a URL, including blocks in robots.txt. A firewall can treat its requests differently from the real bots, so use your firewall logs to confirm.

Questions

Does AWS WAF Bot Control block AI crawlers by default?

In our setup the AI and search engine categories were already set to allow. What blocked traffic were other categories set to block by default, including social media preview bots, content fetchers like Lighthouse, and HTTP libraries.

How do I see which WAF rule is blocking a request?

Query the full WAF logs and group blocked requests by terminating rule. For managed rule groups like Bot Control, the specific rule is nested inside the rule group fields of the log entry.

About the author

Software engineer and serial founder in Alexandria, Egypt, and CTO at Zaher.AI, a GEO and SEO agency serving MENA.

Console

Type help and press Enter.