Configure WAF for your site
This guide turns on the Quant Web Application Firewall (WAF) on a proxy rule, in report mode first, then in block mode. It also covers tuning, rate limits and how to test a block.
What the WAF inspects
Section titled “What the WAF inspects”The WAF inspects requests on proxy rules only, which are the requests that reach an application. Pages served from static content are not inspected, because no application handles them. Turn the WAF on for each proxy rule that sends requests to an application.
On those requests, the WAF applies the OWASP Core Rule Set, which detects attacks such as:
- SQL injection: database manipulation attempts
- Cross-site scripting (XSS): malicious script injection
- Remote file inclusion: attempts to include external files
- Local file inclusion: attempts to read server files, such as
/.env - Protocol attacks: HTTP protocol violations
The same panel also has block lists for known bad bots, referers and IP addresses, and rate limits. Each rate limit has its own Mode, separate from WAF mode (see Step 6).
Prerequisites
Section titled “Prerequisites”- A Quant project with a proxy rule that sends requests to your application.
- The WAF enabled for your organisation. The Web Application Firewall section of the rule editor shows only when it is. Contact support to enable it.
Step 1: Turn on the WAF in report mode
Section titled “Step 1: Turn on the WAF in report mode”Start in report mode. In report mode, the WAF logs what it would block, and blocks nothing.
- In the dashboard, open your project and go to Traffic > Rules.
- Open the actions menu of the proxy rule that reaches your application, and choose Edit.
- Scroll to Web Application Firewall.
- Turn on Web Application Firewall (WAF).
- Keep WAF mode at Report only. The other option is Block.
- Keep Paranoia level at 1 - Low (recommended).
- Select Update rule.

On the Rules page, the proxy rule now shows a WAF badge.

Step 2: Read the WAF hits
Section titled “Step 2: Read the WAF hits”Leave the WAF in report mode for a few days of normal traffic and normal editing. Then read the hits:
- In the project, go to Compute > Edge function logs.
- Turn on Include WAF hits.
- Choose a time range, for example Last 1h.

Each hit shows as a line such as WAF hit for URL: /.env?cb=12345. The line includes the query string of the request. The log is up to about 10 minutes behind, and lines are kept for 31 days.
The rule ID, the IP address and the mode of each hit are on Security > WAF logs, and in the output of quant waflogs.
Look for:
- Hits on requests that your visitors or editors make on purpose. These are false positives.
- The rule IDs that fire most often.
- Requests that are clearly attacks, such as probes for
/.envor/wp-config.php.
Step 3: Tune your WAF rules
Section titled “Step 3: Tune your WAF rules”Allow rule IDs for false positives
Section titled “Allow rule IDs for false positives”If a rule fires on real visitors:
- Edit the proxy rule.
- In Allow rule IDs, enter the rule ID and press Enter. The WAF no longer applies that rule on this proxy rule.
- Select Update rule.
Common rules to review for CMS sites:
| Rule Range | Type | Notes |
|---|---|---|
| 920xxx | Protocol enforcement | May flag complex query strings |
| 930xxx | Local file inclusion | May flag file upload paths |
| 941xxx | XSS protection | May flag rich text editors |
| 942xxx | SQL injection | May flag search queries |
See the CRS rule documentation for details on specific rules.
Allow trusted IPs
Section titled “Allow trusted IPs”Requests from addresses in Allow IPs bypass the WAF checks. Add your office, CI/CD servers or admin addresses:
- In Allow IPs, enter each IP address or CIDR range and press Enter.
- Select Update rule.
203.0.113.0/24192.0.2.50Block known bad actors
Section titled “Block known bad actors”In Block lists, turn on:
- Known bad bots
- Known bad referers
- Known bad IPs
- Optional: AI crawlers, to block AI crawlers
You can also block your own lists in Block IPs, Block User-Agents, Block referers and Block ASNs.
Step 4: Switch to block mode
Section titled “Step 4: Switch to block mode”When the hits are only attacks:
-
Edit the proxy rule.
-
Set WAF mode to Block.

-
Select Update rule.
Step 5: Test a block
Section titled “Step 5: Test a block”Wait a few minutes after the change. Then send a request that the WAF blocks, with a cache-busting query string:
curl -sI "https://www.example.com/.env?cb=$RANDOM"The response is 403 from Quant, and the quant-waf-rule header names the rule that matched:
HTTP/2 403quant-waf-rule: 930130Then request a normal page. It still comes from your application with its usual status. In report mode, the same /.env request goes on to your application and the hit is only logged.
If a rule blocks real visitors, add its ID from the quant-waf-rule header or the log to Allow rule IDs.
Step 6: Configure rate limiting
Section titled “Step 6: Configure rate limiting”The Rate limiting section has three types. Each one has a Mode: Disabled (the default), Report, Block or Bot Challenge. Each rate limit follows its own Mode, not WAF mode: a rate limit set to Block blocks even while WAF mode is Report only. In Block mode, a rate-limited request gets a 429.

IP-based rate limiting
Section titled “IP-based rate limiting”Limits requests per IP address:
- Set Mode. Start with Report.
- Set Requests/second: the threshold (default 10).
- Set Cooldown (seconds): how long the address stays limited (default 30).
Header-based rate limiting
Section titled “Header-based rate limiting”Limits requests grouped by a request header (useful for API rate limiting):
- Set Mode.
- Set Header name, for example
X-API-Key. - Set Requests/second (default 5) and Cooldown (seconds) (default 30).
WAF hit rate limiting
Section titled “WAF hit rate limiting”WAF hit rate limiting (auto-ban on repeated violations) limits an IP address that triggers WAF rules again and again. Set Mode, Hits threshold (default 10), Within minutes (default 5) and Cooldown (seconds) (default 300).
Common configurations
Section titled “Common configurations”WordPress sites
Section titled “WordPress sites”WordPress sites often need these rule adjustments:
Allow rule IDs:
941100 # XSS filter for admin WYSIWYG942100 # SQL detection in searchRecommended settings:
- Paranoia level: 1 - Low (recommended)
- Turn on all block lists
- IP rate limit: 100 RPS (high due to asset requests)
Drupal sites
Section titled “Drupal sites”Allow rule IDs:
941100 # XSS filter for CKEditor941160 # XSS filter for AJAX942100 # SQL detection in searchRecommended settings:
- Paranoia level: 1 - Low (recommended)
- Turn on all block lists
- IP rate limit: 100 RPS
For a password in front of the CMS admin and login paths, see Protect admin areas.
API endpoints
Section titled “API endpoints”For JSON APIs with sensitive operations:
Recommended settings:
- Paranoia level: 2 - Medium
- Header-based rate limiting on API keys
- Lower IP rate limits (10-20 RPS)
- Consider POST-only WAF via separate proxy rules
Static sites
Section titled “Static sites”The WAF inspects proxy rules only. Pages served from static content are not inspected, because no application handles them. On a static site, turn on the WAF for each proxy rule that reaches an application (forms, search, an API), with:
- Block lists turned on
- Low rate limits (10-20 RPS sufficient)
- Paranoia level: 1 - Low (recommended)
Set up notifications
Section titled “Set up notifications”To get WAF alerts in Slack:
- In WAF Slack webhook, enter your Slack incoming webhook URL.
- Optional: in Min RPM to notify, enter a number of hits per minute. Quant then notifies only when hits exceed that rate (e.g., 10).
- Select Update rule.
Notification emails can be set only by Quant support.
Monitor and adjust
Section titled “Monitor and adjust”After enabling block mode, continue monitoring:
Regular checks
Section titled “Regular checks”- Review WAF hits weekly for new attack patterns
- Check for false positives affecting legitimate users
- Adjust rules as your application changes
Response to attacks
Section titled “Response to attacks”When you see attack patterns:
- Identify the source: check IP addresses and patterns
- Add to Block IPs if attacks persist from specific IPs
- Adjust rate limits if under sustained load
- Review notifications for attack severity
Paranoia levels explained
Section titled “Paranoia levels explained”The Paranoia level setting maps to the OWASP Core Rule Set paranoia levels:
| Level | Description | Use case |
|---|---|---|
| 1 - Low (recommended) | Standard protection | Most websites |
| 2 - Medium | Stricter rules | APIs, sensitive applications |
| 3 - High | Aggressive filtering | High-security requirements |
| 4 - Extreme | Maximum strictness | Rarely needed; expect false positives |
Higher levels may require more rule tuning to avoid false positives.
Troubleshooting
Section titled “Troubleshooting”Legitimate requests being blocked
Section titled “Legitimate requests being blocked”- Find the blocked request in the WAF hits, or read the
quant-waf-ruleheader of the response - Note the rule ID
- Add it to Allow rule IDs if appropriate
- Or add the address to Allow IPs if it’s a known-good source
Attacks get a 200
Section titled “Attacks get a 200”- Check that WAF mode is Block. Report only logs hits and blocks nothing
- Check that the request goes through the proxy rule that has the WAF on. Static content is not inspected
- Test with a cache-busting query string. A response already in the cache is served without a check of the rules
Rate limit too aggressive
Section titled “Rate limit too aggressive”- Increase the Requests/second threshold
- Consider page asset count in your calculations
- For authenticated users, consider header-based limiting instead
API calls failing
Section titled “API calls failing”- Check if your API client sends unusual headers
- Verify request bodies aren’t triggering SQL/XSS rules
- Consider a separate proxy rule with custom WAF settings for API paths
Next steps
Section titled “Next steps”- Protect admin areas: a password at the edge in front of the CMS admin and login paths
- Security best practice: the full hardening checklist, including Origin Protection
- WAF reference documentation: detailed settings reference
- CRS rules: Core Rule Set documentation
- Custom rules: create custom WAF rules
- Security headers: additional security hardening
