mirror of https://github.com/fail2ban/fail2ban
`filter.d/postfix.conf` - modes `ddos` and `aggressive` extended to match `rate limit exceeded` for connection or message delivery request rates;
closes gh-3265; closes gh-4073;pull/3982/merge
parent
2856092709
commit
65668b8ed8
|
@ -53,6 +53,7 @@ ver. 1.1.1-dev-1 (20??/??/??) - development nightly edition
|
||||||
- default `_daemon` in prefix-line is loosened - can match everything starting with word postfix, like `postfix-example.com/smtpd` (gh-3297)
|
- default `_daemon` in prefix-line is loosened - can match everything starting with word postfix, like `postfix-example.com/smtpd` (gh-3297)
|
||||||
- add optional `NOQUEUE:` prefix to ddos regex (gh-4072)
|
- add optional `NOQUEUE:` prefix to ddos regex (gh-4072)
|
||||||
- internal parameter `_pref` is renamed to `_cmd`, `_pref` matches now optional prefix like `NOQUEUE: ` etc
|
- internal parameter `_pref` is renamed to `_cmd`, `_pref` matches now optional prefix like `NOQUEUE: ` etc
|
||||||
|
- modes `ddos` and `aggressive` extended to match `rate limit exceeded` for connection or message delivery request rates (gh-3265, gh-4073)
|
||||||
* `filter.d/dropbear.conf`:
|
* `filter.d/dropbear.conf`:
|
||||||
- recognizes extra pid/timestamp if logged into stdout/journal, added `journalmatch` (gh-3597)
|
- recognizes extra pid/timestamp if logged into stdout/journal, added `journalmatch` (gh-3597)
|
||||||
- failregex extended to match different format of "Exit before auth" message (gh-3791)
|
- failregex extended to match different format of "Exit before auth" message (gh-3791)
|
||||||
|
|
|
@ -26,38 +26,47 @@ exre-user = |[Uu](?:ser unknown|ndeliverable address) ; pragma: codespell-ignor
|
||||||
mdpr-normal = (?:(?:milter-)?reject:|(?:improper command pipelining|too many errors) after \S+)
|
mdpr-normal = (?:(?:milter-)?reject:|(?:improper command pipelining|too many errors) after \S+)
|
||||||
mdre-normal=^%(_cmd)s from [^[]*\[<HOST>\]%(_port)s: [45][50][04] [45]\.\d\.\d+ (?:(?:<[^>]*>)?: )?(?:(?:Helo command|(?:Sender|Recipient) address) rejected: )?(?:Service unavailable|Access denied|(?:Client host|Command|Data command) rejected|Relay access denied|Malformed DNS server reply|(?:Host|Domain) not found|need fully-qualified hostname|match%(exre-user)s)\b
|
mdre-normal=^%(_cmd)s from [^[]*\[<HOST>\]%(_port)s: [45][50][04] [45]\.\d\.\d+ (?:(?:<[^>]*>)?: )?(?:(?:Helo command|(?:Sender|Recipient) address) rejected: )?(?:Service unavailable|Access denied|(?:Client host|Command|Data command) rejected|Relay access denied|Malformed DNS server reply|(?:Host|Domain) not found|need fully-qualified hostname|match%(exre-user)s)\b
|
||||||
^from [^[]*\[<HOST>\]%(_port)s:?
|
^from [^[]*\[<HOST>\]%(_port)s:?
|
||||||
|
mdad-normal =
|
||||||
|
|
||||||
mdpr-auth = warning:
|
mdpr-auth = warning:
|
||||||
mdre-auth = ^[^[]*\[<HOST>\]%(_port)s: SASL ((?i)LOGIN|PLAIN|(?:CRAM|DIGEST)-MD5) authentication failed:(?! Connection lost to authentication server| Invalid authentication mechanism)
|
mdre-auth = ^[^[]*\[<HOST>\]%(_port)s: SASL ((?i)LOGIN|PLAIN|(?:CRAM|DIGEST)-MD5) authentication failed:(?! Connection lost to authentication server| Invalid authentication mechanism)
|
||||||
mdre-auth2= ^[^[]*\[<HOST>\]%(_port)s: SASL ((?i)LOGIN|PLAIN|(?:CRAM|DIGEST)-MD5) authentication failed:(?! Connection lost to authentication server)
|
mdre-auth2= ^[^[]*\[<HOST>\]%(_port)s: SASL ((?i)LOGIN|PLAIN|(?:CRAM|DIGEST)-MD5) authentication failed:(?! Connection lost to authentication server)
|
||||||
# todo: check/remove "Invalid authentication mechanism" from ignore list, if gh-1243 will get finished (see gh-1297).
|
# todo: check/remove "Invalid authentication mechanism" from ignore list, if gh-1243 will get finished (see gh-1297).
|
||||||
|
mdad-auth =
|
||||||
|
mdad-auth2 =
|
||||||
|
|
||||||
# Mode "rbl" currently included in mode "normal", but if needed for jail "postfix-rbl" only:
|
# Mode "rbl" currently included in mode "normal", but if needed for jail "postfix-rbl" only:
|
||||||
mdpr-rbl = %(mdpr-normal)s
|
mdpr-rbl = %(mdpr-normal)s
|
||||||
mdre-rbl = ^%(_cmd)s from [^[]*\[<HOST>\]%(_port)s: [45]54 [45]\.7\.1 Service unavailable; Client host \[\S+\] blocked\b
|
mdre-rbl = ^%(_cmd)s from [^[]*\[<HOST>\]%(_port)s: [45]54 [45]\.7\.1 Service unavailable; Client host \[\S+\] blocked\b
|
||||||
|
mdad-rbl =
|
||||||
|
|
||||||
# Mode "rbl" currently included in mode "normal" (within 1st rule)
|
# Mode "rbl" currently included in mode "normal" (within 1st rule)
|
||||||
mdpr-more = %(mdpr-normal)s
|
mdpr-more = %(mdpr-normal)s
|
||||||
mdre-more = %(mdre-normal)s
|
mdre-more = %(mdre-normal)s
|
||||||
|
mdad-more =
|
||||||
|
|
||||||
# Includes some of the log messages described in
|
# Includes some of the log messages described in
|
||||||
# <http://www.postfix.org/POSTSCREEN_README.html>.
|
# <http://www.postfix.org/POSTSCREEN_README.html>.
|
||||||
mdpr-ddos = (?:lost connection after (?!(?:DATA|AUTH)\b)[A-Z]+|disconnect(?= from \S+(?: \S+=\d+)* auth=0/(?:[1-9]|\d\d+))|(?:PREGREET \d+|HANGUP) after \S+|COMMAND (?:TIME|COUNT|LENGTH) LIMIT)
|
mdpr-ddos = (?:lost connection after (?!(?:DATA|AUTH)\b)[A-Z]+|disconnect(?= from \S+(?: \S+=\d+)* auth=0/(?:[1-9]|\d\d+))|(?:PREGREET \d+|HANGUP) after \S+|COMMAND (?:TIME|COUNT|LENGTH) LIMIT|warning:)
|
||||||
mdre-ddos = ^from [^[]*\[<HOST>\]%(_port)s:?
|
mdre-ddos = ^from [^[]*\[<HOST>\]%(_port)s:?
|
||||||
|
mdad-ddos = ^(?:Message delivery request|Connection) rate limit exceeded: \d+ from [^[]*\[<ADDR>\]
|
||||||
|
|
||||||
mdpr-extra = (?:%(mdpr-auth)s|%(mdpr-normal)s)
|
mdpr-extra = (?:%(mdpr-auth)s|%(mdpr-normal)s)
|
||||||
mdre-extra = %(mdre-auth)s
|
mdre-extra = %(mdre-auth)s
|
||||||
%(mdre-normal)s
|
%(mdre-normal)s
|
||||||
|
mdad-extra =
|
||||||
|
|
||||||
mdpr-aggressive = (?:%(mdpr-auth)s|%(mdpr-normal)s|%(mdpr-ddos)s)
|
mdpr-aggressive = (?:%(mdpr-auth)s|%(mdpr-normal)s|%(mdpr-ddos)s)
|
||||||
mdre-aggressive = %(mdre-auth2)s
|
mdre-aggressive = %(mdre-auth2)s
|
||||||
%(mdre-normal)s
|
%(mdre-normal)s
|
||||||
|
mdad-aggressive = %(mdad-ddos)s
|
||||||
|
|
||||||
mdpr-errors = too many errors after \S+
|
mdpr-errors = too many errors after \S+
|
||||||
mdre-errors = ^from [^[]*\[<HOST>\]%(_port)s$
|
mdre-errors = ^from [^[]*\[<HOST>\]%(_port)s$
|
||||||
|
mdad-errors =
|
||||||
|
|
||||||
failregex = <mdre-<mode>>
|
failregex = <mdre-<mode>>
|
||||||
|
<mdad-<mode>>
|
||||||
|
|
||||||
# Parameter "mode": more (default combines normal and rbl), auth, normal, rbl, ddos, extra or aggressive (combines all)
|
# Parameter "mode": more (default combines normal and rbl), auth, normal, rbl, ddos, extra or aggressive (combines all)
|
||||||
# Usage example (for jail.local):
|
# Usage example (for jail.local):
|
||||||
|
|
|
@ -190,6 +190,10 @@ Jun 8 23:14:54 proxy2 postfix/postscreen[473]: COMMAND COUNT LIMIT from [192.0.
|
||||||
# failJSON: { "time": "2004-09-17T18:19:20", "match": true , "host": "192.0.2.25" }
|
# failJSON: { "time": "2004-09-17T18:19:20", "match": true , "host": "192.0.2.25" }
|
||||||
Sep 17 18:19:20 mxhost postfix/smtpd[12345]: NOQUEUE: lost connection after CONNECT from unknown[192.0.2.25]
|
Sep 17 18:19:20 mxhost postfix/smtpd[12345]: NOQUEUE: lost connection after CONNECT from unknown[192.0.2.25]
|
||||||
|
|
||||||
|
# failJSON: { "time": "2004-09-19T12:10:57", "match": true , "host": "192.0.2.123", "desc": "Connection rate limit exceeded, gh-4073" }
|
||||||
|
Sep 19 12:10:57 hostname postfix/smtpd[23244]: warning: Connection rate limit exceeded: 31 from spamhost.domain.org[192.0.2.123] for service smtpd
|
||||||
|
# failJSON: { "time": "2004-09-19T12:10:58", "match": true , "host": "192.0.2.227", "desc": "Message delivery request rate limit exceeded, gh-3265" }
|
||||||
|
Sep 19 12:10:58 hostname postfix/smtpd[14059]: warning: Message delivery request rate limit exceeded: 334 from spam.example.com[192.0.2.227] for service submission
|
||||||
|
|
||||||
# filterOptions: [{}, {"mode": "ddos"}, {"mode": "aggressive"}]
|
# filterOptions: [{}, {"mode": "ddos"}, {"mode": "aggressive"}]
|
||||||
# failJSON: { "match": false, "desc": "don't affect lawful data (sporadical connection aborts within DATA-phase, see gh-1813 for discussion)" }
|
# failJSON: { "match": false, "desc": "don't affect lawful data (sporadical connection aborts within DATA-phase, see gh-1813 for discussion)" }
|
||||||
|
|
Loading…
Reference in New Issue