Expand description
§Kernel-level DDoS protection backed by Linux ipset + iptables
The production implementation of
hashiverse_lib::transport::ddos::ddos::DdosProtection used by the real server.
Layered on top of the in-RAM scoring logic from hashiverse-lib:
- Per-IP
DdosScoreaccumulates penalties for bad requests (e.g. invalid PoW, malformed packets) with linear time decay fromhashiverse_lib::tools::config::SERVER_DDOS_DECAY_PER_SECOND. - When a score crosses
hashiverse_lib::tools::config::SERVER_DDOS_SCORE_THRESHOLD, the IP is shelled out toipset addagainst the set named byhashiverse_lib::tools::config::SERVER_DDOS_IPSET_SET_NAME, which an operator-configurediptablesrule then drops at the kernel. - A short (≥10 s) throttle around the
ipsetcall prevents hammering the subprocess in edge cases.
Per-IP concurrent-connection caps are enforced via a HashMap<String, usize>
guarded by a parking_lot::Mutex, cutting off a single IP from monopolising all
hashiverse_lib::tools::config::SERVER_DDOS_MAX_CONNECTIONS_PER_IP slots. The
NET_ADMIN capability is required on the container — see the operator docs.
Structs§
- Ipset
Ddos Protection - Production DDoS protection backed by Linux
ipset.