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/09/16 13:07] val [Сервис Fail2ban] |
сервис_fail2ban [2021/02/23 15:55] val [Блокировка через iptables] |
||
---|---|---|---|
Line 67: | 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 100: | 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>.* | ||
+ | </code> | ||
+ | |||
+ | ==== Уведомление по email ==== | ||
+ | <code> | ||
+ | # cat /etc/fail2ban/action.d/mail-admin.conf | ||
+ | </code><code> | ||
+ | [Definition] | ||
+ | |||
+ | actionban = printf %%b "Hi,\n | ||
+ | Ban this <ip> | ||
+ | Regards,\n | ||
+ | Fail2Ban"|mail -s "[Fail2Ban] Ban <name> <ip>" <dest> | ||
+ | |||
+ | actionunban = printf %%b "Hi,\n | ||
+ | Unban this <ip> | ||
+ | Regards,\n | ||
+ | Fail2Ban"|mail -s "[Fail2Ban] Unban <name> <ip>" <dest> | ||
+ | |||
+ | [Init] | ||
+ | |||
+ | name = mail-admin | ||
- | ignoreregex = | + | dest = student |
</code> | </code> | ||
Line 176: | Line 193: | ||
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> | ||