NOTE: These rules are for restricting use of your site to only humans using browsers. See the
Using withsection below to use these rules with webhooks/websockets/apis/tunnels etc.
1-allow: allow definite bots + discord embed/image proxy2-block: block bots and unusual requests3-block: block HTTP/1.x4-challenge: challenge suspicious ASNs (will affect VPNs)
Webhooks will likely be blocked because they're requests made by bots.
Add a very restrictive check to the 1-allow rule to allow only that one webhook to pass through.
Example:
or (
(ip.geoip.asnum in {1234})
and (http.user_agent eq "good webhook boi")
and (http.request.full_uri eq "https://example.com/api/webhook/good-boi")
and any(http.request.headers["authorization"][*] == "......."))
)
If you have a public API (not used by browsers!), you will likely run into a lot of blocks. These firewall rules are designed to block all bots and they don't know about your API, so the best thing you can do is a check if the request is for your API and just... let it through.
You can add the following line to your 1-allow firewall rule.
or (http.host in {"public-api.example.com"})
I can't and don't recommend using Wordpress.
If you absolutetly must use Wordpress, remove the following checks from the 2-block rule and secure your Wordpress site using Cloudflare Access:
or (lower(http.request.uri.path) contains "wp-")
or (lower(http.request.uri.path) contains ".php")
or (lower(http.request.uri.path) contains ".xml")
The problem is cloudflared uses Go-http-client which is blocked by 2-block and uses HTTP/1.1.
The best solution is to put the entire host behind Cloudflare Access and then add the host in 1-allow.
or (http.host in {"tunnel.example.com"})
These rules are provided on a best-effort basis.
Feel free to contact me (SoraDev#1337) in the Cloudflare Discord for feedback.
Licensed under MIT.
Cloudflare Browser SSH is still using HTTP 1.1 so this could break when you challenge / Block it