Appearance
Rule exclusions Since v0.1
An exclusion (the configuration calls it an exception) narrows what the policy enforces for matching requests. It is the fix for a false positive. Each exclusion has exactly one effect: ignore rules, change the request body limit, or skip inspection.
Before you begin
- Role:
operatorfor the application. - The quickest start is an event: Propose exception on the event page, or
waap except EVENT-ID. The proposal is as narrow as the event allows. For details, see Find, explain and fix a false positive.
Add an exclusion
text
1. Open Applications > All applications, and select the application.
2. In the application menu, open Request checks > Access and rate limits.
3. Open the Exceptions tab and select Add exception.
4. Enter a Name and a reason (Why), then narrow it with Paths and Methods.
5. Enter Ignore rules, and optionally Only in fields.
6. Select Preview changes, add a comment and select Apply.sh
waap rules get -app shop -list exceptions > exceptions.yaml
# edit exceptions.yaml, then preview and apply
waap rules set -app shop -list exceptions -f exceptions.yaml -dry-run
waap rules set -app shop -list exceptions -f exceptions.yaml -m "search form sends SQL words"yaml
# exceptions.yaml (waap rules set), or applications[].policy.exceptions in the configuration
- name: search-sqli
comment: product search takes free text
when:
paths: ["/search"]
methods: [GET]
ignore_rules: [942100, "942200-942299"]
in: ["arg:q"]Keep it narrow
Name the path, the rule and the field. An exclusion with no path and no field disables the rule for the whole application.
Raise the body limit for a path
text
1. Open the Exceptions tab and select Add exception.
2. Enter a Name and Paths (required for a limit).
3. Set Request body limit, for example 10MiB.
4. Select Preview changes, then Apply.sh
waap rules set -app shop -list exceptions -f exceptions.yaml -m "allow larger uploads"yaml
- name: upload-size
when: {paths: ["/upload"]}
limits: {request_body: 10MiB}Skip inspection for static files
text
1. Open the Exceptions tab and select Add exception.
2. Enter a Name, Paths and Methods (GET, HEAD).
3. Turn on Skip inspection.
4. Select Preview changes, then Apply.sh
waap rules set -app shop -list exceptions -f exceptions.yaml -m "skip static files"yaml
- name: static-files
when: {paths: ["/static/*"], methods: [GET, HEAD]}
skip_inspection: trueUse sparingly
No module inspects a request that matches a skip. Limit it to static paths.
Review or remove an exclusion
Open the Exceptions tab to see each exclusion's paths, methods, ignored rules, fields and limits. To remove one, select Remove Exception, then Preview changes and Apply. With the CLI, edit the list returned by waap rules get and set it again.
Settings reference
Exception
| Setting | What it does | Default | Allowed values | Applies in |
|---|---|---|---|---|
Name (name) | Identifies the exclusion in configuration and events. | none (required) | lowercase letters, digits and dashes, up to 63 characters; unique | all |
Why (comment) | Records the reason. | none | up to 500 bytes | all |
Paths (when.paths) | Only requests to these paths match. | none (every path) | up to 100; exact, or a prefix ending in *; start with /; no query string | all |
Methods (when.methods) | Only requests with these methods match. | none (any method) | up to 100; uppercase | all |
Ignore rules (ignore_rules) | Rules that do not count for matching requests. | none | up to 100 rule IDs (942100), ranges (942000-942999), API rules (api.json.*) or bot, cookie, session, CSRF, CORS, data leak, file and positive-model rules by name | one effect per exclusion |
Only in fields (in) | Ignore the rules only in these fields. | none (whole request) | up to 100 entries of kind:name; kinds arg, header, cookie, json, xml, param | with Ignore rules only |
Request body limit (limits.request_body) | Replaces the application's body limit for matching requests. | none (application limit) | size from 1 byte to the product maximum | needs Paths |
Skip inspection (skip_inspection) | No module inspects matching requests. | false | true, false | needs Paths and Methods GET or HEAD only |
Client in lists, JA4 fingerprints, JA4H fingerprints (when.ip_lists, when.ja4, when.ja4h) | Narrow a bot-rule exclusion to clients. | none | list names, fingerprints | bot rules only |
Field names: arg:q (a query or form parameter), header:referer, cookie:session. API rules use JSON pointers and XML paths that start with / (json:/content/html). Parameters described by an API or learned model use param:query.limit. The rule api.xml.dtd is never excepted.
Examples
Ignore the SQL injection range for one search parameter:
yaml
- name: search-sqli
when: {paths: ["/search"]}
ignore_rules: ["942100-942199"]
in: ["arg:q"]Allow a referer header that looks like an attack to a rule:
yaml
- name: partner-referer
ignore_rules: [941100]
in: ["header:referer"]Limits
| Limit | Value |
|---|---|
| Exclusions per application | 1000 |
| Paths, methods, rules or fields per exclusion | 100 each |
| Comment | 500 bytes |
| Field name | 256 bytes |
| Effects per exclusion | exactly one |
Troubleshooting
Preview refuses: must have exactly one of ignore_rules, limits or skip_inspection
- Cause: an exclusion with no effect or with two effects.
- Fix: split it into two exclusions.
Preview refuses: skip_inspection is only allowed for GET and HEAD
- Cause: a skip with another method.
- Fix: list only
GETandHEAD, or use Ignore rules instead.
The rule still matches after adding the exclusion
- Cause: the path or field does not match, or the matched variable is in another field.
- Check: the event shows the matched field; compare it with Only in fields.
- Fix: correct the path pattern (paths match without the query string) or the field.