Cloudflare Configuration

ORIGIN PROTECTION

Inbound traffic to the origin must be restricted to Cloudflare's published IP ranges plus any whitelisted VPN exit IP for direct dev access. This forces all public traffic through Cloudflare's proxy — nobody can bypass CF and hit the origin directly, which is what makes CF's WAF, rate limiting, and bot mitigation effective - otherwise an attacker could just find the origin IP and go around all of it.

Some of this is supposed to be enabled now, although it should be done at the hardware/cloud level, not just on the server.

BOT DETECTION

Bot fight mode should be enabled.  If on the Pro plan, Super Bot Fight mode can be customized, but start with the default values:

SECURITY SECTION

Managed rule: Cloudflare OWASP Core (disable)

This is a managed ruleset provided by Cloudflare and should be disabled initially.  It prevents many documented types of attacks like cross site scripting (xss) and sql injection (sqli) among others.  It’s worth monitoring the security event log to verify against any potential false positives which could be significant.

Managed rule: Cloudflare Managed Ruleset (enable)

Another managed ruleset that Cloudflare handles.  We should leave it on, but again, monitor the security event log for false positives, although this rule set known to be more accurate in Cloudflare’s environment.

Custom rule: Allow access by IP

Rate limiting rule: Limit login requests

(http.request.uri.path eq "/wp-login.php") and (http.request.method eq "POST")

CACHING SECTION

The caching behavior is broken down into an Allow, then Exclude order, to increase the readability and understanding of the setup.  Rules are named semantically.

Rule: Cache *

Rule: Exclude basic paths

Rule: Exclude basic cookies

PLUGIN INTERACTIONS

Cloudflare Plugin 

We are using this plugin solely to purge the cache.  It is capable of doing APO (automatic platform optimization) but this can be overreaching – the most straightforward path is to simply understand the moving parts and minimize their interaction.

The plugin requires an API token – we start with the global token, then limit that after verifying the desired results have been achieved.  When this API token is entered, the plugin immediately begins to properly purge the cloudflare cache upon post edit/publish.

Wordfence Plugin

Wordfence can largely operate as normally, although it will essentially only be protecting the administration area.  

A large site should utilize the paid professional version to enable the realtime protection, geolookups, and malware definitions.

Contact Us

Send us a quick note and we'll get back to you within 24 hours.

Contact Us

We use cookies to give you the most relevant experience. By clicking Accept All, you consent to our use of cookies.

Privacy PolicyDo Not Sell My Personal Information