Fix: usedns=no in fail2ban, exact quoted host regex for asterisk, and timeout 2 on all fail2ban-client calls
This commit is contained in:
1 parent
aba35dbe3a
commit
8bbeb9caae
3 files changed
+48
-11
No files matched your search
+36
-1
@@ -34,7 +34,7 @@ cat << 'EOF' > /etc/fail2ban/filter.d/asterisk.conf
|
||||
before = common.conf
|
||||
|
||||
[Definition]
|
||||
failregex = ^(%(__prefix_line)s|\[\]\s*)*(?:NOTICE|SECURITY)\[\d+\]:? (?:\S+: )?(?:Registration from |Call from |Invalid password for |Sending fake auth challenge to |No matching endpoint found for )?'?<HOST>(?::\d+)?'?
|
||||
failregex = ^(%(__prefix_line)s|\[\]\s*)*(?:NOTICE|SECURITY)\[\d+\]:? (?:\S+: )?(?:Registration from |Call from |Invalid password for |Sending fake auth challenge to |No matching endpoint found for )?'<HOST>'(?::\d+)?
|
||||
^(%(__prefix_line)s|\[\]\s*)*SECURITY\[\d+\]:? (?:\S+: )?SecurityEvent="(?:FailedACL|InvalidAccountID|ChallengeResponseFailed|InvalidPassword|AuthFailed)"(?:.*?)RemoteAddress="IPV[46]/(?:UDP|TCP|TLS)/<HOST>/\d+"
|
||||
ignoreregex =
|
||||
EOF
|
||||
@@ -47,6 +47,41 @@ ignoreregex =
|
||||
EOF
|
||||
chmod 0644 /etc/fail2ban/filter.d/nexus-web.conf
|
||||
|
||||
cat << 'EOF' > /etc/fail2ban/jail.local
|
||||
[DEFAULT]
|
||||
bantime = 3600
|
||||
findtime = 600
|
||||
maxretry = 3
|
||||
usedns = no
|
||||
ignoreip = 127.0.0.1/8 ::1 10.0.0.0/8 172.16.0.0/12 192.168.0.0/16
|
||||
|
||||
[asterisk]
|
||||
enabled = true
|
||||
port = 5060,5061
|
||||
protocol = udp
|
||||
filter = asterisk
|
||||
logpath = /var/log/asterisk/messages
|
||||
action = %(banaction)s[name=%(__name__)s, bantime="%(bantime)s", port="%(port)s", protocol="%(protocol)s", chain="%(chain)s"]
|
||||
maxretry = 3
|
||||
bantime = 3600
|
||||
|
||||
[nginx-http-auth]
|
||||
enabled = true
|
||||
port = http,https,8443
|
||||
logpath = /var/log/nginx/*error.log
|
||||
maxretry = 5
|
||||
bantime = 3600
|
||||
|
||||
[nexus-web]
|
||||
enabled = true
|
||||
port = http,https,8443
|
||||
filter = nexus-web
|
||||
logpath = /var/log/nexus_security.log
|
||||
maxretry = 3
|
||||
findtime = 600
|
||||
bantime = 3600
|
||||
EOF
|
||||
|
||||
echo "-> Droits applicatifs et ACL POSIX (/etc/asterisk et /var/www/nexus-pbx)..."
|
||||
usermod -aG asterisk www-data 2>/dev/null || true
|
||||
usermod -aG www-data asterisk 2>/dev/null || true
|
||||
|
||||
Reference in new issue
Block a user