waf: a verdict carries the status the visitor gets (closes #443) #482

Merged
clawbot merged 2 commits from issue-443-verdict-status into next 2026-11-20 02:42:09 +01:00
Collaborator

Closes #443.

Each heuristic that refuses a request now sets the status on its verdict. check copies the verdict's status and action into the refusal, or in observe mode notes them, with no switch over the action. refusalLimit passes the status of the verdict that refused the request, or would have, to the ban's notes; its switch over wouldAction is gone.

New fields:

  • verdict.status: what the visitor is answered with; 0 closes the connection.
  • decision.refusalStatus: the status of the verdict that refused the request, or in observe mode would have. check sets it.
  • banResponse (SWW_WAF_BAN_RESPONSE) on denyNets, tagDeny, countries, blocklists, dnsbl and abuseIPDB.

Removed: refusalLimit.banResponse and the request.banResponse method. activeBan, trapPaths and ruleFiles read banMaker.banResponse, which already held the setting.

Worth knowing:

  • In enforce mode refusalLimit used to read rq.out.status. That equals the refusal's status, 0 for close included, since deny writes a close past rq.out.
  • In observe mode the old switch left the status as sent for actions it did not list, such as a timed-out check. refusalLimit acts only on a request with attack, blockedByBlockRule or blockedByCoreRuleSet set. Only the heuristic that refuses the request sets those flags, and its verdict is always 403 or SWW_WAF_BAN_RESPONSE, so no status the ban's notes give changes.

Model: opus-5-5

Closes https://git.eeqj.de/sneak/smallwebwaf/issues/443. Each heuristic that refuses a request now sets the status on its verdict. `check` copies the verdict's status and action into the refusal, or in observe mode notes them, with no `switch` over the action. `refusalLimit` passes the status of the verdict that refused the request, or would have, to the ban's notes; its `switch` over `wouldAction` is gone. New fields: - `verdict.status`: what the visitor is answered with; 0 closes the connection. - `decision.refusalStatus`: the status of the verdict that refused the request, or in observe mode would have. `check` sets it. - `banResponse` (`SWW_WAF_BAN_RESPONSE`) on `denyNets`, `tagDeny`, `countries`, `blocklists`, `dnsbl` and `abuseIPDB`. Removed: `refusalLimit.banResponse` and the `request.banResponse` method. `activeBan`, `trapPaths` and `ruleFiles` read `banMaker.banResponse`, which already held the setting. Worth knowing: - In enforce mode `refusalLimit` used to read `rq.out.status`. That equals the refusal's status, 0 for close included, since `deny` writes a close past `rq.out`. - In observe mode the old `switch` left the status as sent for actions it did not list, such as a timed-out check. `refusalLimit` acts only on a request with `attack`, `blockedByBlockRule` or `blockedByCoreRuleSet` set. Only the heuristic that refuses the request sets those flags, and its verdict is always 403 or `SWW_WAF_BAN_RESPONSE`, so no status the ban's notes give changes. Model: opus-5-5
clawbot added the needs-review label 2026-11-20 01:36:36 +01:00
clawbot added 1 commit 2026-11-20 01:36:36 +01:00
Each heuristic that refuses a request sets the status on its verdict.
check copies it into the refusal, or in observe mode notes it, and no
longer works the status out from the action. refusalLimit takes the
status from that verdict instead of from a switch over the action.

Model: opus-5-5
clawbot self-assigned this 2026-11-20 01:36:38 +01:00
clawbot added 1 commit 2026-11-20 02:20:24 +01:00
The doc comment of verdict said a verdict of afterAnswer or onReport
"bans and refuses nothing", which reads as banning nothing, while
refusalLimit and byteLimits give one only when they ban. It now says
that such a verdict refuses nothing.

Model: opus-5-5
Author
Collaborator

Verdict: PASS
Head: c61f054e50

Each refusing heuristic now sets the status on its verdict, check and refusalLimit no longer work it out from the action word, and the status and action of every refusal are unchanged in both modes.

Model: opus-5-5

Verdict: PASS Head: c61f054e50225b732fa0f9315d64d99b1d173879 Each refusing heuristic now sets the status on its verdict, `check` and `refusalLimit` no longer work it out from the action word, and the status and action of every refusal are unchanged in both modes. Model: opus-5-5
Author
Collaborator

Verdict: PASS
Head: 55216c34c6

Every refusing heuristic now sets the status on its verdict, check and refusalLimit take it from there with no comparison over an action word, and the status, action and ban notes of every refusal are unchanged in enforce and observe mode.

Model: opus-5-5

Verdict: PASS Head: 55216c34c63787ab6cbd5044e1a0e318efe184e8 Every refusing heuristic now sets the status on its verdict, `check` and `refusalLimit` take it from there with no comparison over an action word, and the status, action and ban notes of every refusal are unchanged in enforce and observe mode. Model: opus-5-5
clawbot merged commit 4774518cb3 into next 2026-11-20 02:42:09 +01:00
Sign in to join this conversation.