Skip to content

Commit 8dabf51

Browse files
Étienne LEMÉEclaude
andcommitted
feat: add Postfix slow brute-force and HELO rejection scenarios
Add slow brute-force detection for Postfix SMTP AUTH (port 25), submission port 587, and evasive HELO rejection attacks: - melite/postfix-slow-bf: 2h window (leakspeed 900s, capacity 7) - melite/postfix-very-slow-bf: 24h window (leakspeed 4h, capacity 5) - melite/postfix-submission-very-slow-bf: 24h window (port 587) - melite/postfix-helo-very-slow: 24h window (invalid HELO commands) Also adds melite/postfix-submission-auth parser (s02-enrich) that extracts auth=0/N pattern from disconnect lines on port 587, which standard parsers miss entirely. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 699c470 commit 8dabf51

20 files changed

Lines changed: 397 additions & 0 deletions
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
parsers:
2+
- crowdsecurity/syslog-logs
3+
- crowdsecurity/postfix-logs
4+
- crowdsecurity/dateparse-enrich
5+
scenarios:
6+
- melite/postfix-helo-very-slow
7+
log_file: postfix-helo-very-slow.log
8+
log_type: syslog
9+
ignore_parsers: true
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Jan 15 08:00:00 server postfix/smtpd[43001]: NOQUEUE: reject: RCPT from unknown[203.0.113.1]: 504 5.5.2 <invalid>: Helo command rejected: need fully-qualified hostname; from=<sender@spam.example> to=<user@example.com> proto=ESMTP helo=<invalid>
2+
Jan 15 09:10:00 server postfix/smtpd[43002]: NOQUEUE: reject: RCPT from unknown[203.0.113.1]: 504 5.5.2 <invalid>: Helo command rejected: need fully-qualified hostname; from=<sender2@spam.example> to=<user2@example.com> proto=ESMTP helo=<invalid>
3+
Jan 15 10:20:00 server postfix/smtpd[43003]: NOQUEUE: reject: RCPT from unknown[203.0.113.1]: 504 5.5.2 <invalid>: Helo command rejected: need fully-qualified hostname; from=<sender3@spam.example> to=<user3@example.com> proto=ESMTP helo=<invalid>
4+
Jan 15 11:30:00 server postfix/smtpd[43004]: NOQUEUE: reject: RCPT from unknown[203.0.113.1]: 504 5.5.2 <invalid>: Helo command rejected: need fully-qualified hostname; from=<sender4@spam.example> to=<user4@example.com> proto=ESMTP helo=<invalid>
5+
Jan 15 12:40:00 server postfix/smtpd[43005]: NOQUEUE: reject: RCPT from unknown[203.0.113.1]: 504 5.5.2 <invalid>: Helo command rejected: need fully-qualified hostname; from=<sender5@spam.example> to=<user5@example.com> proto=ESMTP helo=<invalid>
6+
Jan 15 13:50:00 server postfix/smtpd[43006]: NOQUEUE: reject: RCPT from unknown[203.0.113.1]: 504 5.5.2 <invalid>: Helo command rejected: need fully-qualified hostname; from=<sender6@spam.example> to=<user6@example.com> proto=ESMTP helo=<invalid>

.tests/postfix-slow-bf/config.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
parsers:
2+
- crowdsecurity/syslog-logs
3+
- crowdsecurity/postfix-logs
4+
- crowdsecurity/dateparse-enrich
5+
scenarios:
6+
- melite/postfix-slow-bf
7+
log_file: postfix-slow-bf.log
8+
log_type: syslog
9+
ignore_parsers: true
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
Jan 15 10:00:00 server postfix/smtpd[40001]: warning: unknown[192.0.2.1]: SASL LOGIN authentication failed: authentication failure
2+
Jan 15 10:03:00 server postfix/smtpd[40002]: warning: unknown[192.0.2.1]: SASL LOGIN authentication failed: authentication failure
3+
Jan 15 10:06:00 server postfix/smtpd[40003]: warning: unknown[192.0.2.1]: SASL LOGIN authentication failed: authentication failure
4+
Jan 15 10:10:00 server postfix/smtpd[40004]: warning: unknown[192.0.2.1]: SASL LOGIN authentication failed: authentication failure
5+
Jan 15 10:14:00 server postfix/smtpd[40005]: warning: unknown[192.0.2.1]: SASL LOGIN authentication failed: authentication failure
6+
Jan 15 10:18:00 server postfix/smtpd[40006]: warning: unknown[192.0.2.1]: SASL LOGIN authentication failed: authentication failure
7+
Jan 15 10:22:00 server postfix/smtpd[40007]: warning: unknown[192.0.2.1]: SASL LOGIN authentication failed: authentication failure
8+
Jan 15 10:26:00 server postfix/smtpd[40008]: warning: unknown[192.0.2.1]: SASL LOGIN authentication failed: authentication failure
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
parsers:
2+
- crowdsecurity/syslog-logs
3+
- crowdsecurity/postfix-logs
4+
- crowdsecurity/dateparse-enrich
5+
- melite/postfix-submission-auth
6+
scenarios:
7+
[]
8+
log_file: postfix-submission-auth.log
9+
log_type: syslog
10+
ignore_parsers: true
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Jan 15 10:30:45 server postfix/submission/smtpd[50001]: disconnect from unknown[192.0.2.1] ehlo=1 auth=0/1 quit=1 commands=2/3
2+
Jan 15 10:31:00 server postfix/submission/smtpd[50002]: disconnect from attacker.example[198.51.100.1] ehlo=2 starttls=1 auth=0/3 quit=1 commands=4/7
3+
Jan 15 10:32:00 server postfix/submission/smtpd[50003]: disconnect from scanner.example[203.0.113.50] ehlo=1 auth=0/2 quit=1 commands=2/4
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
parsers:
2+
- crowdsecurity/syslog-logs
3+
- crowdsecurity/postfix-logs
4+
- crowdsecurity/dateparse-enrich
5+
- melite/postfix-submission-auth
6+
scenarios:
7+
- melite/postfix-submission-very-slow-bf
8+
log_file: postfix-submission-very-slow-bf.log
9+
log_type: syslog
10+
ignore_parsers: true
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Jan 15 10:00:00 server postfix/submission/smtpd[42001]: disconnect from unknown[192.0.2.1] ehlo=1 auth=0/1 quit=1 commands=2/3
2+
Jan 15 11:30:00 server postfix/submission/smtpd[42002]: disconnect from unknown[192.0.2.1] ehlo=1 auth=0/2 quit=1 commands=2/4
3+
Jan 15 13:00:00 server postfix/submission/smtpd[42003]: disconnect from unknown[192.0.2.1] ehlo=1 auth=0/1 quit=1 commands=2/3
4+
Jan 15 14:30:00 server postfix/submission/smtpd[42004]: disconnect from unknown[192.0.2.1] ehlo=1 auth=0/1 quit=1 commands=2/3
5+
Jan 15 16:00:00 server postfix/submission/smtpd[42005]: disconnect from unknown[192.0.2.1] ehlo=1 auth=0/3 quit=1 commands=2/5
6+
Jan 15 17:30:00 server postfix/submission/smtpd[42006]: disconnect from unknown[192.0.2.1] ehlo=1 auth=0/1 quit=1 commands=2/3
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
parsers:
2+
- crowdsecurity/syslog-logs
3+
- crowdsecurity/postfix-logs
4+
- crowdsecurity/dateparse-enrich
5+
scenarios:
6+
- melite/postfix-very-slow-bf
7+
log_file: postfix-very-slow-bf.log
8+
log_type: syslog
9+
ignore_parsers: true
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Jan 15 08:00:00 server postfix/smtpd[41001]: warning: unknown[198.51.100.1]: SASL LOGIN authentication failed: authentication failure
2+
Jan 15 08:45:00 server postfix/smtpd[41002]: warning: unknown[198.51.100.1]: SASL LOGIN authentication failed: authentication failure
3+
Jan 15 09:30:00 server postfix/smtpd[41003]: warning: unknown[198.51.100.1]: SASL LOGIN authentication failed: authentication failure
4+
Jan 15 10:15:00 server postfix/smtpd[41004]: warning: unknown[198.51.100.1]: SASL LOGIN authentication failed: authentication failure
5+
Jan 15 11:00:00 server postfix/smtpd[41005]: warning: unknown[198.51.100.1]: SASL LOGIN authentication failed: authentication failure
6+
Jan 15 11:45:00 server postfix/smtpd[41006]: warning: unknown[198.51.100.1]: SASL LOGIN authentication failed: authentication failure

0 commit comments

Comments
 (0)