This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
сервис_fail2ban [2020/06/26 14:04] val [Блокировка через iptables] |
сервис_fail2ban [2020/11/18 20:17] val [Блокировка через cisco acl] |
||
---|---|---|---|
Line 2: | Line 2: | ||
* [[https://thefragens.com/2010/11/checking-fail2ban-regex/|Checking Fail2ban regex]] | * [[https://thefragens.com/2010/11/checking-fail2ban-regex/|Checking Fail2ban regex]] | ||
+ | * [[https://forum.yunohost.org/t/fail2ban-high-cpu-usage/2439|Fail2ban high CPU usage]] | ||
===== Установка ===== | ===== Установка ===== | ||
Line 8: | Line 9: | ||
<code> | <code> | ||
# apt install fail2ban | # apt install fail2ban | ||
- | |||
- | # cd /etc/fail2ban/ | ||
</code> | </code> | ||
Line 15: | Line 14: | ||
<code> | <code> | ||
- | # cat jail.conf | + | # cat /etc/fail2ban/jail.conf |
+ | |||
+ | # ls /etc/fail2ban/jail.d/ | ||
- | # ls jail.d/ | + | # cat /etc/fail2ban/jail.d/defaults-debian.conf |
- | # cat filter.d/sshd.conf | + | # cat /etc/fail2ban/filter.d/sshd.conf |
- | # cat filter.d/asterisk.conf | + | # cat /etc/fail2ban/filter.d/asterisk.conf |
</code><code> | </code><code> | ||
- | # cat jail.local | + | # cat /etc/fail2ban/jail.local |
</code><code> | </code><code> | ||
[sshd] | [sshd] | ||
Line 30: | Line 31: | ||
[asterisk] | [asterisk] | ||
enabled = true | enabled = true | ||
- | maxretry = 3 | + | maxretry = 3 |
</code> | </code> | ||
Line 66: | Line 67: | ||
# cat /etc/fail2ban/filter.d/cisco-change-config.conf | # cat /etc/fail2ban/filter.d/cisco-change-config.conf | ||
</code><code> | </code><code> | ||
- | [INCLUDES] | ||
- | |||
[Definition] | [Definition] | ||
Line 99: | Line 98: | ||
# cat /etc/fail2ban/filter.d/snort_filter.conf | # cat /etc/fail2ban/filter.d/snort_filter.conf | ||
</code><code> | </code><code> | ||
- | [INCLUDES] | ||
- | |||
[Definition] | [Definition] | ||
failregex = .*snort.*Priority: 1.*} <HOST>.* | failregex = .*snort.*Priority: 1.*} <HOST>.* | ||
# .*snort.*Priority: 2.*} <HOST>.* | # .*snort.*Priority: 2.*} <HOST>.* | ||
- | |||
- | ignoreregex = | ||
</code> | </code> | ||
Line 175: | Line 170: | ||
actionban = /root/cisco-change-firewall.sh | actionban = /root/cisco-change-firewall.sh | ||
- | actionunban = /root/cisco-change-firewall.sh | + | # f2b bug |
+ | actionunban = echo /root/cisco-change-firewall.sh | at now + 1 min | ||
</code> | </code> | ||