Variables are not passed correctly, so define actions in each jail

tags/0.0.1
Daniel Berteaud 12 years ago
parent d941c985ae
commit 97d352dda1
  1. 2
      root/etc/e-smith/templates/etc/fail2ban/jail.conf/10BanTime
  2. 10
      root/etc/e-smith/templates/etc/fail2ban/jail.conf/25Actions
  3. 9
      root/etc/e-smith/templates/etc/fail2ban/jail.conf/30Service10ssh
  4. 8
      root/etc/e-smith/templates/etc/fail2ban/jail.conf/30Service15dovecot
  5. 41
      root/etc/e-smith/templates/etc/fail2ban/jail.conf/30Service25httpd
  6. 2
      root/etc/e-smith/templates/etc/fail2ban/jail.conf/30Service30pam
  7. 8
      root/etc/e-smith/templates/etc/fail2ban/jail.conf/30Service35SOGo
  8. 7
      root/etc/e-smith/templates/etc/fail2ban/jail.conf/90Recidive

@ -1,6 +1,6 @@
{
my $bantime = $fail2ban{'BanTime'} || '1800';
our $bantime = $fail2ban{'BanTime'} || '1800';
$OUT .= "bantime = $bantime";

@ -1,7 +1,7 @@
{
our $action = "action = smeserver[port=\"<port>\", protocol=<protocol>, bantime=<bantime>]";
if (($fail2ban{'Mail'} || 'disabled') eq 'enabled'){
my $dest = $fail2ban{'MailRecipient'} || 'root';
$action .= " sendmail[name=<name>, dest=$dest]\n";
}
our $mail = $fail2ban{'Mail'} || 'disabled';
our $maildest = $fail2ban{'MailRecipient'} || 'root';
return '';
}

@ -8,10 +8,11 @@ $OUT .=<<"EOF";
[ssh]
enabled = true
filter = sshd
port = $port
protocol = tcp
name = ssh
$action
logpath = /var/log/sshd/current
action = smeserver[port="$port",protocol=tcp,bantime=$bantime]
EOF
$OUT .= " sendmail[name=SSH,dest=$maildest]\n"
if ($mail eq 'enabled');
}

@ -14,11 +14,11 @@ $OUT .=<<"EOF";
[imap]
enabled = true
filter = dovecot
port = $port
protocol = tcp
name = dovecot
$action
logpath = /var/log/dovecot/current
action = smeserver[port="$port",protocol=tcp,bantime=$bantime]
EOF
$OUT .= " sendmail[name=Dovecot,dest=$maildest]\n"
if ($mail eq 'enabled');
}

@ -12,39 +12,46 @@ $OUT .=<<"EOF";
[http-overflows]
enabled = true
filter = apache-overflows
port = $port
protocol = tcp
name = apache-overflows
$action
logpath = /var/log/httpd/error_log
action = smeserver[port="$port",protocol=tcp,bantime=$bantime]
EOF
$OUT .= " sendmail[name="Apache (overflows)",dest=$maildest]\n"
if ($mail eq 'enabled');
$OUT .=<<"EOF";
[http-noscript]
enabled = true
filter = apache-noscript
port = $port
protocol = tcp
name = apache-noscript
$action
logpath = /var/log/httpd/error_log
action = smeserver[port="$port",protocol=tcp,bantime=$bantime]
EOF
$OUT .= " sendmail[name="Apache (noscript)",dest=$maildest]\n"
if ($mail eq 'enabled');
$OUT .=<<"EOF";
[http-scan]
enabled = true
filter = apache-scan
port = $port
protocol = tcp
name = apache-scan
$action
logpath = /var/log/httpd/error_log
action = smeserver[port="$port",protocol=tcp,bantime=$bantime]
EOF
$OUT .= " sendmail[name="Apache (scan)",dest=$maildest]\n"
if ($mail eq 'enabled');
$OUT .=<<"EOF";
[http-auth]
enabled = true
filter = apache-auth
port = $port
protocol = tcp
name = apache-auth
$action
logpath = /var/log/httpd/error_log
action = smeserver[port="$port",protocol=tcp,bantime=$bantime]
EOF
$OUT .= " sendmail[name="Apache (auth)",dest=$maildest]\n"
if ($mail eq 'enabled');
}

@ -3,6 +3,6 @@
enabled = true
filter = pam-generic
name = = pam-generic
{"$action"}
logpath = /var/log/secure
action = smeserver[bantime=$bantime]

@ -12,11 +12,11 @@ $OUT .=<<"EOF";
[sogo]
enabled = true
filter = sogo
port = $port
protocol = tcp
name = sogo
$action
logpath = /var/log/sogo/sogo.log
action = smeserver[port="$port",protocol=tcp,bantime=$bantime]
EOF
$OUT .= " sendmail[name=SOGo,dest=$maildest]\n"
if ($mail eq 'enabled');
}

@ -7,4 +7,9 @@ bantime = 604800
findtime = 86400
maxretry = 5
backend = polling
{"$action"}
action = smeserver[bantime=604800]
{
$OUT .= " sendmail[name=Recidive,dest=$maildest]\n"
if ($mail eq 'enabled');
$OUT .= '';
}

Loading…
Cancel
Save