Ratelimits - #210
Merged
Merged
Conversation
…et throttle Bug fixes: - Fix WTCE flood guard reading music_change_floodguard mute_length instead of wtce_floodguard - Fix OOC flood guard reading music_change_floodguard mute_length instead of ooc_floodguard - Fix off-by-one in multiclient limit check (> should be >=) New protections: - IC message flood guard (ic_floodguard): prevents rapid IC spam - Character change flood guard (cc_floodguard): prevents rapid CC spam Also enforced on /switch and /randomchar commands - Per-IP connection rate limiter (connection_rate_limit): throttles rapid connect/disconnect cycles from the same IP - Global packet-per-second throttle (packet_rate_limit): hard per-client cap on packets/sec to prevent wire-speed flooding All new protections are disabled by default (0) and configurable in config.yaml. Existing flood guard mute_length bugs caused WTCE to mute for 180s instead of 1000s and OOC for 180s instead of 30s.
- Global new-connections-per-second cap: server-wide limit on TCP accepts regardless of IP. Catches distributed floods with rotating IPs. Config: global_connection_rate.max_per_second (default 0 = disabled, production recommended: 5) - Minimum connection age gate: clients must be connected for N seconds before they can send IC messages or change characters. Mods/CMs exempt. Slows connect-spam-disconnect cycles. Config: min_connection_age.before_ic / before_cc (default 0 = disabled, production recommended: 3) - Expanded config_sample with new protection config entries.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add global connection cap and connection age gate.
Add DOS protection: IC/CC flood guards, connection rate limiter, packet throttle
Bug fixes:
New protections:
All configurable in config.yaml