You move a WordPress site behind Cloudflare on a Wednesday. The managed WAF is enabled with the recommended defaults. By the weekend the access log shows 14,000 POSTs to /xmlrpc.php from 800 IPs spread across residential proxies, the load average is creeping up, and the editor team reports the dashboard “feels slow.” The Cloudflare dashboard shows the managed ruleset is doing its job — but only what its job is, which is not “stop a coordinated WordPress login brute force from rotating IPs.”
What’s happening
Cloudflare’s managed WAF ships three rulesets that are enabled by default on Pro/Biz/Enterprise plans:
- Cloudflare Managed Ruleset. Edge-layer protection: known exploit signatures, common CVE patterns, malformed requests, generic SQLi/XSS heuristics. Updated by Cloudflare, you don’t write the rules.
- Cloudflare OWASP Core Ruleset. A tuned OWASP CRS implementation. Has paranoia and scoring concepts similar to upstream CRS, exposed via the dashboard as “sensitivity” and “threshold.”
- Cloudflare Exposed Credentials Check. Compares submitted credentials against known-breached-credential databases and blocks reuse.
What they do not cover well, in our experience operating WordPress at scale behind Cloudflare:
/wp-login.phpenumeration. The managed ruleset will block known-bad payloads but not slow brute forces from distributed residential IPs that send a single attempt per IP. Each request looks legitimate; the pattern is in the aggregate./xmlrpc.phpamplification. XML-RPC’ssystem.multicalllets an attacker test 500 password combinations in one HTTP request. The managed ruleset doesn’t block this — the request looks like a normal XML body.- REST API username enumeration.
GET /wp-json/wp/v2/usersreturns the list of authors. Behind a default-config Cloudflare zone, this is unprotected and feeds credential stuffing. /wp-admin/admin-ajax.phpaction-based abuse. Plugins expose unauthenticated AJAX endpoints (?action=wpforms_log,?action=elementor_ajax) that can be flooded or fuzzed. The managed ruleset is too coarse to discriminate.
The fix is to keep the managed rulesets enabled, raise the OWASP sensitivity carefully, and add a small set of zone-specific custom rules and rate-limiting rules for the WordPress-shaped surface.
How to verify
The Cloudflare API gives you a programmatic view of what’s enabled and what fired:
# What managed rulesets are active on the zone?
curl -X GET "https://api.cloudflare.com/client/v4/zones/${ZONE}/rulesets" \
-H "Authorization: Bearer ${CF_TOKEN}" \
-H "Content-Type: application/json" | jq '.result[] | {id, phase, name}'
# Last 24h of WAF events for /wp-login.php and /xmlrpc.php
curl -X POST "https://api.cloudflare.com/client/v4/graphql" \
-H "Authorization: Bearer ${CF_TOKEN}" -d '{
"query": "query { viewer { zones(filter: {zoneTag: \"'${ZONE}'\"}) {
firewallEventsAdaptive(filter: {
datetime_gt: \"2026-05-13T00:00:00Z\",
clientRequestPath_in: [\"/wp-login.php\",\"/xmlrpc.php\"]
}, limit: 100) { action source ruleId clientRequestPath clientIP }
}}}"
}' | jq
If the response shows action: "log" or action: "skip" for /wp-login.php POSTs from 50 different residential IPs in a 10-minute window, you have a slow brute force the managed ruleset isn’t seeing as one event.
For REST exposure:
curl -s "https://example.com/wp-json/wp/v2/users" | jq '. | length'
# > 0 — usernames are leaking
For XML-RPC:
curl -s "https://example.com/xmlrpc.php" -d '<?xml version="1.0"?>
<methodCall><methodName>system.listMethods</methodName></methodCall>'
# If you get back the method list, xmlrpc is fully open
The fix
We layer custom rules on top of the managed rulesets. The custom rules are version-controlled in Terraform or pushed via the API from a config repo.
Custom rule: block xmlrpc.php entirely
Most WordPress sites do not need XML-RPC. If the operator confirms no Jetpack, no third-party publishing tool, no mobile app integration relies on it, block it at the edge:
curl -X POST "https://api.cloudflare.com/client/v4/zones/${ZONE}/rulesets/phases/http_request_firewall_custom/entrypoint/rules" \
-H "Authorization: Bearer ${CF_TOKEN}" -H "Content-Type: application/json" -d '{
"description": "Block xmlrpc.php at edge",
"expression": "(http.request.uri.path eq \"/xmlrpc.php\")",
"action": "block"
}'
If XML-RPC must remain enabled for a specific integration, allowlist its source first:
{
"description": "xmlrpc allowlist + default block",
"expression": "(http.request.uri.path eq \"/xmlrpc.php\" and not ip.src in {192.0.2.10 198.51.100.0/24})",
"action": "block"
}
Custom rule: lock wp-admin to known operator IPs
The editorial team’s egress IPs (office, VPN) are the only ones that should reach /wp-admin/:
{
"description": "wp-admin: operators only",
"expression": "(http.request.uri.path contains \"/wp-admin/\" and http.request.uri.path ne \"/wp-admin/admin-ajax.php\" and not ip.src in {$OPERATOR_IPS})",
"action": "block"
}
The exception for admin-ajax.php matters — it’s reached by the frontend (Elementor, WooCommerce, Contact Form 7) and blocking it from public IPs breaks logged-out site features.
Custom rule: REST user enumeration
{
"description": "Block REST users enumeration",
"expression": "(http.request.uri.path eq \"/wp-json/wp/v2/users\" or http.request.uri.path matches \"^/wp-json/wp/v2/users/[0-9]+$\") and not http.request.headers[\"x-wp-nonce\"][0] ne \"\"",
"action": "block"
}
This blocks unauthenticated reads of the users endpoint. Authenticated admin requests carry an X-WP-Nonce header and pass through.
Custom rule: wp-login.php POST without referer
Legitimate logins come from a browser that just rendered /wp-login.php — the POST carries a referer header pointing at the login page. Brute-force tooling routinely omits the referer:
{
"description": "wp-login.php POST: enforce same-origin referer",
"expression": "(http.request.uri.path eq \"/wp-login.php\" and http.request.method eq \"POST\" and not http.referer contains \"example.com/wp-login.php\")",
"action": "managed_challenge"
}
managed_challenge is preferable to block here — the residential proxy fleet drops, the legitimate user with an aggressive privacy extension gets a Turnstile challenge and continues.
Raise OWASP sensitivity selectively
In the dashboard under Security > WAF > Managed rules > Cloudflare OWASP Core Ruleset, raise sensitivity to “medium” for the zone. Then add overrides for the admin surface that lower it back:
{
"description": "OWASP override for wp-admin",
"expression": "(http.request.uri.path contains \"/wp-admin/\")",
"action": "skip",
"action_parameters": {
"rulesets": ["owasp_managed"]
}
}
Telemetry that catches what slipped through
Set up a logpush job to your SIEM or S3:
curl -X POST "https://api.cloudflare.com/client/v4/zones/${ZONE}/logpush/jobs" \
-H "Authorization: Bearer ${CF_TOKEN}" -H "Content-Type: application/json" -d '{
"name": "wp-waf-events",
"dataset": "firewall_events",
"destination_conf": "s3://acme-cf-logs/waf?region=us-east-1",
"output_options": {
"field_names": ["RuleId","Action","ClientIP","ClientRequestPath","ClientRequestHost","Datetime"]
}
}'
Weekly review of the top-firing rules and the top source IPs is the operational discipline that keeps the ruleset useful.
Stack Harbor manages Cloudflare WAF configuration as code on every Enterprise WordPress zone we operate, including the rulebook above plus zone-specific custom rules tuned per plugin stack. If your WAF dashboard looks busy but the audit log is silent, send us a zone tag and we’ll review what’s firing.