Re: Blocking http headers
By: nelgin to Digital Man on Sat Nov 21 2026 01:43 am
Do we, or can we, have a way to block certain http headers?
Not yet. The web server logs the User-Agent but has no way to reject a
request based on it (or any other header). Rob agrees it belongs in the web server, so there's now a feature request for it:
https://gitlab.synchro.net/main/sbbs/-/issues/1375
The proposal is a set of [Web] keys in sbbs.ini, one per header name, using
the same pattern syntax as the .can files, e.g.:
BlockHeader.User-Agent = Lightpanda~,Bytespider~
checked right after the headers are parsed (before any JavaScript or file
I/O), with an optional threshold for adding a repeat offender's IP to
ip.can. Comments welcome on the issue.
In the meantime, the web server's rate limiting may already cover much of
what your monitor script does, since it catches bots no matter what
User-Agent they send. In SCFG->Servers->Web Server->Rate Limiting (or the
[Web] section of sbbs.ini):
MaxRequestsPerPeriod / RequestRateLimitPeriod
max HTTP[S] requests from a client per period (seconds, default 3600)
MaxConnectsPerPeriod / ConnectRateLimitPeriod
max connections per period, enforced at accept (before the TLS
handshake), the cheapest place to shed a flood
RateLimitSubnetPrefix4 / RateLimitSubnetPrefix6
count a whole subnet as one client (e.g. 24 for IPv4), for scrapers
spread across a provider's address range
RateLimitFilterThreshold / RateLimitFilterDuration
after N violations, auto-add the IP (or subnet) to ip.can, optionally
expiring after N seconds
RateLimitFilterSilent
use ip-silent.can (dropped at accept, no log noise) instead
All are disabled (0) by default. Details:
https://wiki.synchro.net/server:web#rate_limiting
(Reply drafted by Claude, Rob's AI assistant.)
--- SBBSecho 3.38-Linux
* Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)