docs: say SWW_WAF_MAX_BANS bounds only the bans for limits and attacks
check / check (push) Successful in 4m40s

The bans for AbuseIPDB's blacklist do not count toward SWW_WAF_MAX_BANS,
but SPEC.md and the README still said it bounds the bans and so the
memory, docs/settings.md still called it all of waf's own bans, and the
size of bans.json in docs/state-files.md left out the 10,000 or more
bans a free account's blacklist adds.

Model: opus-5-5
This commit is contained in:
clawbot committed 2026-11-19 09:18:14 +00:00
1 parent 3060788ca3
commit b10986eae1
4 files changed
+16 -12

No files matched your search

+3 -2
View File
@@ -630,8 +630,9 @@ status for a size or time limit, such as `413` for a body too large.
- A client is one IPv4 address or one IPv6 netblock of - A client is one IPv4 address or one IPv6 netblock of
`SWW_WAF_IPV6_GROUP_PREFIX`, since one abuser usually controls a whole /64. `SWW_WAF_IPV6_GROUP_PREFIX`, since one abuser usually controls a whole /64.
- Each limit is counted over a sliding window with a few integers per client. - Each limit is counted over a sliding window with a few integers per client.
The table of clients and the table of bans each have a bound The table of clients and the bans for limits and attacks each have a bound
(`SWW_WAF_MAX_TRACKED_CLIENTS`, `SWW_WAF_MAX_BANS`), so memory is bounded too. (`SWW_WAF_MAX_TRACKED_CLIENTS`, `SWW_WAF_MAX_BANS`). The bans for AbuseIPDB's
blacklist are bounded by the blacklist. So memory is bounded too.
- A ban refuses every request from its netblock until it ends. Requests refused - A ban refuses every request from its netblock until it ends. Requests refused
under a ban count toward no limit. A permanent ban ends only when an admin under a ban count toward no limit. A permanent ban ends only when an admin
lifts it. lifts it.
+8 -7
View File
@@ -239,13 +239,14 @@ apply.
load. load.
- Memory is bounded. When the table of clients holds - Memory is bounded. When the table of clients holds
`SWW_WAF_MAX_TRACKED_CLIENTS`, the least recently seen client is dropped `SWW_WAF_MAX_TRACKED_CLIENTS`, the least recently seen client is dropped
first, with its history. The bans are bounded by `SWW_WAF_MAX_BANS` (see first, with its history. The bans for broken limits and clear signs of attack
"Bans"). The GeoJS answers, the reputation verdicts and scores, the DNS are bounded by `SWW_WAF_MAX_BANS` (see "Bans"). Those for AbuseIPDB's
queries under way and the anomaly counters have fixed bounds, listed under blacklist are bounded by the blacklist (see "Reputation"). The GeoJS answers,
"Fixed limits" in `docs/settings.md`. Past its bound, the GeoJS answer or the reputation verdicts and scores, the DNS queries under way and the anomaly
anomaly counter used longest ago goes first, and the verdict or score fetched counters have fixed bounds, listed under "Fixed limits" in `docs/settings.md`.
longest ago. Past the bound on DNS queries under way, a zone is asked at the Past its bound, the GeoJS answer or anomaly counter used longest ago goes
client's next request. first, and the verdict or score fetched longest ago. Past the bound on DNS
queries under way, a zone is asked at the client's next request.
## Bans ## Bans
+2 -2
View File
@@ -42,8 +42,8 @@ chooses between the two (see "The image's command" below).
client's group, from 32 to 128. client's group, from 32 to 128.
- `SWW_WAF_MAX_TRACKED_CLIENTS` (default `20000`): the most clients kept, a - `SWW_WAF_MAX_TRACKED_CLIENTS` (default `20000`): the most clients kept, a
whole number above zero. whole number above zero.
- `SWW_WAF_MAX_BANS` (default `5000`): how many of its own bans `waf` keeps, a - `SWW_WAF_MAX_BANS` (default `5000`): the most bans `waf` keeps for broken
whole number above zero. limits and attacks, a whole number above zero.
## Tokens ## Tokens
+3 -1
View File
@@ -157,7 +157,9 @@ A cache file. routewatch's answers from the last hour, one per line:
- `bans.json`: about 1.2 KiB per ban, at most about 2.5 KiB, so about 6 MiB at - `bans.json`: about 1.2 KiB per ban, at most about 2.5 KiB, so about 6 MiB at
the default `SWW_WAF_MAX_BANS`. Written every 15 minutes, a full file comes to the default `SWW_WAF_MAX_BANS`. Written every 15 minutes, a full file comes to
about 600 MiB of writes a day, and a hundred new bans a day add about 600 MiB about 600 MiB of writes a day, and a hundred new bans a day add about 600 MiB
more. more. A ban for AbuseIPDB's blacklist takes about 1 KiB. A free account's
blacklist lists 10,000 clients, so it adds at least 10 MiB, and 1 GiB of
writes a day.
- `lookups.json`: about 150 bytes per answer, under 1.5 GiB of writes a day when - `lookups.json`: about 150 bytes per answer, under 1.5 GiB of writes a day when
full. full.
- `routewatch.json`: about 120 bytes per answer, at most about 12 MiB. - `routewatch.json`: about 120 bytes per answer, at most about 12 MiB.