diff --git a/.github/workflows/codespell.yml b/.github/workflows/codespell.yml index 7373affc..16877239 100644 --- a/.github/workflows/codespell.yml +++ b/.github/workflows/codespell.yml @@ -17,6 +17,6 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v7 - name: Codespell uses: codespell-project/actions-codespell@v2 diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ee6305c4..4d3897b3 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -22,15 +22,15 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [3.8, 3.9, '3.10', '3.11', '3.12', '3.13', '3.14', '3.15.0-alpha.5', pypy3.11] + python-version: [3.8, 3.9, '3.10', '3.11', '3.12', '3.13', '3.14', '3.15.0-rc.2', pypy3.11] fail-fast: false # Steps represent a sequence of tasks that will be executed as part of the job steps: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v4 + - uses: actions/checkout@v7 - name: Set up Python - uses: actions/setup-python@v5 + uses: actions/setup-python@v7 with: python-version: ${{ matrix.python-version }} diff --git a/ChangeLog b/ChangeLog index 216ffe88..32f2dec0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -7,7 +7,24 @@ Fail2Ban: Changelog =================== -ver. 1.1.1-dev-1 (20??/??/??) - development nightly edition +ver. 1.1.2-dev-1 (20??/??/??) - development nightly edition +----------- + +### Fixes +* `filter.d/nginx-botsearch.conf` - error-log regex extended with support of journal format (gh-3732) +* `filter.d/apache-noscript.conf` - match a request for the `cgi-bin` directory itself (no script name after it), + the `cgi-bin` alternative required a following path segment so `/cgi-bin/` and `/cgi-bin` were not matched (gh-4217) +* sockets passed via `systemd` socket activation (`sd_listen_fds(3)`) are not shut down or removed anymore (gh-4225) +* `paths-*.conf`: add default banactions for several includes depending on default net-filter for distribution (gh-4224, gh-4229): + `paths-arch.conf`, `paths-fedora.conf`, `paths-opensuse.conf` - nftables, `paths-freebsd.conf`, `paths-osx.conf ` - pf; + +### New Features and Enhancements +* `filter.d/cowrie.conf` - new filter and jail for Cowrie SSH/Telnet honeypot JSON log output (gh-4216) +* `filter.d/gitlab.conf` - `logtype` option `json` adding support for the `application_json.log` format that + superseded the deprecated `application.log`; default type `file` keeps the previous behaviour (gh-3566, gh-4230) + + +ver. 1.1.1 (2026/08/15) - triple-one-win ----------- ### Compatibility @@ -18,6 +35,7 @@ ver. 1.1.1-dev-1 (20??/??/??) - development nightly edition to use it as before set `mode = more` for exim jail, but be aware of the consequences. ### Fixes +* fixes catastrophic backtracking explosion for REs in domino-smtp and dovecot filters (GHSA-33wh-ccjc-p397, gh-4221) * fixes `systemd` bug with missing journal descriptor after rotation by reopening of journal if it is recognized as not alive (gh-3929) * improve threaded clean-up of all filters, new thread functions `afterStop` (to force clean-up after stop) and `done`, invoking `afterStop` once * ensure journal-reader is always closed (additional prevention against leaks and "too many open files"), thereby avoid sporadic segfault @@ -65,6 +83,7 @@ ver. 1.1.1-dev-1 (20??/??/??) - development nightly edition - add optional `NOQUEUE:` prefix to ddos regex (gh-4072) - 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) + - modes `aggressive` extended to match `hostname does not resolve to address` (gh-4218, gh-4078) * `filter.d/dropbear.conf`: - 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) @@ -83,6 +102,7 @@ ver. 1.1.1-dev-1 (20??/??/??) - development nightly edition * `filter.d/froxlor-auth.conf` - updated the regex to the new logging situation for froxlor and changed logpath in jail.conf (gh-4075). ### New Features and Enhancements +* `fail2ban-server` supports `systemd` socket activation (`sd_listen_fds(3)`); optional `fail2ban.socket` unit provided * backend `systemd` extended with new parameter `rotated` (default `false`, as prevention against "too many open files"), that allows to monitor only actual journals and ignore now a lot of rotated files by default; so can drastically reduce amount of used file descriptors, normally to 1 or 2 descriptors per jail (gh-3391) diff --git a/MANIFEST b/MANIFEST index 972a2b48..5fbd4e10 100644 --- a/MANIFEST +++ b/MANIFEST @@ -11,6 +11,7 @@ config/action.d/bsd-ipfw.conf config/action.d/cloudflare.conf config/action.d/cloudflare-token.conf config/action.d/complain.conf +config/action.d/csf.conf config/action.d/dshield.conf config/action.d/dummy.conf config/action.d/firewallcmd-allports.conf @@ -129,6 +130,7 @@ config/filter.d/nginx-http-auth.conf config/filter.d/nginx-limit-req.conf config/filter.d/nsd.conf config/filter.d/openhab.conf +config/filter.d/openvpn.conf config/filter.d/openwebmail.conf config/filter.d/oracleims.conf config/filter.d/pam-generic.conf @@ -138,6 +140,7 @@ config/filter.d/php-url-fopen.conf config/filter.d/portsentry.conf config/filter.d/postfix.conf config/filter.d/proftpd.conf +config/filter.d/proxmox.conf config/filter.d/pure-ftpd.conf config/filter.d/qmail.conf config/filter.d/recidive.conf @@ -162,10 +165,12 @@ config/filter.d/suhosin.conf config/filter.d/tine20.conf config/filter.d/traefik-auth.conf config/filter.d/uwimap-auth.conf +config/filter.d/vaultwarden.conf config/filter.d/vsftpd.conf config/filter.d/webmin-auth.conf config/filter.d/wuftpd.conf config/filter.d/xinetd-fail.conf +config/filter.d/xrdp.conf config/filter.d/znc-adminlog.conf config/filter.d/zoneminder.conf config/jail.conf @@ -340,6 +345,7 @@ fail2ban/tests/files/logs/nginx-http-auth fail2ban/tests/files/logs/nginx-limit-req fail2ban/tests/files/logs/nsd fail2ban/tests/files/logs/openhab +fail2ban/tests/files/logs/openvpn fail2ban/tests/files/logs/openwebmail fail2ban/tests/files/logs/oracleims fail2ban/tests/files/logs/pam-generic @@ -349,6 +355,7 @@ fail2ban/tests/files/logs/php-url-fopen fail2ban/tests/files/logs/portsentry fail2ban/tests/files/logs/postfix fail2ban/tests/files/logs/proftpd +fail2ban/tests/files/logs/proxmox fail2ban/tests/files/logs/pure-ftpd fail2ban/tests/files/logs/qmail fail2ban/tests/files/logs/recidive @@ -373,10 +380,12 @@ fail2ban/tests/files/logs/suhosin fail2ban/tests/files/logs/tine20 fail2ban/tests/files/logs/traefik-auth fail2ban/tests/files/logs/uwimap-auth +fail2ban/tests/files/logs/vaultwarden fail2ban/tests/files/logs/vsftpd fail2ban/tests/files/logs/webmin-auth fail2ban/tests/files/logs/wuftpd fail2ban/tests/files/logs/xinetd-fail +fail2ban/tests/files/logs/xrdp fail2ban/tests/files/logs/znc-adminlog fail2ban/tests/files/logs/zoneminder fail2ban/tests/files/logs/zzz-generic-example @@ -390,6 +399,7 @@ fail2ban/tests/files/testcase-journal.log fail2ban/tests/files/testcase-multiline.log fail2ban/tests/files/testcase-usedns.log fail2ban/tests/files/testcase-wrong-char.log +fail2ban/tests/files/test-ign-ips-file fail2ban/tests/files/zzz-sshd-obsolete-multiline.log fail2ban/tests/filtertestcase.py fail2ban/tests/__init__.py @@ -410,7 +420,7 @@ files/fail2ban-logrotate files/fail2ban-openrc.conf files/fail2ban-openrc.init.in files/fail2ban.service.in -files/fail2ban-tmpfiles.conf +files/fail2ban.socket.in files/fail2ban.upstart files/gen_badbots files/ipmasq-ZZZzzz_fail2ban.rul diff --git a/README.md b/README.md index 9d5a5959..d6da5e71 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ / _|__ _(_) |_ ) |__ __ _ _ _ | _/ _` | | |/ /| '_ \/ _` | ' \ |_| \__,_|_|_/___|_.__/\__,_|_||_| - v1.1.0.dev1 20??/??/?? + v1.1.2.dev1 20??/??/?? ## Fail2Ban: ban hosts that cause multiple authentication errors diff --git a/config/action.d/nftables.conf b/config/action.d/nftables.conf index 94ff9cdf..ef3dbedc 100644 --- a/config/action.d/nftables.conf +++ b/config/action.d/nftables.conf @@ -35,7 +35,11 @@ type = multiport rule_match-custom = rule_match-allports = meta l4proto \{ \} rule_match-multiport = $proto dport \{ $(echo '' | sed s/:/-/g) \} +rule_match-allprotos-custom = +rule_match-allprotos-allports = +rule_match-allprotos-multiport = th dport \{ $(echo '' | sed s/:/-/g) \} match = > +match_allprotos = > # Option: rule_stat # Notes.: statement for nftables filter rule. @@ -43,6 +47,7 @@ match = > # Values: nftables statement # rule_stat = %(match)s saddr @ +rule_stat_allprotos = %(match_allprotos)s saddr @ # optional iterator over protocol's: _nft_for_proto-custom-iter = @@ -56,9 +61,13 @@ _nft_list = -a list chain _nft_get_handle_id = sed -nE 's/.*@\s+.*\s+\#\s*(handle\s+[0-9]+)$/\1/p' _nft_add_set = add set
\{ type \; \} + if [ '' != "all" ]; then <_nft_for_proto--iter> add rule
%(rule_stat)s <_nft_for_proto--done> + else + add rule
%(rule_stat_allprotos)s + fi _nft_del_set = { %(_nft_list)s | %(_nft_get_handle_id)s; } | while read -r hdl; do delete rule
$hdl; done delete set
diff --git a/config/filter.d/apache-noscript.conf b/config/filter.d/apache-noscript.conf index d8f9fdfd..a49afa10 100644 --- a/config/filter.d/apache-noscript.conf +++ b/config/filter.d/apache-noscript.conf @@ -17,12 +17,12 @@ before = apache-common.conf [Definition] -script = /\S*(?:php(?:[45]|[.-]cgi)?|\.asp|\.exe|\.pl|\bcgi-bin/) +script = /\S*(?:php(?:[45]|[.-]cgi)?|\.asp|\.exe|\.pl|\bcgi-bin) prefregex = ^%(_apache_error_client)s (?:AH0(?:01(?:28|30)|1(?:264|071)|2811): )?(?=(?:[Ff]ile|[Ss]cript|[Gg]ot error|stderr from) ).+$ failregex = ^(?:(?:[Ff]ile does not exist|[Ss]cript not found or unable to stat):