Appearance
Rule pre-filter Since v0.2
Before the CRS protocol and attack rules (920xxx to 944xxx) run on a request, the engine leaves out each rule whose required text is in none of the values the rule reads. The result is the same as running every rule: the same verdict, matches, values and scores. Only the time differs. For a 4 KiB JSON body, rule time drops from about 20 ms to a few ms.
Before you begin
- Role:
operatorfor the application. - Leave the pre-filter on. Turn it off only to compare when you suspect a missed detection.
How it decides
The required text is worked out from the rule itself when the rule set loads: the literals every match must contain, after the rule's own decoding steps. For union\s+select that is union and select.
A rule is never skipped when:
- a value could change under the rule's decoding steps in a way the check does not follow (a
%,&or\before URL, entity or escape decoding, comment markers before comment removal, a non-ASCII byte where the pattern needs it); - the rule reads variables the check cannot list (XML);
- the request is over the check's bounds, 4 MiB or 20,000 values: then every rule runs.
Rules that base64-decode a value first (934100, 934101, 934160) are checked on the decoded text. Our own rules (2000xx), rule 949 and the response rules always run. A virtual patch that counts rules (skip:) or changes CRS rules turns the check off for that application.
Turn the pre-filter off
text
1. Open Applications > All applications, and select the application.
2. In the application menu, open Request checks > Signatures.
3. Turn off Skip rules that cannot match.
4. Select Preview changes, then Apply.sh
waap apps set -app shop -m "compare without pre-filter" policy.signatures.prefilter=falseyaml
applications:
- name: shop
policy:
signatures:
prefilter: falseSettings reference
| Setting | What it does | Default | Allowed values | Applies in |
|---|---|---|---|---|
Skip rules that cannot match (policy.signatures.prefilter) | Leaves out CRS rules that provably cannot match the request. | true | true, false | signatures enabled |
Check what was skipped
The request trace, signatures step, says how many rules were skipped per CRS file, for example pre-filter skipped 179/190 rules (required text absent): 930 1/3, 934 14/14, or why nothing was skipped. Open it under Requests, then the request, then the trace.
Metrics: waap_signature_prefilter_requests_total{result="applied|fallback|off"} and waap_signature_prefilter_rules_skipped_total.
Limits
| Limit | Value |
|---|---|
| Request size the check handles | 4 MiB |
| Values the check handles | 20,000 |