servewaf answers rproxy's question about each request and takes its report (closes #170)
check / check (push) Successful in 10m27s

`smallwebwaf servewaf` runs today's checks on the visitor's request each
question carries, answers rproxy, and passes nothing to an app. rproxy reports
every request servewaf answered. A report counts an allowed request's bytes and
writes servewaf's second log line. The table holds a copy of what a report
needs, never the request, so a report cannot reach a request being handled.

Judgement call: a question's body is read before any check; over 64 KiB gets 400.
Judgement call: a report's bytes and durations have ceilings, so they cannot overflow.
Judgement call: a `close` disposition for SWWAF_BAN_RESPONSE=close.

Model: opus-5-5
This commit is contained in:
2026-11-04 23:07:20 +00:00
parent 718a2c94b2
commit 872172e958
28 changed files with 2919 additions and 143 deletions
+5
View File
@@ -348,6 +348,9 @@ pinned.
[`docs/settings.md`](docs/settings.md)).
- The state files live in `/var/lib/smallwebwaf`. A volume mounted there keeps
them across a deploy.
- `smallwebwaf servewaf` runs the same checks for the sites that ask it about
each request, and passes nothing to an app (see "`servewaf`" in
[`SPEC.md`](SPEC.md)).
- `docker stop` stops both processes at once. `smallwebwaf` gives the requests
in progress five seconds to finish, so the app must keep answering for five
seconds after `SIGTERM`.
@@ -360,6 +363,8 @@ what each does.
## TODO
- Planned, as "Planned, not built" in [`SPEC.md`](SPEC.md) describes:
- `smallwebwaf rproxy`, the reverse proxy in front of each app that asks
`smallwebwaf servewaf` about each request;
- sharing bans between the instances of several apps;
- sending the log over RELP.