docs(waf): correct mode wording to measured behaviour (always-on protections block in both modes)

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:50:22 -08:00
1 parent 5f9beb27cd
commit d89f2bd1ac
2 files changed
+13 -13

No files matched your search

+12 -12
View File
@@ -18,22 +18,22 @@ import Support from '~/content/partials/support-link.mdx';
## Global WAF mode
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)**.
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**.
### 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. |
| **Detect only** | Rules are evaluated and logged to the WAF audit log. A small set of always-on, high-confidence protections still **blocks in this mode too**: probes for sensitive files (`/etc/passwd`, `.env`, `.git`), remote command execution, PHP and Java code injection (including Log4Shell), restricted file types such as `.bak` and `.sql`, and known CVE exploits. Everything else is logged only. |
| **Enforce** | The same always-on protections, plus two body checks: a complete multipart or JSON request body that fails to parse is rejected, and so is a JSON body with more than 1000 arguments (both return HTTP 400). 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.
The two modes are much closer than their names suggest. In both, a request that only trips SQL injection, cross-site scripting or scanner rules is logged and still served, however high its anomaly score. 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 type="note" title="Detect only is not a no-block mode">
The always-on protections are built into the WAF image and switch blocking on for the single request that matches them, so they apply in **Detect only** as well. When one of them matches, the whole request is blocked, even if SQL injection or scanner rules also fired on it. 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.
@@ -54,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`, `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.
- **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 either mode (the rule `949110` that totals the score blocks only a request that has already matched one of the always-on protections). 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">
@@ -79,8 +79,8 @@ Every change customers have made themselves (for example excluding a rule on the
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 **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.
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`; these block in both modes).
4. Switch the mode to **Enforce** in Server Settings → Security. This adds the body-parse and JSON-argument-count rejections; the always-on protections were already active.
### Mute a noisy rule
@@ -95,7 +95,7 @@ The WAF produces two different kinds of records, and they live in different plac
| 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. |
| **Logged detections** — rules that matched but let the request through (in either mode, every rule outside the always-on set) | **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.
@@ -131,9 +131,9 @@ Customer reports a request was wrongly blocked? The branded 403 page shows a **r
## Troubleshooting
**A rule shows enabled but doesn't fire.** Check that the global mode is **Detect only** or **Enforce (high-confidence)**. **Off** bypasses every rule.
**A rule shows enabled but doesn't fire.** Check that the global mode is **Detect only** or **Enforce**. **Off** bypasses every rule.
**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.
**A request matched a rule but was not blocked.** Expected: in both modes only the always-on high-confidence rules block (plus, in Enforce, unparsable bodies and oversized JSON). 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.
@@ -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. 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/).
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 both **Detect only** and **Enforce** modes 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