diff --git a/README.md b/README.md index 3794544..52cbcd6 100644 --- a/README.md +++ b/README.md @@ -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 `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. - The table of clients and the table of bans each have a bound - (`SWW_WAF_MAX_TRACKED_CLIENTS`, `SWW_WAF_MAX_BANS`), so memory is bounded too. + The table of clients and the bans for limits and attacks each have a bound + (`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 under a ban count toward no limit. A permanent ban ends only when an admin lifts it. diff --git a/SPEC.md b/SPEC.md index 0a98378..25f3373 100644 --- a/SPEC.md +++ b/SPEC.md @@ -239,13 +239,14 @@ apply. load. - Memory is bounded. When the table of clients holds `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 - "Bans"). The GeoJS answers, the reputation verdicts and scores, the DNS - queries under way and the anomaly counters have fixed bounds, listed under - "Fixed limits" in `docs/settings.md`. Past its bound, the GeoJS answer or - anomaly counter used longest ago goes 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. + first, with its history. The bans for broken limits and clear signs of attack + are bounded by `SWW_WAF_MAX_BANS` (see "Bans"). Those for AbuseIPDB's + blacklist are bounded by the blacklist (see "Reputation"). The GeoJS answers, + the reputation verdicts and scores, the DNS queries under way and the anomaly + counters have fixed bounds, listed under "Fixed limits" in `docs/settings.md`. + Past its bound, the GeoJS answer or anomaly counter used longest ago goes + 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 diff --git a/docs/settings.md b/docs/settings.md index 63e6472..fa28d95 100644 --- a/docs/settings.md +++ b/docs/settings.md @@ -42,8 +42,8 @@ chooses between the two (see "The image's command" below). client's group, from 32 to 128. - `SWW_WAF_MAX_TRACKED_CLIENTS` (default `20000`): the most clients kept, a whole number above zero. -- `SWW_WAF_MAX_BANS` (default `5000`): how many of its own bans `waf` keeps, a - whole number above zero. +- `SWW_WAF_MAX_BANS` (default `5000`): the most bans `waf` keeps for broken + limits and attacks, a whole number above zero. ## Tokens diff --git a/docs/state-files.md b/docs/state-files.md index 8f8e261..7b6a7ca 100644 --- a/docs/state-files.md +++ b/docs/state-files.md @@ -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 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 - 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 full. - `routewatch.json`: about 120 bytes per answer, at most about 12 MiB.