Skip to content
Skills Library
Security · Automation

cloudflare-leaky-paths

/cloudflare-leaky-paths

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.

Repository
skills ↗
Licence
MIT
Last repository change
15.06.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
3
Deprecation

No signals detected. Repository changed on 15.06.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

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.

Triggers from the description

leaky paths
Original author description

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.

How it works

  1. When to use
  2. The rule
  3. How to apply
  4. Verify
  5. Notes
Original SKILL.md headings · 106 lines, 409 words
SKILL.md preview
---
name: cloudflare-leaky-paths
description: 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.
---

# 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-admin` logins. 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)
1. Cloudflare dashboard → your zone → **Security → WAF → Custom rules**.
2. **Create rule**, name it `block-leaky-paths`.
3. Switch the expression editor to **Edit expression** and paste the expression.
4. Action: **Block**. Deploy.

### Option B — API
```bash
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
```hcl
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

```bash
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 200
```

## Notes

- Prefer **Block** over Managed Challenge for these — there's no legitimate
  reason to request `/.env`.
- `contains` matches anywhere in the path, so `/foo/.git/config` is 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`.

Versions

The database has no other skills named cloudflare-leaky-paths.

Database snapshot: 13.11.2026 · package version 4acbb4eb0da8 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 1 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100cloudflare-waf-rules
    Create, list and delete Cloudflare WAF custom rules from safe templates (block .env/.git probes, block WordPress probes, challenge the admin area, challenge countries) or a custom Rules-language expression, with dry-run and confirmation. Use when the user asks to block bots,…
  • 100cloudflare-hardening
    Put an AI-built app safely behind Cloudflare. SSL Full (strict), Always Use HTTPS, minimum TLS, WAF custom rules for .env/.git probes, rate limiting on login and API, Turnstile on forms, bot protection, DNSSEC and hiding the origin IP. Read-only audit first, every change as a…
  • 100cloudflare-zone-audit
    Read-only security posture audit of a Cloudflare zone (SSL mode, HTTPS, TLS, WAF, rate limiting, bots, DNSSEC, exposed origin IPs, dangling CNAMEs) with plain-English findings and a score out of 100. Use when the user asks if their Cloudflare setup or domain is secure,…
  • 100cloudflare-block-countries
    Block specific countries via Cloudflare WAF Custom Rules using the Cloudflare API. Use when user wants to geo-block traffic, block countries in Cloudflare, set up WAF country rules, or mentions blocking regions. Handles both creating new rulesets and updating existing ones.
  • 100cloudflare-block-countries
    Block specific countries via Cloudflare WAF Custom Rules using the Cloudflare API. Use when user wants to geo-block traffic, block countries in Cloudflare, set up WAF country rules, or mentions blocking regions. Handles both creating new rulesets and updating existing ones.
  • 100waf-rule-tuning
    Tune web application firewalls (OWASP Core Rule Set on ModSecurity/Coraza, AWS WAF, Azure WAF, Cloudflare, Akamai) — paranoia levels and anomaly thresholds, false-positive exclusions scoped by rule, path and parameter, detect-to-block rollout, virtual patching for new CVEs, and…

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.