cloudflare-leaky-paths
Skill7 starsChanged 5 months agoMITView on GitHub
Generate and apply a Cloudflare WAF custom rule that blocks common scanner/leaky paths (.env, .git, wp-login, phpMyAdmin, backups, infra config) at the edge before they reach the origin. Use when the user wants to block scanner traffic, harden a Cloudflare zone, stop .env/.git probing, reduce bot/scanner load, or asks about "leaky paths" or WAF custom rules.
- Reads credentials
- Sends data out
In this repository6 other files it gives its agents.
- block-disposable-emailsSkill
- boil-the-oceanSkill
- input-anticipationSkill
- plan-optimizerSkill
- remark-mermaid-tldrawSkill
- write-like-a-humanSkill
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 1 is distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 102
Prefer Block over Managed Challenge for these — there's no legitimate reason to request /.env.
- Distinctive: line 105
Keep the list lean; chasing every CVE path is a losing game.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Cloudflare leaky-paths WAF rule
Block high-signal scanner paths at Cloudflare's edge so they never hit the
origin. Cuts log noise, origin load, and the risk of an exposed secret being
fetched. Inspired by the leaky-paths wordlist (github.com/ayoubfathi/leaky-paths).
When to use
- "Block scanners / bots at the edge"
- "Stop .env / .git probing"
- "Harden my Cloudflare zone / add a WAF rule"
- "These scanner hits are spamming my logs"
The rule
Build a single Cloudflare custom-rule expression by OR-ing the path groups
the user wants. Each clause is (http.request.uri.path contains "<path>").
Path groups
Dotfiles & secrets
/.env /.git /.svn /.aws /.ssh /.config /.DS_Store /.htaccess /.htpasswd
WordPress
/wp-login /wp-admin /wp-includes /wp-content /xmlrpc
Admin & DB tools
/phpmyadmin /adminer /server-status /server-info
Backups & dumps
/backup /backup.zip /dump.sql /db.sql /database.sql
Infra & CI config
/docker-compose.yml /.dockerenv /.terraform /.github /.vscode /.idea
Only include WordPress / admin groups if the site actually has none of those — otherwise you may block legitimate
/wp-adminlogins. Confirm the stack first.
Example expression
(http.request.uri.path contains "/.env")
or (http.request.uri.path contains "/.git")
or (http.request.uri.path contains "/.aws")
or (http.request.uri.path contains "/wp-login")
or (http.request.uri.path contains "/phpmyadmin")
or (http.request.uri.path contains "/xmlrpc")How to apply
Option A — Dashboard (fastest)
- Cloudflare dashboard → your zone → Security → WAF → Custom rules.
- Create rule, name it
block-leaky-paths. - Switch the expression editor to Edit expression and paste the expression.
- Action: Block. Deploy.
Option B — API
curl -X POST \
"https://api.cloudflare.com/client/v4/zones/$ZONE_ID/firewall/rules" \
-H "Authorization: Bearer $CF_API_TOKEN" \
-H "Content-Type: application/json" \
-d '[{
"filter": { "expression": "<EXPRESSION>" },
"action": "block",
"description": "block-leaky-paths"
}]'Option C — Terraform
resource "cloudflare_ruleset" "block_leaky_paths" {
zone_id = var.zone_id
name = "block-leaky-paths"
kind = "zone"
phase = "http_request_firewall_custom"
rules {
action = "block"
expression = "<EXPRESSION>"
description = "Block scanner/leaky paths at the edge"
enabled = true
}
}Verify
curl -s -o /dev/null -w "%{http_code}\n" https://example.com/.env # expect 403
curl -s -o /dev/null -w "%{http_code}\n" https://example.com/ # expect 200Notes
- Prefer Block over Managed Challenge for these — there's no legitimate
reason to request
/.env. containsmatches anywhere in the path, so/foo/.git/configis caught too.- Keep the list lean; chasing every CVE path is a losing game. These are the high-signal "quick win" endpoints scanners hit first.
Credit: trick popularized by @vikingmute; paths distilled from
ayoubfathi/leaky-paths.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

