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
Next revision Both sides next revision
сервис_fail2ban [2021/11/17 16:17]
val [Установка]
сервис_fail2ban [2024/05/09 11:01]
val [Установка]
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]
 enabled = true enabled = true
 maxretry = 3 maxretry = 3
 +#bantime = 30d
 +#action = iptables-allports[blocktype=DROP]
 +#action = route[blocktype=blackhole]
 </​code>​ </​code>​
  
Line 56: Line 65:
  
 ===== Интеграция fail2ban и cisco log ===== ===== Интеграция fail2ban и cisco log =====
 +
 +  * Резервное копирование конфигурации
 +
 <​code>​ <​code>​
 # cat /​etc/​fail2ban/​jail.d/​cisco-change-config.conf # cat /​etc/​fail2ban/​jail.d/​cisco-change-config.conf
Line 93: Line 105:
 bantime ​    = 300 bantime ​    = 300
 filter ​     = snort_filter filter ​     = snort_filter
-maxretry ​   = 1+maxretry ​   = 3
 logpath ​    = /​var/​log/​auth.log logpath ​    = /​var/​log/​auth.log
 #​action ​     = mail-admin #​action ​     = mail-admin
Line 153: Line 165:
  
 <​code>​ <​code>​
 +server# rsh router show access-lists
 +</​code><​code>​
 # cat /​root/​cisco-acl-deny.sh # cat /​root/​cisco-acl-deny.sh
 </​code><​code>​ </​code><​code>​
Line 172: Line 186:
  ​permit udp any any  ​permit udp any any
  ​permit tcp any any established  ​permit tcp any any established
- ​deny ​  ip any any log+ ​deny ​  ip any any log
 end end
 </​code><​code>​ </​code><​code>​
сервис_fail2ban.txt · Last modified: 2024/05/11 15:47 by val