Add Mystic BBS f2b with systemd overrwrite
This commit is contained in:
parent
c5986ded53
commit
e701d4990c
21
fail2ban/action.d/mysticbbs.conf
Normal file
21
fail2ban/action.d/mysticbbs.conf
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
# Fail2Ban configuration file
|
||||||
|
#
|
||||||
|
# Author: Mario Fetka <mario.fetka@gmail.com>
|
||||||
|
#
|
||||||
|
#
|
||||||
|
|
||||||
|
[Definition]
|
||||||
|
|
||||||
|
actionstart = touch /var/run/fail2ban/fail2ban.mysticbbs
|
||||||
|
|
||||||
|
actionstop = rm -f /var/run/fail2ban/fail2ban.mysticbbs
|
||||||
|
|
||||||
|
actioncheck =
|
||||||
|
|
||||||
|
actionban = grep -qxF '<ip>' @MYSTIC_DIR@/data/denylist.txt || echo '<ip>' >> @MYSTIC_DIR@/data/denylist.txt
|
||||||
|
|
||||||
|
actionunban = sed -e '/<ip>/d' -i @MYSTIC_DIR@/data/denylist.txt
|
||||||
|
|
||||||
|
[Init]
|
||||||
|
|
||||||
|
init = Mystic BBS notifications
|
12
fail2ban/filter.d/mysticbbs.conf
Normal file
12
fail2ban/filter.d/mysticbbs.conf
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
# Fail2Ban filter for Mystic BBS
|
||||||
|
|
||||||
|
[INCLUDES]
|
||||||
|
|
||||||
|
before = common.conf
|
||||||
|
|
||||||
|
[Definition]
|
||||||
|
|
||||||
|
_daemon = mis
|
||||||
|
|
||||||
|
failregex = ^%(__prefix_line)s.*(TELNET|SSH) .*Auto banning IP <HOST>$
|
||||||
|
ignoreregex =
|
9
fail2ban/jail.d/mysticbbs.conf
Normal file
9
fail2ban/jail.d/mysticbbs.conf
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
[mysticbbs]
|
||||||
|
enabled = true
|
||||||
|
port = 23
|
||||||
|
protocol = tcp
|
||||||
|
filter = mysticbbs
|
||||||
|
logpath = @MYSTIC_DIR@/logs/mis.log
|
||||||
|
maxretry = 1
|
||||||
|
action = iptables-ipset-proto6-allports
|
||||||
|
mysticbbs
|
3
fail2ban/systemd/howto.txt
Normal file
3
fail2ban/systemd/howto.txt
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
https://docs.linuxfabrik.ch/monitoring-plugins/fail2ban.html
|
||||||
|
|
||||||
|
put into /etc/systemd/system/fail2ban.service.d/override.conf
|
4
fail2ban/systemd/override.conf
Normal file
4
fail2ban/systemd/override.conf
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
[Service]
|
||||||
|
ExecStartPost=/usr/bin/sh -c "while ! [ -S /var/run/fail2ban/fail2ban.sock ]; do sleep 1; done"
|
||||||
|
ExecStartPost=/usr/bin/chgrp fail2ban /var/run/fail2ban/fail2ban.sock
|
||||||
|
ExecStartPost=/usr/bin/chmod g+w /var/run/fail2ban/fail2ban.sock
|
Loading…
Reference in New Issue
Block a user