Appearance
Attack and automation scores Since v0.2
Every logged request can carry an attack score and an automation score. They let you sort and filter requests by how much evidence the product found, and they can drive rules. Neither is a probability.
Before you begin
- The attack score needs the signature module to have run. The automation score needs the bot module on.
- Role:
operatorcreates rules from a filter.
Attack score
The score summarises how strongly the signature module judged a request. It maps the request's anomaly score; it is not a model.
A score is not a probability
A score of 90 does not mean a 90 percent chance of an attack, and 50 does not mean one in two. The number only orders requests by how much rule evidence they carry, relative to the application's threshold. Sort and filter with it (attack.score >= 75), and judge a block from the matched rules.
Score = 1 + floor(98 * raw / (raw + T)), where raw is the request's anomaly score and T is the application's inbound anomaly threshold (default 5). A raw score of 0 gives 1, a raw score equal to T gives 50, three times T gives 74, and nine times T gives 89.
Class (attack.class) | Score | Meaning |
|---|---|---|
attack | 75 or more | Strong evidence. |
likely_attack | 50 to 74 | The request reached the threshold: what the policy would block. |
unlikely_attack | 2 to 49 | Some evidence, below the threshold. |
clean | 1 | The signatures ran and found nothing. |
none | none | The signature module did not score the request: module off, skipped by an allow rule, failed or out of time. |
The bands move with the threshold. With T = 10, a raw score of 10 is 50, where with T = 5 it is 66. So likely_attack always means "at or over what this application blocks". Compare scores across applications only when their thresholds match, and expect the bands to shift when you change the threshold or paranoia level.
Sub-scores attack.sqli, attack.xss, attack.cmd, attack.file and attack.other use the same formula on the part of the raw score that came from rules of that kind (by the rule's attack tag; command injection and path traversal virtual patches count too). When the signatures ran, a class with no match is 1, not 0.
The event detail lists the matched rules and what each added. The traffic record shows the score, raw score, threshold and the split.
Automation score
The automation score maps the client's bot score s with 1 + floor(98 * s / (s + L)), where L is the first step of the application's response ladder, so 50 means "would get the first action". A direct refusal (deny-listed fingerprint, blocked category) scores 99.
The class (automation.class) is chosen in this order:
- A refusal is
automated, even for a verified bot. - A verified catalogue bot is
verified. - A client holding a valid challenge token is
likely_human, whatever its score. - 75 or more is
automated, 50 to 74 islikely_automated, below 50 islikely_human. nonewhen the bot module is off.
Detection IDs and tags (automation.detection, automation.tag) name the signals that fired, for example bot.behavior.crawl. Tags group them: fingerprint, catalog, behavior, token, login, signature, list.
Use scores in rules
A custom rule whose expression uses attack_score, attack_class, attack_sqli, attack_xss, attack_cmd, attack_file, attack_other, automation_score or automation_class is a score rule. It runs right after the signatures, not with the other access rules, because the scores do not exist earlier. Its events name the module scorerules, and the rule form says "Runs after signatures". trust is not allowed on a score rule. A request with no score has score 0 and class none.
Start with log
Give a new score rule action log and check Events before you switch it to block.
Create a rule from a filter
text
1. On the Traffic log, Events or Analytics page, set the filter.
2. Select Create rule from filter. The draft condition is shown.
3. Copy it into the custom rule form of an application's Access rules, then preview and apply.sh
waap analytics to-rule -q 'client.asn = 64666 and path ^= "/login"' -name login-asntext
POST /v1/analytics/to-ruleThe draft uses fields known when the request arrives: host, path, method, client, country, user agent, scores, and the network and TLS variables below. These are refused and listed:
- Fields known only after the answer (status, server pool, timings, response content type).
- Fields inspection does not know at request time: the TLS cipher (only the data plane records it); city, region, continent, device, browser and OS (enrichment adds them when the record is stored); path extension, scheme and the other stored-only fields.
- A CIDR value (use the rule's
cidrscondition).
The link's action is kept only when it is log or block. Any other value (for example trust or allow) becomes log, so a link someone sends you cannot pre-fill a rule that lets traffic through. Nothing is applied until you preview and apply.
Network and TLS variables in rules
Any custom rule expression can use these variables.
| Variable | Value | Filter field |
|---|---|---|
client.asn | AS number (integer; 0 when unknown) | client.asn |
client.as_org | AS organisation | client.as_org |
tls.ja3, tls.ja4 | TLS client fingerprints (empty on plain HTTP) | tls.ja3, tls.ja4 |
tls.version | TLSv1.0 to TLSv1.3 (empty on plain HTTP) | tls.version |
tls.sni | Server name from the handshake, lower case | tls.sni |
request.ja4h | JA4H HTTP fingerprint | http.ja4h |
request.referer_host | Host of the Referer, lower case (empty without one) | referer.host |
The AS comes from the ASN database set in the enrichment settings. Without it client.asn is 0 and client.as_org is empty. For details, see Fingerprints and enrichment. Each node looks an address up once and keeps it in a bounded cache of 64 K addresses, so a rule on the AS costs microseconds. Values are looked up only for applications whose expressions name them.
Example: after a week in log, block a hosting network that sends credential stuffing: client.asn == 64666 && request.path.startsWith("/login").
A fingerprint matches a program, not a person
Many users share one browser's JA3 or JA4. Check Events and waap analytics top -by tls.ja4 before you block on a fingerprint. As always, a new application is in detect mode, and the rule only logs until the application or the access module is in block mode.
Troubleshooting
A score rule never fires
- Cause: the signature module did not run for that request, so the score is 0 and the class
none. - Fix: check the signature module is on and not skipped by an allow rule.
"Create rule from filter" refuses a field
- Cause: the field is known only after the answer or only after storage.
- Fix: rebuild the filter from request-time fields.