Cloudflare Security Settings Explained: WAF Rules, Bot Fight Mode, and SSL Modes

Cloudflare Security Settings Explained: WAF Rules, Bot Fight Mode, and SSL Modes

Cloudflare sits in front of your server and decides what reaches it, but its dashboard holds dozens of toggles with names that explain little. The cloudflare security settings that matter most for a small server are the web application firewall rules, Bot Fight Mode, and the SSL mode, and each one has a setting that helps and a setting that breaks things. This guide explains what each does, which value to pick, and how to test the change without taking the site down.

Start from one principle: Cloudflare can only protect traffic that passes through it. If your server’s real IP is public and attackers connect to it directly, Cloudflare rules never see the request. Before tuning any setting below, confirm your DNS records are proxied, the orange cloud icon is on, and your server firewall accepts web traffic only from Cloudflare IP ranges. Without that, the dashboard settings are decoration.

Cloudflare Security Settings: WAF Rules That Block Attacks

The web application firewall, or WAF, inspects requests for attack patterns such as SQL injection and cross-site scripting, and blocks the ones that match. On the free plan, the managed ruleset covers common attacks with limited tuning. On paid plans, you can add custom rules, such as blocking a country for a login page or challenging requests to wp-login.php that come from outside your region. Custom rules are where the WAF earns its keep for a small site, because they target your actual login and admin paths rather than generic attack patterns.

Good cloudflare waf rules are written narrowly. A rule that challenges all traffic to the login page from outside your country is usually safe. A rule that blocks an entire country from the whole site can block real visitors, such as a customer traveling abroad or a search engine crawler routed through that region. Test each rule in log or simulate mode first where the plan allows it, then switch it to block or challenge after a day of clean logs. A rule that fires on real traffic in its first day will keep firing, so the test period is not wasted time.

Watch the WAF events log after any change. It shows which rule fired, what request triggered it, and whether the visitor was blocked or challenged. A spike in blocks on one rule after a deploy often means the deploy changed a form field the rule inspects, not that an attack started. Our guide on DDoS protection basics for a small VPS covers the server-side controls that pair with the WAF, since the firewall on the server remains the last line when traffic bypasses the proxy.

Bot Fight Mode and What It Misses

Bot Fight Mode is a single toggle that blocks known bad bots using fingerprinting. It costs nothing and takes one click, which makes it an easy win for most sites. It cuts comment spam, credential stuffing from known bot networks, and content scraping by the bots Cloudflare recognizes. Turn it on, watch the firewall events for a few days, and confirm real visitors are not being challenged in bulk.

The limit is in the name: it fights known bots. A new bot, a bot that mimics a real browser well, or a distributed attack from residential IPs can pass it. Bot Fight Mode is also blunt: it does not let you write exceptions for a good bot you rely on, such as a monitoring service that checks your site every minute. If a legitimate service starts failing after you enable it, check whether its requests are being blocked and consider a paid bot management rule or a firewall rule that skips the check for that service’s IPs.

For WordPress sites, Bot Fight Mode pairs well with login protection at the server, such as rate limiting and Fail2ban, because a bot that gets through the proxy still faces the server defenses. Our guide on rate limiting Nginx against brute force and scraping bots covers that layer, and our Cloudflare APO and page rules guide covers the performance side of the same dashboard.

SSL Modes: Flexible, Full, and Full Strict

The cloudflare ssl modes choice controls the connection between Cloudflare and your origin server, and picking wrong here is the most common Cloudflare misconfiguration. Flexible means the visitor-to-Cloudflare connection is encrypted but the Cloudflare-to-server connection is plain HTTP. It looks secure in the browser padlock while the second half of the trip is readable, and it breaks sites that force HTTPS on the server, since the server sees plain HTTP and redirects in a loop.

Full means Cloudflare connects to the origin over HTTPS but does not validate the origin certificate. It stops passive snooping and avoids the redirect loop, but a forged certificate on the path could still fool it. Full Strict means Cloudflare validates the origin certificate against a trusted authority, and refuses the connection when the certificate is invalid or expired. Full Strict is the setting to use on any site that handles logins, payments, or personal data.

Getting to Full Strict needs a valid certificate on the origin. A free Let’s Encrypt certificate works, and so does a Cloudflare origin certificate, which is free and lasts longer but is only trusted by Cloudflare, not by browsers directly. That last point matters: an origin certificate alone does not make the site work without the proxy. Our guides on installing a free Let’s Encrypt certificate on Nginx and TLS 1.2 vs TLS 1.3 cover the origin side of this setup.

Testing Changes Without Breaking the Site

Change one setting at a time, and test from a browser and from curl after each change. Load the homepage, log in, submit a form, and confirm no redirect loop and no unexpected challenge page. Check the site from a second network, such as a phone on mobile data, since a rule based on your own IP or country looks fine from your desk and broken everywhere else.

Keep a short note of each setting you change and why. Cloudflare dashboards accumulate toggles over months, and a setting nobody remembers is a setting nobody can debug. The three settings in this guide, WAF rules for your login paths, Bot Fight Mode on, and SSL mode at Full Strict, cover most of what a small server needs from the dashboard. The rest of the toggles can wait until a specific problem asks for them.

Ditulis oleh

Firdaus Safari Putra

Founder, PT FirKaizen Digital Solutions

Firdaus Safari Putra adalah founder PT FirKaizen Digital Solutions. Ia membangun dan mengoperasikan infrastruktur server di balik panduan ini, dan menulis berdasarkan apa yang benar-benar ia jalankan, uji, dan ukur — bukan teori.