initial commit of file from CVS for smeserver-manager on Fri Mar 22 14:54:28 AEDT 2024

This commit is contained in:
Trevor Batley
2024-03-22 14:54:28 +11:00
parent eed507434f
commit db139626ba
242 changed files with 25308 additions and 2 deletions

View File

@@ -0,0 +1,25 @@
{
my $port = (${'httpd-e-smith'}{'TCPPort'} || '80') .','.
($modSSL{'TCPPort'} || '443');
my $status = $smanager{'status'} || 'disabled';
my $f2b = $smanager{'Fail2Ban'} || 'enabled';
return "" if (($status ne 'enabled') || ($f2b ne 'enabled'));
$OUT .=<<"EOF";
[smanager]
enabled = true
port = $port
filter = smanager
logpath = /usr/share/smanager/log/production.log
maxretry = 3
findtime = 300
bantime = 1800
action = smeserver-iptables[port="$port",protocol=tcp,bantime=$bantime]
EOF
$OUT .= " smeserver-sendmail[name=\"SManager\",dest=$maildest]\n"
if ($mail eq 'enabled');
}

View File

@@ -0,0 +1,26 @@
# Fail2Ban filter for Smanager attempted bypasses
[Definition]
#[Mon Nov 9 20:33:34 2020] [info] Login FAILED: mab 192.168.0.11
#_groupsre = (?:(?:,?\s*"\w+":(?:"[^"]+"|\w+))*)
#failregex = ^\{%(_groupsre)s,?\s*"remoteAddr":"<HOST>"%(_groupsre)s,?\s*"message":"Login failed:
# ^\{%(_groupsre)s,?\s*"remoteAddr":"<HOST>"%(_groupsre)s,?\s*"message":"Trusted domain error.
failregex = ^\[.*\] \[info\] Login FAILED: .*\t<HOST>$
#ignoreregex =
ignoreregex = ^\[.*\] \[debug\] .*$
ignoreregex = ^\[.*\] \[info\] Login succeeded: .*$
#datepattern = ,?\s*"time"\s*:\s*"%%Y-%%m-%%d[T ]%%H:%%M:%%S(%%z)?"
#datepattern = ^[%%a %%b %%d %%H:%%M:%%S %%Y]
#datepattern = ^\[%%a %%b %%-d %%X %%Y\]
#^[LN-BEG]
# ^[%%a %%b %%-d %%X %%Y]
# {^LN-BEG}Epoch
datepattern = {^LN-BEG}
# Author: Michel Begue