docs(waf): correct WAF mode wording (Detect only / Enforce high-confidence), add mode table and Reviewing detections

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0185ukXi4YX5FxJGqhi6qab6
This commit is contained in:
shadowdaoandClaude Sonnet 5.5 committed 2026-11-17 13:37:00 -08:00
1 parent f8eca7f09f
commit 5f9beb27cd
2 files changed
+63 -23

No files matched your search

+62 -22
View File
@@ -1,28 +1,40 @@
---
title: Coraza WAF rules
description: Set the global WAF mode, tune individual rules, audit blocked requests, and add per-host overrides.
description: What each WAF mode really does, how to review logged detections and blocked requests, tune individual rules, and add per-host overrides.
sidebar:
order: 3
---
import { Aside } from '@astrojs/starlight/components';
import { Aside, Steps } from '@astrojs/starlight/components';
import SuperAdmin from '~/content/partials/super-admin-callout.mdx';
import AdminSignIn from '~/content/partials/admin-signin.mdx';
import Support from '~/content/partials/support-link.mdx';
<SuperAdmin />
[Coraza](https://coraza.io/) is an open-source web-application firewall (WAF) that runs as a sidecar in front of your sites. The **Coraza Rules** page in the admin sidebar gives you a UI to set the global mode, tune individual rules, and audit blocked requests — all without rebuilding the sidecar image.
[Coraza](https://coraza.io/) is an open-source web-application firewall (WAF) that runs as a sidecar in front of your sites. The **Coraza Rules** page in the admin sidebar gives you a UI to set the global mode, tune individual rules, and review detections and blocked requests — all without rebuilding the sidecar image.
![Coraza Rules page — Firing rules tab](~/assets/screenshots/whp/admin-coraza.png)
## Global WAF mode
A coloured pill at the top of the page shows the **Global WAF mode** with a **change** link:
The mode is set in **Server Settings → Security** (the **change** link next to the pill on the Coraza Rules page takes you there). The same names are used in both places: **Off**, **Detect only** and **Enforce (high-confidence)**.
- **Off** — no inspection. Requests pass untouched.
- **Detect** — inspect and log matches; do not block. Use during a roll-out or while validating a rule change.
- **Enforce** — inspect and block anything that matches an enforcing rule.
### What each mode does
| Mode | What happens to a matching request |
|---|---|
| **Off** | No inspection. The WAF sidecar is stopped and requests pass untouched. |
| **Detect only** | Every rule is evaluated and the match is logged to the WAF audit log. No WHP rule changes the response, except the small always-on set of high-confidence protections listed under **Enforce** below. |
| **Enforce (high-confidence)** | Blocks high-confidence attacks only: path traversal / file inclusion, remote command execution, PHP and Java code injection, restricted file types, and known CVE exploits. SQL injection, cross-site scripting, scanner signatures and the anomaly score are **logged but not blocked**, to avoid breaking legitimate sites and editors. |
<Aside type="caution" title="Enforce does not mean full CRS blocking">
Enforce is deliberately narrow. A request that only trips SQL injection, cross-site scripting or scanner rules is logged and still served. Use the audit log to see what *would* have matched.
</Aside>
<Aside type="note" title="Detect only still has a safety net">
Those same high-confidence protections are built into the WAF image and apply everywhere, so a server in **Detect only** can still block some requests (for example probes for `.env` or `.git` files, or restricted file types). Everything else is log-only. The Coraza Rules page shows the exact per-rule behaviour in the **State** column.
</Aside>
The WAF is **fail-open**: if the Coraza sidecar is itself unhealthy, traffic still flows.
@@ -30,7 +42,7 @@ The WAF is **fail-open**: if the Coraza sidecar is itself unhealthy, traffic sti
<AdminSignIn />
## The three tabs
## The four tabs
### Firing rules
@@ -42,7 +54,7 @@ Columns:
- **Hits** — how many times the rule fired in the time window.
- **Top hosts** — the top customer domains that triggered this rule (with per-host hit counts).
- **Top URIs** — the most common request paths that triggered it (helpful for distinguishing scans from real traffic).
- **State** — per-rule override of the global mode. Options: `(default → enforce)`, `(default → detect)`, `(default → score)`, `off`. Picking anything other than `(default → …)` overrides the global mode for that rule.
- **State** — per-rule override of the global mode. Options: `(default → …)`, `enforce`, `detect`, `off`. The text after the arrow is what the rule does today (for example `detect`, `score` or `enforce`), based on the global mode and the built-in high-confidence list. A rule marked `score` only adds to the anomaly score and is logged, not blocked, in Enforce mode. Picking `enforce`, `detect` or `off` overrides the default for that rule.
- **Per-host** — opens a **Hosts (N)** drawer to set per-host overrides for that rule.
<Aside type="tip">
@@ -55,20 +67,20 @@ The full OWASP Core Rule Set catalogue (v4 families: 901, 905, 911, 913, 920–9
### Activity
A timeline / log of every WAF block in the audit window. Use it to:
The most recent 100 rule and exception changes (who changed what, and when), plus the status of the **reconciler** that applies your changes to the WAF. It also lists sites in emergency mode and any changes that could not be applied. This tab is a change log, not a list of blocked requests; for those, see *Reviewing detections* below.
- Confirm a customer report (cross-reference the **X-Request-Reference** UUID on the visitor-facing 403 page).
- Spot bursts of activity from the same source IP.
- Tune source-of-truth back-end queries — the audit is read from `security.db`.
### Customer changes
Every change customers have made themselves (for example excluding a rule on their own site), most recent first.
## Common tasks
### Roll a new site onto the WAF
1. Set the rule's **State** to `(default → detect)` for that site via the Per-host drawer.
1. Make sure the server is in **Detect only** mode (or use the Per-host drawer to keep the rules you are testing at `detect` for that site).
2. Drive normal traffic for at least 24 hours.
3. Open the **Activity** tab and filter to that host. Confirm no legitimate request is matching an enforcing rule.
4. Flip the host to **enforce**.
3. Open **Firing rules** and check which rules fired for that host. Confirm no legitimate request is matching a rule that would block (the ones whose default is `enforce`).
4. Switch the mode to **Enforce (high-confidence)** in Server Settings → Security.
### Mute a noisy rule
@@ -77,13 +89,39 @@ A timeline / log of every WAF block in the audit window. Use it to:
Prefer per-host. Global mute weakens the WAF for every site.
### Reviewing detections
The WAF produces two different kinds of records, and they live in different places on the **Coraza Rules** page:
| You want to see | Where to look | Does the visitor see anything? |
|---|---|---|
| **Logged detections** — rules that matched but let the request through (everything in Detect only apart from the always-on set; in Enforce, anything outside the high-confidence list) | **Firing rules** tab. A rule whose **State** reads `(default → detect)` or `(default → score)` is log-only. | No. The page loads normally, so there is no block page and no reference ID. |
| **Blocked requests** — requests the WAF actually stopped | **Firing rules** tab, rows whose **State** reads `(default → enforce)`. **view** lists the matching requests. | Yes. The visitor gets the branded 403 page with a reference ID. |
Both kinds are counted in **Hits**; the **State** column tells you which kind a rule produces.
To review:
<Steps>
1. Open **Coraza Rules** and pick **Last 24h** or **Last 7d** at the top right.
2. On **Firing rules**, start with the highest **Hits** and look at **Top hosts** and **Top URIs** to separate scanners from real visitors.
3. For a rule you do not recognise, click **Ask AI** or open the rule from the **CRS catalog**.
4. If a rule is firing on legitimate traffic, mute it for that site only (see *Mute a noisy rule* above) rather than turning it off globally.
</Steps>
### Audit a block
Customer reports a request was wrongly blocked? The branded 403 page includes an **X-Request-Reference** UUID. Cross-reference it:
Customer reports a request was wrongly blocked? The branded 403 page shows a **reference ID** (also sent as the `X-Request-Reference` response header). Ask the customer for it, then:
1. In the **Activity** tab, search for the UUID.
2. The row shows the matched rule ID, source IP, URL, and offending parameter.
3. Decide whether to mute the rule (see above) or leave it — many "false positives" turn out to be real attempts.
1. Look the reference up in the edge (HAProxy) access log on the server to find the time, client IP, host and URL of that request.
2. Find the matching transaction in the WAF audit log on the server; it names the matched rule ID, source IP, URL and offending parameter.
3. Decide whether to mute the rule (see above) or leave it. Many "false positives" turn out to be real attempts.
<Aside type="note">
If the customer cannot give you a reference ID because the request loaded normally, it was a logged-only detection and the WAF did not cause their problem. Look for the cause elsewhere (application error, permissions, caching).
</Aside>
## Implementation notes
@@ -93,9 +131,11 @@ Customer reports a request was wrongly blocked? The branded 403 page includes an
## Troubleshooting
**A rule shows enabled but doesn't fire.** Check that the host is in **detect** or **enforce** mode. A host in **off** bypasses every rule.
**A rule shows enabled but doesn't fire.** Check that the global mode is **Detect only** or **Enforce (high-confidence)**. **Off** bypasses every rule.
**The Activity log is empty.** Confirm `coraza-spoa` is healthy on the **Services** tab of Server Settings. If it's restarting in a loop, check the container logs — usually a malformed rule file or a missing include.
**A request matched a rule but was not blocked.** Expected: in both modes only the high-confidence rules block. Everything else, including SQL injection, cross-site scripting and scanner signatures, is logged only.
**The Firing rules tab is empty.** Confirm `coraza-spoa` is healthy on the **Services** tab of Server Settings. If it's restarting in a loop, check the container logs — usually a malformed rule file or a missing include.
**Edits revert on restart.** Make sure you're editing through the panel; manual edits outside the panel-managed path are overwritten.
@@ -88,7 +88,7 @@ These are issues where the underlying signal recovered before a human looked at
### Tune brute-force detection
Brute-force rules live in **Coraza Rules** (rule families CRS-913 / 921 / 942 / 949) rather than AI Monitor. AI Monitor surfaces the *effects* (error spikes) once a brute-force pattern fires, but the matching itself is in the WAF — see [Coraza WAF rules](/whp/admin/coraza-waf/).
Brute-force rules live in **Coraza Rules** (rule families CRS-913 / 921 / 942 / 949) rather than AI Monitor. AI Monitor surfaces the *effects* (error spikes) once a brute-force pattern fires, but the matching itself is in the WAF. In **Enforce (high-confidence)** mode these rules are logged but not blocked, so they show up as detections on the Coraza Rules page rather than as blocked requests. See [Coraza WAF rules](/whp/admin/coraza-waf/).
## Routing alerts