User Tools

Site Tools


сервис_fail2ban

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revision Both sides next revision
сервис_fail2ban [2022/12/05 07:17]
val [Настройка]
сервис_fail2ban [2024/05/11 10:54]
val [Интеграция fail2ban и snort]
Line 6: Line 6:
  
   * [[https://​help.ubuntu.com/​community/​Fail2ban|Fail2ban]]   * [[https://​help.ubuntu.com/​community/​Fail2ban|Fail2ban]]
 +  * [[https://​bugs.launchpad.net/​ubuntu/​+source/​fail2ban/​+bug/​2055114|fail2ban is broken in 24.04 Noble]]
  
 <​code>​ <​code>​
 debian11# apt install iptables debian11# apt install iptables
 +debian12# apt install iptables rsyslog
  
 # apt install fail2ban # apt install fail2ban
 +
 +ubuntu24# wget https://​launchpad.net/​ubuntu/​+source/​fail2ban/​1.1.0-1/​+build/​28291332/​+files/​fail2ban_1.1.0-1_all.deb
 +ubuntu24# dpkg -i fail2ban_1.1.0-1_all.deb ​
 </​code>​ </​code>​
  
Line 30: Line 35:
 [sshd] [sshd]
 maxretry = 6 maxretry = 6
 +#ignoreip = 192.168.X.0/​24 192.168.100+X.0/​24
  
 [asterisk] [asterisk]
Line 36: Line 42:
 #bantime = 30d #bantime = 30d
 #action = iptables-allports[blocktype=DROP] #action = iptables-allports[blocktype=DROP]
-#action = route+#action = route[blocktype=blackhole]
 </​code>​ </​code>​
  
Line 102: Line 108:
 logpath ​    = /​var/​log/​auth.log logpath ​    = /​var/​log/​auth.log
 #​action ​     = mail-admin #​action ​     = mail-admin
 +#​action ​     = iptables-allports
 #​action ​     = iptables-allports-forward #​action ​     = iptables-allports-forward
 #​action ​     = cisco-acl #​action ​     = cisco-acl
Line 111: Line 118:
 failregex = .*snort.*Priority:​ 1.*} <​HOST>​.* failregex = .*snort.*Priority:​ 1.*} <​HOST>​.*
 #        .*snort.*Priority:​ 2.*} <​HOST>​.* #        .*snort.*Priority:​ 2.*} <​HOST>​.*
 +
 +#failregex = .*Original Client IP: <​HOST>​.*
 </​code>​ </​code>​
  
Line 135: Line 144:
 dest = student dest = student
 </​code>​ </​code>​
 +
 +  * [[#​Запуск и отладка]]
  
 ==== Блокировка через iptables ==== ==== Блокировка через iptables ====
Line 156: Line 167:
 </​code>​ </​code>​
  
 +  * [[#​Запуск и отладка]]
 ==== Блокировка через cisco acl ==== ==== Блокировка через cisco acl ====
  
Line 209: Line 221:
 </​code>​ </​code>​
  
 +  * [[#​Запуск и отладка]]
 ===== Отладка собственных фильтров ===== ===== Отладка собственных фильтров =====
  
сервис_fail2ban.txt · Last modified: 2024/05/11 15:47 by val