add fail2ban config files
This commit is contained in:
parent
ae8f129b70
commit
45b4cf7c69
@ -6,7 +6,7 @@ Installscript / Systemd Files / Themes German&English
|
||||
bash -c "$(wget -qLO - https://gitea.disconnected-by-peer.at/geos_one/mystic/raw/branch/main/install.sh)"
|
||||
|
||||
|
||||
#Thankyou
|
||||
Thankyou
|
||||
|
||||
https://vswitchzero.com/mystic-systemd/ for the initial systemd scripts for mis and mrc
|
||||
https://tteck.github.io/Proxmox/ for the layout of the install script and the cool error tracker.
|
||||
|
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/blacklist.txt || echo '<ip>' >> @MYSTIC_DIR@/data/blacklist.txt
|
||||
|
||||
actionunban = sed -e '/<ip>/d' -i @MYSTIC_DIR@/data/blacklist.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
|
1
fail2ban/systemd/howto.txt
Normal file
1
fail2ban/systemd/howto.txt
Normal file
@ -0,0 +1 @@
|
||||
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