diff --git a/ChangeLog b/ChangeLog index 74f83e47..32089ded 100644 --- a/ChangeLog +++ b/ChangeLog @@ -33,6 +33,8 @@ ver. 1.1.1-dev-1 (20??/??/??) - development nightly edition - adapted to conform possible new daemon name sshd-session, since OpenSSH 9.8 several log messages will be tagged with as originating from a process named "sshd-session" rather than "sshd" (gh-3782) - `ddos` and `aggressive` modes: regex extended for timeout before authentication (optional connection from part, gh-3907) + - `extra` and `aggressive` modes: consider `Received disconnect ... 11: Bye Bye` with `[preauth]` as a failure + and without `[preauth]` it'd be still used as nofail-helper e. g. to obtain IP by multi-line processing (amend to gh-2115) ### New Features and Enhancements * new jail option `skip_if_nologs` to ignore jail if no `logpath` matches found, fail2ban continue to start with warnings/errors, diff --git a/config/filter.d/sshd.conf b/config/filter.d/sshd.conf index 80d0c349..3c13f90e 100644 --- a/config/filter.d/sshd.conf +++ b/config/filter.d/sshd.conf @@ -56,7 +56,6 @@ cmnfailre = ^[aA]uthentication (?:failure|error|failed) for .*? ^User \S+|.*? not allowed because account is locked%(__suff)s ^Disconnecting(?: from)?(?: (?:invalid|authenticating)) user \S+ %(__on_port_opt)s:\s*Change of username or service not allowed:\s*.*\[preauth\]\s*$ ^Disconnecting: Too many authentication failures(?: for \S+|.*?)?%(__suff)s$ - ^Received disconnect from %(__on_port_opt)s:\s*11: -other> ^Accepted \w+ for \S+ from (?:\s|$) @@ -69,6 +68,7 @@ cmnfailed = > mdre-normal = # used to differentiate "connection closed" with and without `[preauth]` (fail/nofail cases in ddos mode) mdre-normal-other = ^(?:Connection (?:closed|reset)|Disconnect(?:ed|ing))%(__authng_user)s %(__on_port_opt)s(?:: (?!Too many authentication failures)[^\[]+)?(?: \[preauth\])?\s*$ + ^Received disconnect from %(__on_port_opt)s:\s*11: mdre-ddos = ^(?:Did not receive identification string from|Timeout before authentication for(?: connection from)?) ^kex_exchange_identification: (?:read: )?(?:[Cc]lient sent invalid protocol identifier|[Cc]onnection (?:closed by remote host|reset by peer)) @@ -81,17 +81,20 @@ mdre-ddos = ^(?:Did not receive identification string from|Timeout before authen mdre-ddos-other = ^(?:Connection (?:closed|reset)|Disconnect(?:ed|ing))%(__authng_user)s %(__on_port_opt)s(?:: (?!Too many authentication failures)[^\[]+)?\s+\[preauth\]\s*$ ^(?:Connection (?:closed|reset)|Disconnect(?:ed|ing))%(__authng_user)s (?:%(__on_port_opt)s(?:: (?!Too many authentication failures)[^\[]+)?|\s*)$ -mdre-extra = ^Received disconnect from %(__on_port_opt)s:\s*14: No(?: supported)? authentication methods available +mdre-extra = ^Received disconnect from %(__on_port_opt)s:\s*(?:14: No(?: supported)? authentication methods available|11:.*\[preauth\]$) ^Unable to negotiate with %(__on_port_opt)s: no matching <__alg_match> found. ^Unable to negotiate a <__alg_match> ^no matching <__alg_match> found: # part of mdre-ddos-other, but user name is supplied (invalid/authenticating) on [preauth] phase only: mdre-extra-other = ^Disconnected(?: from)?(?: (?:invalid|authenticating)) user \S+|.*? (?:from )?%(__on_port_opt)s \[preauth\]\s*$ + %(mdre-extra-add)s +mdre-extra-add = ^Received disconnect from %(__on_port_opt)s:\s*11:.*(?