Linux 软件免费装
Banner图

ProbeGuard 404 Firewall for Cloudflare

开发者 dandawson
更新时间 2026年9月16日 02:00
PHP版本: 7.2 及以上
WordPress版本: 7.1
版权: GPLv2 or later
版权网址: 版权信息

标签

404 firewall block bots brute force cloudflare

下载

2.0.0

详情介绍:

ProbeGuard records 404 requests and, when a single IP exceeds a configurable threshold within a time window, adds a Cloudflare IP Access Rule for that address. The rule is removed automatically when the block duration expires. Access Rules are available on every Cloudflare plan, including Free. Because the block happens at Cloudflare, abusive traffic stops before it reaches PHP. Features Visitor IP detection CF-Connecting-IP is trusted only when the request reaches the site from a Cloudflare edge address; the range list is refreshed daily from Cloudflare's public endpoint. If the site sits behind an additional proxy or load balancer, list its addresses in this optional constant so forwarded headers are honoured: define( 'EDGE404_TRUSTED_PROXIES', '10.0.0.0/8, 203.0.113.7' ); Otherwise a request is attributed to the address it actually connected from, which cannot be forged. Private and reserved addresses are never sent to Cloudflare as block targets.

安装:

  1. Upload the plugin folder to /wp-content/plugins/, or install it from the WordPress admin, then activate it.
  2. Create a scoped Cloudflare API token in the Cloudflare dashboard under Manage Account -> Account API Tokens, using Create Token -> Create Custom Token, with the permission Zone -> Firewall Services -> Edit, scoped to the zone for this site. The Documentation tab links straight to that form with the permission already selected.
  3. Copy the Zone ID from the Overview tab of that domain in the Cloudflare dashboard.
  4. Paste both values into Tools -> ProbeGuard 404 Firewall -> Settings and save. The token is stored in the database and only ever shown masked afterwards.
  5. Review the thresholds on the same tab.
Sites that would rather keep credentials out of the database can define them in wp-config.php instead, in which case the constants take precedence and the fields are shown read-only: define( 'EDGE404_API_TOKEN', 'your-cloudflare-api-token' ); define( 'EDGE404_ZONE_ID', 'your-zone-id' ); Sites set up before 2.0.0 used CF_404_API_TOKEN and CF_404_ZONE_ID. Those names are still honoured, so an existing wp-config.php does not have to be edited: the values are copied into the settings on upgrade and the constants can be removed whenever convenient. Cloudflare Global API Keys are not supported: they authenticate against the whole Cloudflare account, which is far more access than editing one zone's access rules needs.

屏幕截图:

  • The 404 log, showing what each IP actually requested.
  • Settings: thresholds, block duration, repeat-offender handling, retention and the whitelist.
  • Documentation, with links that open the right Cloudflare screens for this site.

升级注意事项:

2.0.0 The plugin is now ProbeGuard 404 Firewall for Cloudflare. Settings, logs and active blocks carry over automatically, and existing wp-config.php constants keep working. Sites that call the plugin's filters directly need to switch them to the edge404_ prefix. 1.3.0 Blocks now escalate for repeat offenders (doubling, capped at 24 hours) and a returning IP is re-blocked on its first 404. Review "Remember offenders" and "Maximum block duration" in Settings if you want the previous fixed-length behaviour. 1.2.1 Removes the "duplicate_of_existing" Cloudflare errors from the diagnostic log and adds a button to clear recorded warnings and errors. 1.2.0 Security and reliability release. Cloudflare Global API Key authentication is removed — define CF_404_API_TOKEN before updating. Whitelist entries are migrated to anchored matching automatically, and deactivation now removes the plugin's Cloudflare rules unless you opt out in Settings.

常见问题:

Does this require a paid Cloudflare plan?

No. It uses IP Access Rules, which are available on all plans. Cloudflare enforces an account-level quota on the number of rules.

How do whitelist patterns work?

Each line is matched against the request path, the path plus query string, and both of those prefixed with the requested host. That means an entry can be a path (/tracking/*), a host and path (tracking.example.com/tracking/*), a "contains anywhere" pattern (*tracking.example.com*, which also matches that text in a path or query string) or a pasted URL. Use * for wildcards; a pattern with no wildcard must match exactly. Entries saved by earlier versions gain a trailing * on upgrade so previous prefix behaviour is preserved.

My email click-tracking links are logged as 404s

They are 404s, so they are logged. Hosts that rewrite links in outgoing mail serve them from a tracking subdomain, so add an entry such as /tracking/* or tracking.example.com/* to the whitelist; matching includes the requested host, so host patterns work too. Nothing host-specific is whitelisted by default.

What happens if WP-Cron is not running?

Blocking falls back to running inline if the scheduled event cannot be created, but expiry, log pruning and diagnostics rely on the scheduled task. Server-level cron and external schedulers work; the plugin warns only when its own maintenance task has not run for two hours, and the warning can be dismissed permanently.

How long are logs kept?

404 records are kept for the configured retention period (1-168 hours, 12 by default). Expired block records are removed a day after expiry. Diagnostic warnings and errors are kept for 7 days and capped at 500 rows. Credentials are redacted from diagnostic output.

Should the token be an account token or a user token?

Either works. An account token (Manage Account -> Account API Tokens) belongs to the Cloudflare account, so it keeps working when the user who created it loses access, which makes it the better default. A user token (My Profile -> API Tokens) is the only option for a zone reached through an account you are not a member of. One token can serve several sites if its Zone Resources include each zone.

What happens if the same IP keeps coming back?

It gets progressively harder to shake off. While an IP is blocked, Cloudflare handles its requests at the edge, so they never reach WordPress to be counted — which is why a returning IP is re-blocked on its first 404 instead of having to earn the full threshold again, and why each successive block within the "Remember offenders" window is twice as long as the last, up to the "Maximum block duration" ceiling. If a 404 does get through while a block is live, the existing block is extended rather than duplicated. Set "Remember offenders" to 0 to treat every block as a first offence.

What happens when I deactivate or delete the plugin?

Deactivating cancels every scheduled task and, unless "Keep Cloudflare blocks when the plugin is deactivated" is enabled in Settings, deletes the Cloudflare access rules the plugin created — nothing would remain to expire them otherwise. Deleting the plugin removes its rules, database tables and options.

更新日志:

2.0.0 1.3.8 1.3.7 1.3.6 1.3.5 1.3.4 1.3.3 1.3.2 1.3.1 1.3.0 1.2.1 1.2.0 1.1.3 1.1.0 1.0.9 1.0.8