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] [ssh]
enabled = true enabled = true
filter = sshd filter = sshd
action = smeserver[port=$port, protocol=tcp] port = $port
protocol = tcp
name = ssh
logpath = /var/log/sshd/current logpath = /var/log/sshd/current
EOF EOF
} }

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

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

Loading…
Cancel
Save