5 Commits
Author SHA1 Message Date
pmb 946c2b9e01 Block abusive IPs after repeated failed plan lookups
Port 79 mostly attracts HTTP/SIP probes, TLS handshakes, and username
guessers -- none of which resolve to a plan file. Treat any request that
fails to read a plan as an "offense" and timestamp it against the source
IP.

Add BanTracker (ban.hpp/ban.cpp): a per-IP rolling-window offender list.
When an IP has more than 3 offenses still inside a 24h window, its
connections are dropped without being read or answered; timestamps older
than the window are pruned so a blocked IP frees itself automatically.
State is in-memory (single io_context thread, no locking); the clock is
injected for testability. A periodic sweeper keeps the map bounded.

Legitimate lookups that hit a real plan never count, which also
frustrates username enumeration. Unit tests in test_ban.cpp.
2026-06-15 16:23:58 -07:00
waffle2k df160fafca meson: fix build for FreeBSD/clang compatibility
Remove GCC-specific static link args (-static, -static-libgcc,
-static-libstdc++) that fail under clang. Add threads_dep via
dependency('threads') to all targets so Boost ASIO's pthread
usage links correctly on FreeBSD where clang does not pull it in
implicitly. Linux/GCC builds are unaffected.
2026-05-06 23:50:54 -07:00
pmb 977ca7ce7b Add tests for the real filesystem path 2025-06-25 17:36:49 -07:00
pmb e880f6ba1d Switch to using a filesystem class for better testing 2025-06-25 11:59:07 -07:00
pmb f71f1c9b11 Initial commit
Add .gitignore to exclude VSCode workspace files and build artifacts
2025-06-24 15:28:09 -07:00