View | Details | Raw Unified | Return to bug 266810
Collapse All | Expand All

(-)b/security/py-fail2ban/Makefile (-2 / +1 lines)
Lines 1-6 Link Here
1
PORTNAME=	fail2ban
1
PORTNAME=	fail2ban
2
DISTVERSION=	0.11.2
2
DISTVERSION=	1.0.1
3
PORTREVISION=	3
4
CATEGORIES=	security python
3
CATEGORIES=	security python
5
PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}
4
PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}
6
5
(-)b/security/py-fail2ban/distinfo (-3 / +3 lines)
Lines 1-3 Link Here
1
TIMESTAMP = 1606166575
1
TIMESTAMP = 1664854580
2
SHA256 (fail2ban-fail2ban-0.11.2_GH0.tar.gz) = 383108e5f8644cefb288537950923b7520f642e7e114efb843f6e7ea9268b1e0
2
SHA256 (fail2ban-fail2ban-1.0.1_GH0.tar.gz) = 62b54679ebae81ac57f32c5e27aba9f2494ec5bafd45a0fd68e7a27fd448e5ac
3
SIZE (fail2ban-fail2ban-0.11.2_GH0.tar.gz) = 559552
3
SIZE (fail2ban-fail2ban-1.0.1_GH0.tar.gz) = 582122
(-)a/security/py-fail2ban/files/patch-CVE-2021-32749 (-158 lines)
Removed Link Here
1
From 410a6ce5c80dd981c22752da034f2529b5eee844 Mon Sep 17 00:00:00 2001
2
From: sebres <serg.brester@sebres.de>
3
Date: Mon, 21 Jun 2021 17:12:53 +0200
4
Subject: [PATCH] fixed possible RCE vulnerability, unset escape variable
5
 (default tilde) stops consider "~" char after new-line as composing escape
6
 sequence
7
8
---
9
 config/action.d/complain.conf         | 2 +-
10
 config/action.d/dshield.conf          | 2 +-
11
 config/action.d/mail-buffered.conf    | 8 ++++----
12
 config/action.d/mail-whois-lines.conf | 2 +-
13
 config/action.d/mail-whois.conf       | 6 +++---
14
 config/action.d/mail.conf             | 6 +++---
15
 6 files changed, 13 insertions(+), 13 deletions(-)
16
17
diff --git config/action.d/complain.conf config/action.d/complain.conf
18
index 3a5f882c..4d73b058 100644
19
--- config/action.d/complain.conf
20
+++ config/action.d/complain.conf
21
@@ -102,7 +102,7 @@ logpath = /dev/null
22
 # Notes.:  Your system mail command. Is passed 2 args: subject and recipient
23
 # Values:  CMD
24
 #
25
-mailcmd = mail -s
26
+mailcmd = mail -E 'set escape' -s
27
 
28
 # Option:  mailargs
29
 # Notes.:  Additional arguments to mail command. e.g. for standard Unix mail:
30
diff --git config/action.d/dshield.conf config/action.d/dshield.conf
31
index c128bef3..3d5a7a53 100644
32
--- config/action.d/dshield.conf
33
+++ config/action.d/dshield.conf
34
@@ -179,7 +179,7 @@ tcpflags =
35
 # Notes.:  Your system mail command. Is passed 2 args: subject and recipient
36
 # Values:  CMD
37
 #
38
-mailcmd = mail -s
39
+mailcmd = mail -E 'set escape' -s
40
 
41
 # Option:  mailargs
42
 # Notes.:  Additional arguments to mail command. e.g. for standard Unix mail:
43
diff --git config/action.d/mail-buffered.conf config/action.d/mail-buffered.conf
44
index 325f185b..79b84104 100644
45
--- config/action.d/mail-buffered.conf
46
+++ config/action.d/mail-buffered.conf
47
@@ -17,7 +17,7 @@ actionstart = printf %%b "Hi,\n
48
               The jail <name> has been started successfully.\n
49
               Output will be buffered until <lines> lines are available.\n
50
               Regards,\n
51
-              Fail2Ban"|mail -s "[Fail2Ban] <name>: started on <fq-hostname>" <dest>
52
+              Fail2Ban"|mail -E 'set escape' -s "[Fail2Ban] <name>: started on <fq-hostname>" <dest>
53
 
54
 # Option:  actionstop
55
 # Notes.:  command executed at the stop of jail (or at the end of Fail2Ban)
56
@@ -28,13 +28,13 @@ actionstop = if [ -f <tmpfile> ]; then
57
                  These hosts have been banned by Fail2Ban.\n
58
                  `cat <tmpfile>`
59
                  Regards,\n
60
-                 Fail2Ban"|mail -s "[Fail2Ban] <name>: Summary from <fq-hostname>" <dest>
61
+                 Fail2Ban"|mail -E 'set escape' -s "[Fail2Ban] <name>: Summary from <fq-hostname>" <dest>
62
                  rm <tmpfile>
63
              fi
64
              printf %%b "Hi,\n
65
              The jail <name> has been stopped.\n
66
              Regards,\n
67
-             Fail2Ban"|mail -s "[Fail2Ban] <name>: stopped on <fq-hostname>" <dest>
68
+             Fail2Ban"|mail -E 'set escape' -s "[Fail2Ban] <name>: stopped on <fq-hostname>" <dest>
69
 
70
 # Option:  actioncheck
71
 # Notes.:  command executed once before each actionban command
72
@@ -55,7 +55,7 @@ actionban = printf %%b "`date`: <ip> (<failures> failures)\n" >> <tmpfile>
73
                 These hosts have been banned by Fail2Ban.\n
74
                 `cat <tmpfile>`
75
                 \nRegards,\n
76
-                Fail2Ban"|mail -s "[Fail2Ban] <name>: Summary" <dest>
77
+                Fail2Ban"|mail -E 'set escape' -s "[Fail2Ban] <name>: Summary" <dest>
78
                 rm <tmpfile>
79
             fi
80
 
81
diff --git config/action.d/mail-whois-lines.conf config/action.d/mail-whois-lines.conf
82
index 3a3e56b2..d2818cb9 100644
83
--- config/action.d/mail-whois-lines.conf
84
+++ config/action.d/mail-whois-lines.conf
85
@@ -72,7 +72,7 @@ actionunban =
86
 # Notes.:  Your system mail command. Is passed 2 args: subject and recipient
87
 # Values:  CMD
88
 #
89
-mailcmd = mail -s
90
+mailcmd = mail -E 'set escape' -s
91
 
92
 # Default name of the chain
93
 #
94
diff --git config/action.d/mail-whois.conf config/action.d/mail-whois.conf
95
index 7fea34c4..ab33b616 100644
96
--- config/action.d/mail-whois.conf
97
+++ config/action.d/mail-whois.conf
98
@@ -20,7 +20,7 @@ norestored = 1
99
 actionstart = printf %%b "Hi,\n
100
               The jail <name> has been started successfully.\n
101
               Regards,\n
102
-              Fail2Ban"|mail -s "[Fail2Ban] <name>: started on <fq-hostname>" <dest>
103
+              Fail2Ban"|mail -E 'set escape' -s "[Fail2Ban] <name>: started on <fq-hostname>" <dest>
104
 
105
 # Option:  actionstop
106
 # Notes.:  command executed at the stop of jail (or at the end of Fail2Ban)
107
@@ -29,7 +29,7 @@ actionstart = printf %%b "Hi,\n
108
 actionstop = printf %%b "Hi,\n
109
              The jail <name> has been stopped.\n
110
              Regards,\n
111
-             Fail2Ban"|mail -s "[Fail2Ban] <name>: stopped on <fq-hostname>" <dest>
112
+             Fail2Ban"|mail -E 'set escape' -s "[Fail2Ban] <name>: stopped on <fq-hostname>" <dest>
113
 
114
 # Option:  actioncheck
115
 # Notes.:  command executed once before each actionban command
116
@@ -49,7 +49,7 @@ actionban = printf %%b "Hi,\n
117
             Here is more information about <ip> :\n
118
             `%(_whois_command)s`\n
119
             Regards,\n
120
-            Fail2Ban"|mail -s "[Fail2Ban] <name>: banned <ip> from <fq-hostname>" <dest>
121
+            Fail2Ban"|mail -E 'set escape' -s "[Fail2Ban] <name>: banned <ip> from <fq-hostname>" <dest>
122
 
123
 # Option:  actionunban
124
 # Notes.:  command executed when unbanning an IP. Take care that the
125
diff --git config/action.d/mail.conf config/action.d/mail.conf
126
index 5d8c0e15..f4838ddc 100644
127
--- config/action.d/mail.conf
128
+++ config/action.d/mail.conf
129
@@ -16,7 +16,7 @@ norestored = 1
130
 actionstart = printf %%b "Hi,\n
131
               The jail <name> has been started successfully.\n
132
               Regards,\n
133
-              Fail2Ban"|mail -s "[Fail2Ban] <name>: started  on <fq-hostname>" <dest>
134
+              Fail2Ban"|mail -E 'set escape' -s "[Fail2Ban] <name>: started  on <fq-hostname>" <dest>
135
 
136
 # Option:  actionstop
137
 # Notes.:  command executed at the stop of jail (or at the end of Fail2Ban)
138
@@ -25,7 +25,7 @@ actionstart = printf %%b "Hi,\n
139
 actionstop = printf %%b "Hi,\n
140
              The jail <name> has been stopped.\n
141
              Regards,\n
142
-             Fail2Ban"|mail -s "[Fail2Ban] <name>: stopped on <fq-hostname>" <dest>
143
+             Fail2Ban"|mail -E 'set escape' -s "[Fail2Ban] <name>: stopped on <fq-hostname>" <dest>
144
 
145
 # Option:  actioncheck
146
 # Notes.:  command executed once before each actionban command
147
@@ -43,7 +43,7 @@ actionban = printf %%b "Hi,\n
148
             The IP <ip> has just been banned by Fail2Ban after
149
             <failures> attempts against <name>.\n
150
             Regards,\n
151
-            Fail2Ban"|mail -s "[Fail2Ban] <name>: banned <ip> from <fq-hostname>" <dest>
152
+            Fail2Ban"|mail -E 'set escape' -s "[Fail2Ban] <name>: banned <ip> from <fq-hostname>" <dest>
153
 
154
 # Option:  actionunban
155
 # Notes.:  command executed when unbanning an IP. Take care that the
156
-- 
157
2.33.1
158
(-)a/security/py-fail2ban/files/patch-config_filter.d_bsd-sendmail.conf (-38 lines)
Removed Link Here
1
--- config/filter.d/bsd-sendmail.conf.orig	2015-11-03 04:11:30 UTC
2
+++ config/filter.d/bsd-sendmail.conf
3
@@ -0,0 +1,35 @@
4
+# Fail2Ban configuration file
5
+#
6
+# Source: http://www.the-art-of-web.com/system/fail2ban-sendmail
7
+# Contributors: Gutza, the SASL regex
8
+#
9
+# $Revision$
10
+
11
+[INCLUDES]
12
+
13
+# Read common prefixes. If any customizations available -- read them from
14
+# common.local
15
+before = common.conf
16
+
17
+[Definition]
18
+
19
+# Option:  failregex
20
+# Notes.:  regex to match the password failures messages in the logfile. 
21
+#          The host must be matched by a group named "host". 
22
+#          The tag "<HOST>" can be used for standard IP/hostname matching
23
+#          and is only an alias for (':::f{4,6}:)?(?P<host>\S+)
24
+# Values:  TEXT
25
+
26
+failregex = \[<HOST>\] .*to MTA
27
+#           \[<HOST>\] \(may be forged\)
28
+            \[<HOST>\], reject.*\.\.\. Relaying denied
29
+            (User unknown)\n* \[<HOST>\]
30
+            badlogin: .* \[<HOST>\] plaintext .* SASL
31
+            \[<HOST>\]: possible SMTP attack:
32
+
33
+# Option:  ignoreregex
34
+# Notes.:  regex to ignore. If this regex matces, the line is ignored.
35
+# Values:  TEXT
36
+
37
+ignoreregex = 
38
+
(-)a/security/py-fail2ban/files/patch-config_filter.d_bsd-sshd.conf (-44 lines)
Removed Link Here
1
--- config/filter.d/bsd-sshd.conf.orig	2020-03-27 11:15:56 UTC
2
+++ config/filter.d/bsd-sshd.conf
3
@@ -0,0 +1,41 @@
4
+# Fail2Ban configuration file
5
+#
6
+# Author: Cyril Jaquier
7
+#
8
+# $Revision: 663 $
9
+#
10
+
11
+[INCLUDES]
12
+
13
+# Read common prefixes. If any customizations available -- read them from
14
+# common.local
15
+before = common.conf
16
+
17
+
18
+[Definition]
19
+
20
+_daemon = sshd
21
+
22
+# Option:  failregex
23
+# Notes.:  regex to match the password failures messages in the logfile. The
24
+#          host must be matched by a group named "host". The tag "<HOST>" can
25
+#          be used for standard IP/hostname matching and is only an alias for
26
+#          (?:::f{4,6}:)?(?P<host>\S+)
27
+# Values:  TEXT
28
+#
29
+failregex = ^%(__prefix_line)s(?:error: PAM: )?[A|a]uthentication (?:failure|error) for .* from <HOST>\s*$
30
+            ^%(__prefix_line)sDid not receive identification string from <HOST>$
31
+            ^%(__prefix_line)sFailed [-/\w]+ for .* from <HOST>(?: port \d*)?(?: ssh\d*)?$
32
+            ^%(__prefix_line)sROOT LOGIN REFUSED.* FROM <HOST>\s*$
33
+            ^%(__prefix_line)s[iI](?:llegal|nvalid) user .* from <HOST>\s*$
34
+            ^%(__prefix_line)s[iI](?:llegal|nvalid) user .* from <HOST> port \d*$
35
+            ^%(__prefix_line)sUser \S+ from <HOST> not allowed because not listed in AllowUsers$
36
+            ^%(__prefix_line)sauthentication failure; logname=\S* uid=\S* euid=\S* tty=\S* ruser=\S* rhost=<HOST>(?:\s+user=.*)?\s*$
37
+            ^%(__prefix_line)srefused connect from \S+ \(<HOST>\)\s*$
38
+            ^%(__prefix_line)sreverse mapping checking getaddrinfo for .* \[<HOST>\] .* POSSIBLE BREAK-IN ATTEMPT!$
39
+
40
+# Option:  ignoreregex
41
+# Notes.:  regex to ignore. If this regex matches, the line is ignored.
42
+# Values:  TEXT
43
+#
44
+ignoreregex = 
(-)a/security/py-fail2ban/files/patch-fail2ban_server_action.py (-30 lines)
Removed Link Here
1
From 2b6bb2c1bed8f7009631e8f8c306fa3160324a49 Mon Sep 17 00:00:00 2001
2
From: "Sergey G. Brester" <serg.brester@sebres.de>
3
Date: Mon, 8 Feb 2021 17:19:24 +0100
4
Subject: [PATCH] follow bpo-37324: :ref:`collections-abstract-base-classes`
5
 moved to the :mod:`collections.abc` module
6
7
(since 3.10-alpha.5 `MutableMapping` is missing in collections module)
8
---
9
 fail2ban/server/action.py | 5 ++++-
10
 1 file changed, 4 insertions(+), 1 deletion(-)
11
12
diff --git fail2ban/server/action.py fail2ban/server/action.py
13
index 3bc48fe0..f0f1e6f5 100644
14
--- fail2ban/server/action.py
15
+++ fail2ban/server/action.py
16
@@ -30,7 +30,10 @@ import tempfile
17
 import threading
18
 import time
19
 from abc import ABCMeta
20
-from collections import MutableMapping
21
+try:
22
+	from collections.abc import MutableMapping
23
+except ImportError:
24
+	from collections import MutableMapping
25
 
26
 from .failregex import mapTag2Opt
27
 from .ipdns import DNSUtils
28
-- 
29
2.32.0
30
(-)a/security/py-fail2ban/files/patch-fail2ban_server_actions.py (-28 lines)
Removed Link Here
1
From 42dee38ad2ac5c3f23bdf297d824022923270dd9 Mon Sep 17 00:00:00 2001
2
From: "Sergey G. Brester" <serg.brester@sebres.de>
3
Date: Mon, 8 Feb 2021 17:25:45 +0100
4
Subject: [PATCH] amend for `Mapping`
5
6
---
7
 fail2ban/server/actions.py | 5 ++++-
8
 1 file changed, 4 insertions(+), 1 deletion(-)
9
10
diff --git fail2ban/server/actions.py fail2ban/server/actions.py
11
index b7b95b44..897d907c 100644
12
--- fail2ban/server/actions.py
13
+++ fail2ban/server/actions.py
14
@@ -28,7 +28,10 @@ import logging
15
 import os
16
 import sys
17
 import time
18
-from collections import Mapping
19
+try:
20
+	from collections.abc import Mapping
21
+except ImportError:
22
+	from collections import Mapping
23
 try:
24
 	from collections import OrderedDict
25
 except ImportError:
26
-- 
27
2.32.0
28
(-)a/security/py-fail2ban/files/patch-fail2ban_server_jails.py (-28 lines)
Removed Link Here
1
From 9f1d1f4fbd0804695a976beb191f2c49a2739834 Mon Sep 17 00:00:00 2001
2
From: "Sergey G. Brester" <serg.brester@sebres.de>
3
Date: Mon, 8 Feb 2021 17:35:59 +0100
4
Subject: [PATCH] amend for `Mapping` (jails)
5
6
---
7
 fail2ban/server/jails.py | 5 ++++-
8
 1 file changed, 4 insertions(+), 1 deletion(-)
9
10
diff --git fail2ban/server/jails.py fail2ban/server/jails.py
11
index 972a8c4b..27e12ddf 100644
12
--- fail2ban/server/jails.py
13
+++ fail2ban/server/jails.py
14
@@ -22,7 +22,10 @@ __copyright__ = "Copyright (c) 2004 Cyril Jaquier, 2013- Yaroslav Halchenko"
15
 __license__ = "GPL"
16
 
17
 from threading import Lock
18
-from collections import Mapping
19
+try:
20
+	from collections.abc import Mapping
21
+except ImportError:
22
+	from collections import Mapping
23
 
24
 from ..exceptions import DuplicateJailException, UnknownJailException
25
 from .jail import Jail
26
-- 
27
2.32.0
28
(-)a/security/py-fail2ban/files/patch-setup.py (-27 lines)
Removed Link Here
1
--- setup.py.orig	2020-11-23 20:43:03 UTC
2
+++ setup.py
3
@@ -39,14 +39,7 @@ from distutils.command.build_scripts import build_scri
4
 if setuptools is None:
5
 	from distutils.command.install import install
6
 	from distutils.command.install_scripts import install_scripts
7
-try:
8
-	# python 3.x
9
-	from distutils.command.build_py import build_py_2to3
10
-	from distutils.command.build_scripts import build_scripts_2to3
11
-	_2to3 = True
12
-except ImportError:
13
-	# python 2.x
14
-	_2to3 = False
15
+_2to3 = False
16
 
17
 import os
18
 from os.path import isfile, join, isdir, realpath
19
@@ -186,7 +179,6 @@ commands.'''
20
 if setuptools:
21
 	setup_extra = {
22
 		'test_suite': "fail2ban.tests.utils.gatherTests",
23
-		'use_2to3': True,
24
 	}
25
 else:
26
 	setup_extra = {}
27
- 

Return to bug 266810