WAF: rules that block or challenge bad requests before they reach your site
WAF (Web Application Firewall and custom rules)
What it is
A Web Application Firewall, or WAF, is a set of rules that look at each request arriving at a proxied hostname and decide what to do with it before it reaches your site. A rule is built from a condition and an action. The condition can use things like the URL path, the country the visitor appears to be in, the visitor's IP address, or the browser's user agent. The action can be Block, Managed Challenge (a quick check to see whether the visitor is a real person), Skip, or simply Log.
There are two main kinds. Custom rules are ones you write yourself, for example "if the path starts with /admin and the country is not Australia, then challenge". Managed rules are pre-written rule sets that Cloudflare maintains to catch well-known attacks, such as attempts to break into a WordPress login or inject code into a form. You find both under Security, then WAF in the dashboard (the wording may differ slightly).
A WAF only sees traffic that passes through Cloudflare, which means the hostname must be proxied (the orange cloud from lesson 1). A DNS-only record bypasses it completely. Rules are checked in order, and the plan you are on limits how many custom rules you can have, so a few well-chosen rules are better than many.
Why it matters
Anything on the public internet gets probed within hours: bots hunt for login pages, old WordPress paths such as /wp-login.php, and exposed files such as /.env. A WAF stops that noise at Cloudflare's edge, so it never reaches your VPS or fills your logs, and it costs your apps nothing.
It is also the quickest way to put a gate in front of something temporarily. If a bot starts hammering one page, you can add a rule for that path in a minute and remove it again, without touching your application code.
The caution is that a badly written rule can lock you out of your own site, or block real patients or colleagues. Always try a new rule with the Log action or Managed Challenge first rather than Block, check the Security Events page to see what it matched, and keep the rule's expression as narrow as you can. Never rely on a WAF as the only protection for anything holding patient information.
On your account
From your own setup: your VPS apps such as notes.kosan.xyz and the OpenClaw dashboard sit behind proxied records on kosan.xyz. Those hostnames are where a WAF rule would help most, for instance a rule that challenges any request to a login or admin path from outside Australia.
The Security Events page for each zone shows what Cloudflare has already blocked or challenged. On a hostname that is public and proxied, expect to see automated probes for paths like /wp-login.php or /.env, even though you have never linked to them.
This tutor, cloudflare.kosan.xyz, is served by the cloudflare-tutor Worker and has no custom WAF rule of its own. Nothing in this lesson creates, edits, or deletes a WAF rule, a DNS record, or any Worker.
Do this yourself
These stay in the dashboard, on your side. This site does not change DNS, routes, or other Workers.
- In the Cloudflare dashboard, open the kosan.xyz zone, go to Security, then Events (wording may differ slightly), set the time range to the last 24 hours, and read only: write down the top three paths or countries being hit and which action Cloudflare took. Then open Security, then WAF, Custom rules, and on paper draft one rule you would add, written in plain words as a condition and an action (for example: if path contains /wp-login.php then Managed Challenge). Do not save or deploy any rule, and do not change managed rules or DNS.