Define your own WAF rules in Bunny Shield to fine-tune existing protections or block threats the managed ruleset doesn’t cover.
Custom WAF rules let you write conditions Bunny Shield doesn’t cover out of the box. You pick the variables, operators, transformations, and response actions to target threats specific to your application.
Before writing your first rule, read the Rule Engine documentation to understand how rules are structured.This rule processes each HTTP request by extracting only the REQUEST_URI (Variable), converting it to lowercase, and removing whitespaces (Transformations). It then verifies if the transformed REQUEST_URI matches exactly (Operator) with ‘/blockedpath’ (Operator Value). If a match is found, our WAF Engine will block (Response Action) the request, halting further rule processing and intercepting the request.With the basics covered, you can write WAF rules that target the threats specific to your site.
To block requests that have a User-Agent matching a known crawler, the rule would be:Adapt these patterns to mitigate the threats and enforce the security policies that match your application.