what are these and why are they off? #410

Open
opened 2026-11-19 05:58:48 +01:00 by sneak · 4 comments
Owner

SWW_WAF_ANOMALY_CLIENT_REQUESTS_PER_MINUTE off Alert when one client makes more requests than this in a minute, a count.
SWW_WAF_ANOMALY_CLIENT_REQUESTS_PER_HOUR off Alert when one client makes more requests than this in an hour, a count.
SWW_WAF_ANOMALY_CLIENT_BYTES_PER_MINUTE off Alert when more than this many bytes, as SWW_WAF_BYTES_COUNTED counts them, are counted for one client in a minute, a size.
SWW_WAF_ANOMALY_CLIENT_BYTES_PER_HOUR off Alert when more than this many bytes, as SWW_WAF_BYTES_COUNTED counts them, are counted for one client in an hour, a size.
SWW_WAF_ANOMALY_NET_REQUESTS_PER_MINUTE off Alert when the netblock around a client makes more requests than this in a minute, a count.
SWW_WAF_ANOMALY_NET_REQUESTS_PER_HOUR off Alert when the netblock around a client makes more requests than this in an hour, a count.
SWW_WAF_ANOMALY_NET_BYTES_PER_MINUTE off Alert when more than this many bytes, as SWW_WAF_BYTES_COUNTED counts them, are counted for the netblock around a client in a minute, a size.
SWW_WAF_ANOMALY_NET_BYTES_PER_HOUR

SWW_WAF_ANOMALY_CLIENT_REQUESTS_PER_MINUTE off Alert when one client makes more requests than this in a minute, a count. SWW_WAF_ANOMALY_CLIENT_REQUESTS_PER_HOUR off Alert when one client makes more requests than this in an hour, a count. SWW_WAF_ANOMALY_CLIENT_BYTES_PER_MINUTE off Alert when more than this many bytes, as SWW_WAF_BYTES_COUNTED counts them, are counted for one client in a minute, a size. SWW_WAF_ANOMALY_CLIENT_BYTES_PER_HOUR off Alert when more than this many bytes, as SWW_WAF_BYTES_COUNTED counts them, are counted for one client in an hour, a size. SWW_WAF_ANOMALY_NET_REQUESTS_PER_MINUTE off Alert when the netblock around a client makes more requests than this in a minute, a count. SWW_WAF_ANOMALY_NET_REQUESTS_PER_HOUR off Alert when the netblock around a client makes more requests than this in an hour, a count. SWW_WAF_ANOMALY_NET_BYTES_PER_MINUTE off Alert when more than this many bytes, as SWW_WAF_BYTES_COUNTED counts them, are counted for the netblock around a client in a minute, a size. SWW_WAF_ANOMALY_NET_BYTES_PER_HOUR
clawbot added the needs-decision label 2026-11-19 06:09:13 +01:00
Collaborator

No PR: this is a question, answered below. Building anything waits on your answer.

What they are. They are alarms that never block anything. waf counts requests and body bytes over each minute and each hour. When a count passes its threshold, it sends one anomaly alert to the alert destinations: webhook, Slack or ntfy. Nobody is refused or banned. There are five sets of four thresholds. Your list shows two of them:

  • CLIENT: one client address. An IPv6 client is grouped by SWW_WAF_IPV6_GROUP_PREFIX.
  • NET: the netblock around a client: a /24 for IPv4, a /48 for IPv6.
  • ASN: one AS number.
  • TOTAL: the whole service.
  • WATCHED_NET: each named netblock in SWW_WAF_ANOMALY_WATCHED_NETS.

They exist to catch a scraper spread over many addresses. Each address stays under the per-client rate limits, which ban, but the netblock or the AS number as a whole is busy. The alert tells you which AS number to throttle with SWW_WAF_TAG_LIMIT_PERCENT.

Why they are off. The spec gives two reasons:

  • An alert goes nowhere until you set a destination, and every destination is unset by default.
  • What is unusual depends on each site's normal traffic. A default that fits a small blog would fire all day on a busy forge.

That default came from the spec as agents wrote it. I found no ruling from you on it.

The catch with defaults. A default sends nothing until a destination is set, so it is harmless before then. After that, a wrong one is noise. Example: NET_REQUESTS_PER_MINUTE at 600 alerts when one /24 makes 10 requests a second. That is normal for a busy site whose visitors share one mobile carrier's addresses. A TOTAL default would be a guess about every site's size. The per-client thresholds matter mainly for clients exempt from the rate limits, which ban at 120 requests a minute by default.

Options:

  • Keep off: no change.
  • Defaults for NET and ASN: a requests-per-minute and a requests-per-hour default for each, set well above the per-client rate limits. Everything else stays off.

Recommendation: Keep off. A threshold only means something once you know a site's traffic, and the metrics show that. Should I build Defaults for NET and ASN instead?

Model: opus-5-5

No PR: this is a question, answered below. Building anything waits on your answer. **What they are.** They are alarms that never block anything. `waf` counts requests and body bytes over each minute and each hour. When a count passes its threshold, it sends one `anomaly` alert to the alert destinations: webhook, Slack or ntfy. Nobody is refused or banned. There are five sets of four thresholds. Your list shows two of them: - `CLIENT`: one client address. An IPv6 client is grouped by `SWW_WAF_IPV6_GROUP_PREFIX`. - `NET`: the netblock around a client: a `/24` for IPv4, a `/48` for IPv6. - `ASN`: one AS number. - `TOTAL`: the whole service. - `WATCHED_NET`: each named netblock in `SWW_WAF_ANOMALY_WATCHED_NETS`. They exist to catch a scraper spread over many addresses. Each address stays under the per-client rate limits, which ban, but the netblock or the AS number as a whole is busy. The alert tells you which AS number to throttle with `SWW_WAF_TAG_LIMIT_PERCENT`. **Why they are off.** The spec gives two reasons: - An alert goes nowhere until you set a destination, and every destination is unset by default. - What is unusual depends on each site's normal traffic. A default that fits a small blog would fire all day on a busy forge. That default came from the spec as agents wrote it. I found no ruling from you on it. **The catch with defaults.** A default sends nothing until a destination is set, so it is harmless before then. After that, a wrong one is noise. Example: `NET_REQUESTS_PER_MINUTE` at `600` alerts when one `/24` makes 10 requests a second. That is normal for a busy site whose visitors share one mobile carrier's addresses. A `TOTAL` default would be a guess about every site's size. The per-client thresholds matter mainly for clients exempt from the rate limits, which ban at `120` requests a minute by default. **Options:** - **Keep off**: no change. - **Defaults for `NET` and `ASN`**: a requests-per-minute and a requests-per-hour default for each, set well above the per-client rate limits. Everything else stays off. Recommendation: **Keep off**. A threshold only means something once you know a site's traffic, and the metrics show that. Should I build **Defaults for `NET` and `ASN`** instead? Model: opus-5-5
sneak was assigned by clawbot 2026-11-19 06:23:51 +01:00
Author
Owner

i don't know what an "anomaly client" is.

i don't know what an "anomaly client" is.
Author
Owner

SWW_WAF_ANOMALY_CLIENT_REQUESTS_PER_MINUTE off Alert when one client makes more requests than this in a minute, a count.

this suggests that setting this setting will mark a client as anomalous if they do more than this number of r/min. what it doesn't tell me is what "anomaly" means. do they get banned? logged? rate limited?

`SWW_WAF_ANOMALY_CLIENT_REQUESTS_PER_MINUTE off Alert when one client makes more requests than this in a minute, a count.` this suggests that setting this setting will mark a client as anomalous if they do more than this number of r/min. what it doesn't tell me is what "anomaly" means. do they get banned? logged? rate limited?
Collaborator

Plainly: nothing happens to the client. These settings only send you a message.

"Anomaly" is just the code's name for these alerts. There is no "anomaly client" state; the CLIENT in the name means "one client address", as opposed to its netblock, its AS number or the whole site.

When, say, one address makes more requests in a minute than SWW_WAF_ANOMALY_CLIENT_REQUESTS_PER_MINUTE, waf sends one alert to your webhook, Slack or ntfy saying so. The client is not banned, not rate limited and not logged any differently; its requests go on being handled exactly as before. Banning and rate limiting are done by other settings (the per-client rate limits, which ban at 120 requests a minute by default).

You're right that the setting's description doesn't say this. I've filed a fix so each of these descriptions says it only sends an alert and blocks nothing.

The question, reworded: should these alert-only settings stay off by default (recommended, since every alert destination is unset by default and normal traffic differs from site to site), or should the netblock and AS-number ones get default limits?

Model: opus-5-5

Plainly: nothing happens to the client. These settings only send you a message. "Anomaly" is just the code's name for these alerts. There is no "anomaly client" state; the `CLIENT` in the name means "one client address", as opposed to its netblock, its AS number or the whole site. When, say, one address makes more requests in a minute than `SWW_WAF_ANOMALY_CLIENT_REQUESTS_PER_MINUTE`, `waf` sends one alert to your webhook, Slack or ntfy saying so. The client is not banned, not rate limited and not logged any differently; its requests go on being handled exactly as before. Banning and rate limiting are done by other settings (the per-client rate limits, which ban at 120 requests a minute by default). You're right that the setting's description doesn't say this. I've filed a fix so each of these descriptions says it only sends an alert and blocks nothing. The question, reworded: should these alert-only settings stay off by default (recommended, since every alert destination is unset by default and normal traffic differs from site to site), or should the netblock and AS-number ones get default limits? Model: opus-5-5
Sign in to join this conversation.
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/smallwebwaf#410