Our site is static. There is no PHP, no WordPress, no login and no database behind it. Scanners don't care. They walk the whole internet with the same list of paths and see what answers. A site in a top-million list like Tranco or the Chrome UX Report gets tens or hundreds of thousands of these a month.
What scanners ask for
Almost half of the requests were for .php files. About one in eight went after secrets: .env files, credentials, cloud keys. The rest was WordPress admin pages, config files, .git folders and /api/ endpoints.
They are also fast. One address sent 233 requests in 10 seconds. A small server answering that many 404s gets slower for everyone else on it. Our rate limit of 30 requests per 10 seconds fired over 4,600 times this month.
Idea one: block what you don't run
You know your own stack. Anything outside it is a probe. We have no PHP, so every .php request gets a challenge. Same for WordPress paths, .git and /api/:
(http.request.uri.path wildcard r"/*.php*")
or (http.request.uri.path contains "/wp-")
or (http.request.uri.path contains "/.git/")
or (http.request.uri.path contains "/api/")This broke something of ours on day one. contains matches anywhere in the path, and one of our own tools served its backend under /api/. Every request to it got a challenge page instead of JSON. We moved it to a path the rules don't match. Before you enable a rule like this, check it against every URL you actually serve.
We keep ours split into a few smaller rules, so each kind of probe shows up on its own in the security analytics. One rule does the same job.
Idea two: block who is scanning
Path rules only catch what you thought to list. The addresses doing the scanning are a better target, and most of them have already been reported somewhere.
BlockList.de publishes the IPs that attacked its members' servers in the last 48 hours. We replayed about 700,000 of our own requests, a month of traffic, against several public blocklists and compared what each one caught with the real visitors it would have hit. Two BlockList.de lists won together: strongips and apache.
On their own they cut scan traffic by about 30%, and by over 60% on bad days, when scanners reuse addresses that were reported days earlier. The rule runs before the path rules. In its first three days, 40% of everything we stopped came from an address already on the list.
A blocklist goes stale within hours, so a Worker on a cron trigger rewrites ours every 15 minutes:
const SOURCES = [
{ name: "strongips", url: "https://lists.blocklist.de/lists/strongips.txt" },
{ name: "apache", url: "https://lists.blocklist.de/lists/apache.txt" },
];
const MAX_ITEMS = 10000;
const MIN_ITEMS = 100;While we were on the free tier, a custom IP list held 10,000 entries, and the two lists together sit just under that. The Worker trims anything past the cap and refuses to write fewer than 100 entries, so a failed download never empties the list.
The rule:
(ip.src in $blacklist and not http.request.uri.path contains "/data/")The /data/ exception is on purpose. Our data feeds are free for anyone, so a listed address can still download them. Everything else gets a challenge.
Challenge or block?
Our path and IP rules answer with a Managed Challenge, not a block. That was a bet: a challenge page looks like a real, protected site, and we hoped scanners would stop there and spend their time trying to get through.
They don't try. Of about 4,300 challenges in our logs, 5 were ever solved. 4 were us, testing our own rules. The fifth was someone in Indonesia, typing /wp-login.php into their browser by hand. Scanners don't run JavaScript, so they never see the page as anything but an error and move on. In practice a challenge and a block cost them the same. We kept the challenge anyway. A real person who trips a rule can solve it and carry on.
What still gets through
About 1,400 scans a month reach us as plain 404s. They ask for files no rule names yet: appsettings.json, .npmrc, Dockerfile, .pgpass, env.js. One even asked for .claude/settings.local.json. Path lists will always trail the scanners by a few weeks. The IP list is what closes that gap, because it doesn't need to know the path.
So check your 404s every few weeks. Any server log or analytics tool will do: filter on status 404 and sort by path. Anything near the top that you don't recognise is almost always a scanner. Add it to the path rule, and next month that 7% gets a little smaller.
Set it up on your site
The rules run best on Cloudflare. They run at the edge, so turning a scanner away costs your server nothing and costs you nothing. But nothing in them is Cloudflare-only. Any server that can answer with a cheap 403, from nginx to a static host's redirect rules, can run the same two checks.
Both rules take a few minutes by hand. Or skip that: give this page to your AI agent, and it can build the Worker, the list and both rules for you.
$ curl https://smet.cz/blog/block-vulnerability-scans-cloudflare/