Cloudflare Integration
Connect Cloudflare’s Web Application Firewall for automated enforcement driven by Response Actions.
Prerequisites
Section titled “Prerequisites”- A Cloudflare account
- Your website proxied through Cloudflare
- An API token with appropriate permissions
Creating a Cloudflare API Token
Section titled “Creating a Cloudflare API Token”-
Log into Cloudflare Dashboard
-
Go to My Profile → API Tokens
-
Click Create Token
-
Use Custom Token with these permissions:
Resource Permission Zone > Firewall Services Edit Scope Zone Resources to the specific zone you’re protecting.
-
Copy the generated token (shown only once)
Setting Up the Integration
Section titled “Setting Up the Integration”-
Go to Integrations → Cloudflare
-
Click Add Cloudflare Integration
-
Enter your credentials:
Field Description API Token Your Cloudflare API token Account ID Your Cloudflare account ID Zone ID The zone (domain) to protect Zone Name Domain name (e.g., yoursite.com) -
Click Connect
-
WebDecoy verifies the connection
Finding Your Account ID and Zone ID
Section titled “Finding Your Account ID and Zone ID”Account ID:
- Go to any domain in Cloudflare dashboard
- Look in the right sidebar under “API”
- Copy the “Account ID”
Zone ID:
- Go to the specific domain
- Look in the right sidebar under “API”
- Copy the “Zone ID”
How Enforcement Works
Section titled “How Enforcement Works”The legacy per-decoy blocking rules were retired — enforcement is now driven by Response Actions on the Enforcement page:
- Block actor at WAF (
block_actor) — for a confirmed rotating actor, pushes a composite fingerprint rule (the actor’s JA4 and its network anchor — never a bare fingerprint) so the block follows the attacker across every IP it rotates through. - Block IP (
block_ip) — blocks the detection’s IP address with an automatic expiry.
While Cloudflare rule pushes are paused (see the notice above), configure your response actions anyway: WebDecoy records what it would enforce in Monitor mode, the zone preflight check works today, and pushes resume automatically when the Rulesets rebuild ships. If you need live rule pushes now, connect AWS WAF. Session clearance — the Cloudflare Worker edge validator — is fully live and independent of rule pushes.
Best Practices
Section titled “Best Practices”- ✅ Use a dedicated API token (not global API key)
- ✅ Review Monitor-mode would-enforce data before flipping to Enforce
- ✅ Set reasonable block durations (24h is a good default)
- ✅ Test with a known IP before production use
Don’ts
Section titled “Don’ts”- ❌ Use your global Cloudflare API key
- ❌ Set block duration to “forever” (IPs change hands)
- ❌ Block without monitoring results
Troubleshooting
Section titled “Troubleshooting””Invalid API Token” Error
Section titled “”Invalid API Token” Error”- Verify token was copied correctly (no extra spaces)
- Check token hasn’t expired
- Ensure token has required permissions
- Try creating a new token
”Zone Not Found” Error
Section titled “”Zone Not Found” Error”- Verify Zone ID is correct
- Ensure token has access to that zone
- Check zone is active in Cloudflare
Rules Not Appearing in Cloudflare
Section titled “Rules Not Appearing in Cloudflare”Expected for now — rule pushes are paused pending the Rulesets rebuild (see the notice at the top). Verify your setup with the zone preflight check on the Enforcement page instead.