feat: add Postfix slow brute-force and HELO rejection scenarios#1695
Open
Etilem wants to merge 3 commits intocrowdsecurity:masterfrom
Open
feat: add Postfix slow brute-force and HELO rejection scenarios#1695Etilem wants to merge 3 commits intocrowdsecurity:masterfrom
Etilem wants to merge 3 commits intocrowdsecurity:masterfrom
Conversation
8dabf51 to
11bd514
Compare
Contributor
|
Hi, Thanks for your contribution! |
Add slow brute-force detection scenarios for Postfix SMTP authentication and evasive HELO rejection attacks: - melite/postfix-slow-bf (leakspeed 900s, capacity 7) - melite/postfix-very-slow-bf (leakspeed 4h, capacity 5) - melite/postfix-submission-very-slow-bf (leakspeed 4h, capacity 5) - melite/postfix-helo-very-slow (leakspeed 4h, capacity 5) Includes parser melite/postfix-submission-auth (s01-parse) for port 587 auth failures invisible to standard parsers, and hub tests.
Address reviewer feedback: add disconnect auth failure detection directly to crowdsecurity/postfix-logs instead of a separate melite/postfix-submission-auth parser. - Add grok node for 'disconnect from ... auth=0/N' pattern - Remove melite/postfix-submission-auth parser and markdown - Update test configs to reference modified parser - Rewrite parser assertions for new pipeline structure All 5 hubtest tests pass (parser + 4 scenarios).
11bd514 to
5e1ed83
Compare
Remove stale reference to deleted melite/postfix-submission-auth parser. The submission auth pattern is now part of crowdsecurity/postfix-logs.
Contributor
Author
|
Hi @sabban, thanks for the feedback ! I've removed the custom melite/postfix-submission-auth parser and extended crowdsecurity/postfix-logs instead. The new grok pattern extracts auth=0/N from Postfix disconnect lines and tags them with log_type_enh : submission-auth-failed. Changes in commits 5e1ed83 and 1a0f909. The submission scenarios now reference crowdsecurity/postfix-logs as their dependency. Let me know if anything else needs adjusting ! |
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 slow brute-force detection scenarios for Postfix SMTP authentication (port 25 and port 587) and evasive HELO rejection attacks.
Extends the existing
crowdsecurity/postfix-logsparser for submission port auth failures that are invisible to standard parsers.Developed and tested on a production mail server handling 17 domains, where these scenarios detected persistent evasive attacks that standard Postfix scenarios missed entirely.
Problem
Standard CrowdSec Postfix detection has two major gaps:
Slow SASL brute-force on port 25:
crowdsecurity/postfix-bfhas a short detection window. Attackers spacing attempts 15+ minutes apart evade it completely.Port 587 (submission) auth failures are invisible: When using STARTTLS on port 587, Postfix does NOT log explicit "SASL authentication failed" messages. Auth failures only appear as
auth=0/Nin disconnect summary lines — no standard parser extracts this information.Slow HELO rejection attacks:
crowdsecurity/postfix-helo-rejectedhas a ~10 minute window. Evasive spammers sending invalid HELO commands ~70 minutes apart go undetected.Scenarios
melite/postfix-slow-bfmelite/postfix-very-slow-bfmelite/postfix-submission-very-slow-bfmelite/postfix-helo-very-slowThe first two scenarios include
_user-enumvariants (usingdistinctonsasl_username).Parser change
crowdsecurity/postfix-logs(s01-parse): Extended with a new grok pattern that extractsauth=0/Nfrom Postfix disconnect lines. Tags matching lines withlog_type_enh: submission-auth-failed.Example log that was previously invisible:
postfix/submission/smtpd[1234]: disconnect from unknown[IP] ehlo=1 auth=0/1 quit=1 commands=2/3
Testing