Define actions in the default section, and add a prop to enable mail alerts

tags/0.0.1
Daniel Berteaud 12 years ago
parent 0ba11fc416
commit 4b7d3586d5
  1. 7
      root/etc/e-smith/templates/etc/fail2ban/jail.conf/25Actions
  2. 4
      root/etc/e-smith/templates/etc/fail2ban/jail.conf/30Service10ssh
  3. 4
      root/etc/e-smith/templates/etc/fail2ban/jail.conf/30Service15dovecot
  4. 16
      root/etc/e-smith/templates/etc/fail2ban/jail.conf/30Service25httpd

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

@ -8,7 +8,9 @@ $OUT .=<<"EOF";
[ssh]
enabled = true
filter = sshd
action = smeserver[port=$port, protocol=tcp]
port = $port
protocol = tcp
name = ssh
logpath = /var/log/sshd/current
EOF
}

@ -14,7 +14,9 @@ $OUT .=<<"EOF";
[imap]
enabled = true
filter = dovecot
action = smeserver[port="$port", protocol=tcp]
port = $port
protocol = tcp
name = dovecot
logpath = /var/log/dovecot/current
EOF

@ -12,25 +12,33 @@ $OUT .=<<"EOF";
[http-overflows]
enabled = true
filter = apache-overflows
action = smeserver[port="$port", protocol=tcp]
port = $port
protocol = tcp
name = apache-overflows
logpath = /var/log/httpd/error_log
[http-noscript]
enabled = true
filter = apache-noscript
action = smeserver[port="$port", protocol=tcp]
port = $port
protocol = tcp
name = apache-noscript
logpath = /var/log/httpd/error_log
[http-scan]
enabled = true
filter = apache-scan
action = smeserver[port="$port", protocol=tcp]
port = $port
protocol = tcp
name = apache-scan
logpath = /var/log/httpd/error_log
[http-auth]
enabled = true
filter = apache-auth
action = smeserver[port="$port", protocol=tcp]
port = $port
protocol = tcp
name = apache-auth
logpath = /var/log/httpd/error_log
EOF

Loading…
Cancel
Save