فهرست منبع

Make ban action more reflective of the attack type (#13)

DigiDaz 9 سال پیش
والد
کامیت
53b9f40b40
1فایلهای تغییر یافته به همراه42 افزوده شده و 8 حذف شده
  1. 42 8
      debian/resources/fail2ban/jail.local

+ 42 - 8
debian/resources/fail2ban/jail.local

@@ -1,33 +1,67 @@
-[freeswitch]
+[freeswitch-udp]
 enabled  = true
 enabled  = true
 port     = 5060,5061,5080,5081
 port     = 5060,5061,5080,5081
 protocol = all
 protocol = all
 filter   = freeswitch
 filter   = freeswitch
 logpath  = /var/log/freeswitch/freeswitch.log
 logpath  = /var/log/freeswitch/freeswitch.log
-action   = iptables-allports[name=freeswitch, protocol=all]
+action   = iptables-multiport[name=freeswitch-udp, port="5060,5061,5080,5081", protocol=udp]
 maxretry = 5
 maxretry = 5
 findtime = 600
 findtime = 600
 bantime  = 600
 bantime  = 600
 #          sendmail-whois[name=FreeSwitch, dest=root, [email protected]] #no smtp server installed
 #          sendmail-whois[name=FreeSwitch, dest=root, [email protected]] #no smtp server installed
 
 
-[freeswitch-ip]
-enabled	 = true
+[freeswitch-tcp]
+enabled  = true
+port     = 5060,5061,5080,5081
+protocol = all
+filter   = freeswitch
+logpath  = /var/log/freeswitch/freeswitch.log
+action   = iptables-multiport[name=freeswitch-tcp, port="5060,5061,5080,5081", protocol=tcp]
+maxretry = 5
+findtime = 600
+bantime  = 600
+#          sendmail-whois[name=FreeSwitch, dest=root, [email protected]] #no smtp server installed
+
+[freeswitch-ip-tcp]
+enabled  = true
+port     = 5060,5061,5080,5081
+protocol = all
+filter   = freeswitch-ip
+logpath  = /var/log/freeswitch/freeswitch.log
+action   = iptables-multiport[name=freeswitch-ip-tcp, port="5060,5061,5080,5081", protocol=tcp]
+maxretry = 1
+findtime = 30
+bantime  = 86400
+
+[freeswitch-ip-udp]
+enabled  = true
 port     = 5060,5061,5080,5081
 port     = 5060,5061,5080,5081
 protocol = all
 protocol = all
 filter   = freeswitch-ip
 filter   = freeswitch-ip
 logpath  = /var/log/freeswitch/freeswitch.log
 logpath  = /var/log/freeswitch/freeswitch.log
-action   = iptables-allports[name=freeswitch-ip, protocol=all]
+action   = iptables-multiport[name=freeswitch-ip-udp, port="5060,5061,5080,5081", protocol=udp]
 maxretry = 1
 maxretry = 1
 findtime = 30
 findtime = 30
 bantime  = 86400
 bantime  = 86400
 
 
-[freeswitch-dos]
+[freeswitch-dos-udp]
 enabled  = true
 enabled  = true
 port     = 5060,5061,5080,5081
 port     = 5060,5061,5080,5081
 protocol = all
 protocol = all
 filter   = freeswitch-dos
 filter   = freeswitch-dos
 logpath  = /var/log/freeswitch/freeswitch.log
 logpath  = /var/log/freeswitch/freeswitch.log
-action   = iptables-allports[name=freeswitch-dos, protocol=all]
+action   = iptables-multiport[name=freeswitch-dos-udp, port="5060,5061,5080,5081", protocol=udp]
+maxretry = 50
+findtime = 30
+bantime  = 6000
+
+[freeswitch-dos-tcp]
+enabled  = true
+port     = 5060,5061,5080,5081
+protocol = all
+filter   = freeswitch-dos
+logpath  = /var/log/freeswitch/freeswitch.log
+action   = iptables-multiport[name=freeswitch-dos-tcp, port="5060,5061,5080,5081", protocol=tcp]
 maxretry = 50
 maxretry = 50
 findtime = 30
 findtime = 30
 bantime  = 6000
 bantime  = 6000
@@ -42,7 +76,7 @@ action   = iptables-multiport[name=fusionpbx, port="http,https", protocol=tcp]
 #          sendmail-whois[name=fusionpbx, dest=root, [email protected]] #no smtp server installed
 #          sendmail-whois[name=fusionpbx, dest=root, [email protected]] #no smtp server installed
 maxretry = 10
 maxretry = 10
 findtime = 600
 findtime = 600
-bantime  = 600	
+bantime  = 600
 
 
 [nginx-404]
 [nginx-404]
 enabled  = true
 enabled  = true