feat: add SSH slow brute-force detection scenarios (very-slow, ultra-slow, glacial)#1694
Open
Etilem wants to merge 1 commit intocrowdsecurity:masterfrom
Open
feat: add SSH slow brute-force detection scenarios (very-slow, ultra-slow, glacial)#1694Etilem wants to merge 1 commit intocrowdsecurity:masterfrom
Etilem wants to merge 1 commit intocrowdsecurity:masterfrom
Conversation
Add tiered SSH brute-force detection scenarios that catch evasive attackers spacing login attempts from 1 hour to 8+ hours apart: - melite/ssh-very-slow-bf (leakspeed 4h, capacity 5) - melite/ssh-ultra-slow-bf (leakspeed 12h, capacity 9) - melite/ssh-glacial-bf (leakspeed 18h, capacity 3) Includes parser melite/sshd-preauth-disconnect (s01-parse) and hub tests.
dc0c61c to
c4a9025
Compare
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.
Summary
Add a tiered set of SSH brute-force detection scenarios that catch evasive attackers spacing login attempts from 1 hour to 8+ hours apart. These scenarios extend the existing detection chain beyond what
crowdsecurity/ssh-time-based-bfcovers (~2h effective window).Developed and battle-tested on a production mail/web server processing ~5000 SSH log entries per day, where they detected previously undetected multi-day slow brute-force attacks.
Problem
Current CrowdSec SSH detection chain:
crowdsecurity/ssh-bfcrowdsecurity/ssh-slow-bfcrowdsecurity/ssh-time-based-bfGap beyond ~2 hours: Attackers spacing attempts 3+ hours apart evade all existing scenarios because events leak out of
ssh-time-based-bfbefore accumulating. Real-world examples observed:Scenarios (extending the detection chain)
These scenarios pick up where
crowdsecurity/ssh-time-based-bfleaves off:crowdsecurity/ssh-time-based-bfmelite/ssh-very-slow-bfmelite/ssh-ultra-slow-bfmelite/ssh-glacial-bfEach scenario includes a
_user-enumvariant (usingdistinctontarget_user).Why not just tune
ssh-time-based-bf? Thessh-time-based-bfapproach (conditional withMedianInterval) is fundamentally different from leaky bucket. It requires events to accumulate within its 2h leakspeed window. For attacks spanning days, a pure leaky bucket with a very slow leak rate is more appropriate — it tracks a single counter per IP that slowly decays, using minimal memory.Parser
melite/sshd-preauth-disconnect(s01-parse): CatchesReceived disconnect from IP port N:11: [preauth]lines thatcrowdsecurity/sshd-logsmisses. Each SSH key-scanning attempt generates two log lines, but only one was previously parsed. This parser doubles the event count for all SSH scenarios, making detection faster.Testing
Dependencies
crowdsecurity/syslog-logscrowdsecurity/sshd-logscrowdsecurity/dateparse-enrich