7 Commits

Author SHA1 Message Date
Javier Bértoli
0cdcd5b673 Release v1.3.1 2014-02-11 09:00:40 -03:00
Javier Bértoli
12dc849ad3 Fix ignoreip computation in jail.local template (patch contributed by @gwarf) 2014-02-11 08:58:47 -03:00
Javier Bértoli
47f47e784d Bump minor version after issue #14 2013-12-26 16:22:04 -03:00
Javier Bértoli
af31e1fe07 Merge branch 'master' of github.com:netmanagers/puppet-fail2ban 2013-12-26 16:17:58 -03:00
Javier Bértoli
dab8e07069 Merge pull request #14 from grooverdan/ignore_ip
add ignoreip to jail options
2013-12-26 10:45:44 -08:00
Daniel Black
a4b5dae912 add ignoreip to jail options 2013-12-26 11:31:10 +00:00
Javier Bértoli
a7458e33ce Release v1.2.2 2013-12-23 18:23:37 -03:00
5 changed files with 17 additions and 2 deletions

View File

@@ -1,5 +1,5 @@
name 'netmanagers-fail2ban'
version '1.2.1'
version '1.3.1'
author 'Javier Bertoli'
license 'Apache2'
project_page 'http://www.netmanagers.com.ar'

View File

@@ -15,6 +15,7 @@
# Defaults to true
# $filter - The filter rule to use.
# If empty, defaults to == $jailname.
# $ignoreip - Don't ban a host which matches an address in this list.
# $port - The port to filter. It can be an array of ports.
# $logpath - The log file to monitor
# $maxretry - How many fails are acceptable
@@ -29,6 +30,7 @@ define fail2ban::jail (
$order = '',
$status = '',
$filter = '',
$ignoreip = '',
$port = '',
$action = '',
$logpath = '',
@@ -62,6 +64,14 @@ define fail2ban::jail (
default => $filter,
}
$array_ignoreip = is_array($ignoreip) ? {
false => $ignoreip ? {
'' => [],
default => [$ignoreip],
},
default => $ignoreip,
}
$array_port = is_array($port) ? {
false => $port ? {
'' => [],

View File

@@ -39,6 +39,7 @@ filter = fail2ban::jail
:port => ['42', '43'],
:logpath => '/path/to/somelog',
:enable => true,
:ignoreip => [ '10.3.2.0/24', '192.168.56.0/24' ],
:findtime => '9000',
:maxretry => '5',
:bantime => '3600',
@@ -53,6 +54,7 @@ filter = fail2ban::jail
[fail2ban::jail]
enabled = true
filter = fail2ban::jail
ignoreip = 10.3.2.0/24 192.168.56.0/24
port = 42,43
action = iptables[name=SSH, port=ssh, protocol=tcp]
mail-whois[name=SSH, dest=yourmail@mail.com]

View File

@@ -4,6 +4,9 @@ enabled = <%= @real_status %>
<% if @real_filter != '' -%>
filter = <%= @real_filter %>
<% end -%>
<% if @array_ignoreip != [] -%>
ignoreip = <%= @array_ignoreip * ' ' %>
<% end -%>
<% if @array_port != [] -%>
port = <%= @array_port * ',' %>
<% end -%>

View File

@@ -1,6 +1,6 @@
# This file is managed by Puppet. DO NOT EDIT.
[DEFAULT]
ignoreip = <%= scope.lookupvar('fail2ban::ignoreip') %>
ignoreip = <%= scope.lookupvar('fail2ban::ignoreip') * ' ' %>
bantime = <%= scope.lookupvar('fail2ban::bantime') %>
findtime = <%= scope.lookupvar('fail2ban::findtime') %>
maxretry = <%= scope.lookupvar('fail2ban::maxretry') %>