Fix: add [INCLUDES] before = common.conf to fail2ban asterisk filter
This commit is contained in:
1 parent
4370deb26c
commit
6772c05e83
2 files changed
+16
-1
No files matched your search
@@ -344,6 +344,9 @@ App\FirewallManager::applyNginxConfig((int)($st["admin_https_port"] ?? 8443), (i
|
||||
|
||||
# Filtre Fail2ban Asterisk & Nexus-Web
|
||||
cat << 'EOF' > /etc/fail2ban/filter.d/asterisk.conf
|
||||
[INCLUDES]
|
||||
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+)?'?
|
||||
^(%(__prefix_line)s|\[\]\s*)*SECURITY\[\d+\]:? (?:\S+: )?SecurityEvent="(?:FailedACL|InvalidAccountID|ChallengeResponseFailed|InvalidPassword|AuthFailed)"(?:.*?)RemoteAddress="IPV[46]/(?:UDP|TCP|TLS)/<HOST>/\d+"
|
||||
|
||||
+13
-1
@@ -28,7 +28,18 @@ chmod 0664 /var/log/asterisk/messages /var/log/asterisk/security.log 2>/dev/null
|
||||
chown www-data:asterisk /var/log/nexus_security.log 2>/dev/null || true
|
||||
chmod 0664 /var/log/nexus_security.log 2>/dev/null || true
|
||||
|
||||
echo "-> Filtre Fail2ban Nexus-Web..."
|
||||
echo "-> Filtres Fail2ban Asterisk & Nexus-Web..."
|
||||
cat << 'EOF' > /etc/fail2ban/filter.d/asterisk.conf
|
||||
[INCLUDES]
|
||||
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+)?'?
|
||||
^(%(__prefix_line)s|\[\]\s*)*SECURITY\[\d+\]:? (?:\S+: )?SecurityEvent="(?:FailedACL|InvalidAccountID|ChallengeResponseFailed|InvalidPassword|AuthFailed)"(?:.*?)RemoteAddress="IPV[46]/(?:UDP|TCP|TLS)/<HOST>/\d+"
|
||||
ignoreregex =
|
||||
EOF
|
||||
chmod 0644 /etc/fail2ban/filter.d/asterisk.conf
|
||||
|
||||
cat << 'EOF' > /etc/fail2ban/filter.d/nexus-web.conf
|
||||
[Definition]
|
||||
failregex = ^.*\[NEXUS-WEB-AUTH-FAIL\]:\s*<HOST>.*$
|
||||
@@ -95,3 +106,4 @@ echo "=========================================================="
|
||||
echo " [OK] Réparation terminée ! Toutes les permissions sont actives."
|
||||
echo "=========================================================="
|
||||
/var/www/nexus-pbx/scripts/nexus-banner.sh --force || true
|
||||
|
||||
Reference in new issue
Block a user