Recommit for updates in build 222
This commit is contained in:
@@ -111,7 +111,11 @@
|
||||
13
|
||||
14
|
||||
15
|
||||
16</pre>
|
||||
16
|
||||
17
|
||||
18
|
||||
19
|
||||
20</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'manifests/main/config.pp', line 6</span>
|
||||
@@ -126,6 +130,10 @@ class confdroid_nagios::main::config (
|
||||
if $ng_enable_target == true {
|
||||
include confdroid_nagios::client::target
|
||||
}
|
||||
|
||||
if $ng_enable_fail2ban == true {
|
||||
include confdroid_nagios::monitoring::fail2ban
|
||||
}
|
||||
}</pre>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -105,7 +105,38 @@
|
||||
7
|
||||
8
|
||||
9
|
||||
10</pre>
|
||||
10
|
||||
11
|
||||
12
|
||||
13
|
||||
14
|
||||
15
|
||||
16
|
||||
17
|
||||
18
|
||||
19
|
||||
20
|
||||
21
|
||||
22
|
||||
23
|
||||
24
|
||||
25
|
||||
26
|
||||
27
|
||||
28
|
||||
29
|
||||
30
|
||||
31
|
||||
32
|
||||
33
|
||||
34
|
||||
35
|
||||
36
|
||||
37
|
||||
38
|
||||
39
|
||||
40
|
||||
41</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'manifests/monitoring/fail2ban.pp', line 6</span>
|
||||
@@ -114,6 +145,37 @@ class confdroid_nagios::monitoring::fail2ban (
|
||||
|
||||
) inherits confdroid_nagios::params {
|
||||
# we want to create a nagios jail here
|
||||
if ($ng_nagios_host == $fqdn) and ($ng_enable_fail2ban == true) {
|
||||
require confdroid_fail2ban
|
||||
|
||||
# create the jail file
|
||||
file { $fn_jail_file:
|
||||
ensure => file,
|
||||
user => 'root',
|
||||
group => 'root',
|
||||
mode => '0644',
|
||||
selrange => s0,
|
||||
selrole => object_r,
|
||||
seltype => etc_t,
|
||||
seluser => system_u,
|
||||
content => template('confdroid_nagios/fail2ban/jail.conf.erb'),
|
||||
notify => Service['fail2ban'],
|
||||
}
|
||||
|
||||
# create the filter rule
|
||||
file { $fn_filter_file:
|
||||
ensure => file,
|
||||
user => 'root',
|
||||
group => 'root',
|
||||
mode => '0644',
|
||||
selrange => s0,
|
||||
selrole => object_r,
|
||||
seltype => etc_t,
|
||||
seluser => system_u,
|
||||
content => template('confdroid_nagios/fail2ban/filter.conf.erb'),
|
||||
notify => Service['fail2ban'],
|
||||
}
|
||||
}
|
||||
}</pre>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -3947,19 +3947,6 @@ inherited by all classes except defines.
|
||||
<p>The alias of the default service group. Default is ‘Linux Services’.</p>
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
|
||||
<span class='name'>ng_use_ssl_auth</span>
|
||||
|
||||
|
||||
<span class='type'>(<tt>String</tt>)</span>
|
||||
|
||||
|
||||
<em class="default">(defaults to: <tt>'0'</tt>)</em>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
@@ -3973,6 +3960,132 @@ inherited by all classes except defines.
|
||||
<em class="default">(defaults to: <tt>false</tt>)</em>
|
||||
|
||||
|
||||
—
|
||||
<div class='inline'>
|
||||
<p>Whether to enable fail2ban monitoring in Nagios. Default is false.</p>
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
|
||||
<span class='name'>ng_jail_order</span>
|
||||
|
||||
|
||||
<span class='type'>(<tt>String</tt>)</span>
|
||||
|
||||
|
||||
<em class="default">(defaults to: <tt>'10'</tt>)</em>
|
||||
|
||||
|
||||
—
|
||||
<div class='inline'>
|
||||
<p>The order number of jails in the jail.d directory. Default is ‘10’.</p>
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
|
||||
<span class='name'>ng_jail_enable</span>
|
||||
|
||||
|
||||
<span class='type'>(<tt>Boolean</tt>)</span>
|
||||
|
||||
|
||||
<em class="default">(defaults to: <tt>true</tt>)</em>
|
||||
|
||||
|
||||
—
|
||||
<div class='inline'>
|
||||
<p>Whether to enable the monitoring of a specific jail in Nagios. Default is ‘true’.</p>
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
|
||||
<span class='name'>ng_fail2ban_logpath</span>
|
||||
|
||||
|
||||
<span class='type'>(<tt>String</tt>)</span>
|
||||
|
||||
|
||||
<em class="default">(defaults to: <tt>'/var/log/httpd/access.log'</tt>)</em>
|
||||
|
||||
|
||||
—
|
||||
<div class='inline'>
|
||||
<p>The path to the nagios access log to monitor. Default is ‘/var/log/httpd/access.log’.</p>
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
|
||||
<span class='name'>ng_fail2ban_maxretry</span>
|
||||
|
||||
|
||||
<span class='type'>(<tt>String</tt>)</span>
|
||||
|
||||
|
||||
<em class="default">(defaults to: <tt>'5'</tt>)</em>
|
||||
|
||||
|
||||
—
|
||||
<div class='inline'>
|
||||
<p>The maximum number of retries before a host is considered banned in fail2ban. Default is ‘5’.</p>
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
|
||||
<span class='name'>ng_fail2ban_bantime</span>
|
||||
|
||||
|
||||
<span class='type'>(<tt>String</tt>)</span>
|
||||
|
||||
|
||||
<em class="default">(defaults to: <tt>'3600'</tt>)</em>
|
||||
|
||||
|
||||
—
|
||||
<div class='inline'>
|
||||
<p>The time in seconds that a host is banned in fail2ban. Default is ‘3600’.</p>
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
|
||||
<span class='name'>ng_fail2ban_ignoreip</span>
|
||||
|
||||
|
||||
<span class='type'>(<tt>String</tt>)</span>
|
||||
|
||||
|
||||
<em class="default">(defaults to: <tt>'127.0.0.1/8 ::1 192.168.1.0/24'</tt>)</em>
|
||||
|
||||
|
||||
—
|
||||
<div class='inline'>
|
||||
<p>A comma-separated list of IP addresses to ignore in fail2ban. Default is ‘127.0.0.1/8 ::1 192.168.1.0/24’.</p>
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
|
||||
<span class='name'>ng_use_ssl_auth</span>
|
||||
|
||||
|
||||
<span class='type'>(<tt>String</tt>)</span>
|
||||
|
||||
|
||||
<em class="default">(defaults to: <tt>'0'</tt>)</em>
|
||||
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
@@ -3986,20 +4099,6 @@ inherited by all classes except defines.
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
431
|
||||
432
|
||||
433
|
||||
434
|
||||
435
|
||||
436
|
||||
437
|
||||
438
|
||||
439
|
||||
440
|
||||
441
|
||||
442
|
||||
443
|
||||
444
|
||||
445
|
||||
446
|
||||
447
|
||||
@@ -4321,10 +4420,33 @@ inherited by all classes except defines.
|
||||
763
|
||||
764
|
||||
765
|
||||
766</pre>
|
||||
766
|
||||
767
|
||||
768
|
||||
769
|
||||
770
|
||||
771
|
||||
772
|
||||
773
|
||||
774
|
||||
775
|
||||
776
|
||||
777
|
||||
778
|
||||
779
|
||||
780
|
||||
781
|
||||
782
|
||||
783
|
||||
784
|
||||
785
|
||||
786
|
||||
787
|
||||
788
|
||||
789</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'manifests/params.pp', line 431</span>
|
||||
<pre class="code"><span class="info file"># File 'manifests/params.pp', line 445</span>
|
||||
|
||||
class confdroid_nagios::params (
|
||||
|
||||
@@ -4569,13 +4691,16 @@ class confdroid_nagios::params (
|
||||
Boolean $ng_enable_swap_check = true,
|
||||
|
||||
# fail2ban
|
||||
Boolean $ng_enable_fail2ban = false,
|
||||
Boolean $ng_enable_fail2ban = false,
|
||||
String $ng_jail_order = '10',
|
||||
Boolean $ng_jail_enable = true,
|
||||
#String $ng_fail2ban_jail = 'httpd',
|
||||
#String $ng_fail2ban_log = '/var/log/secure',
|
||||
String $ng_fail2ban_logpath = '/var/log/httpd/access.log',
|
||||
#String $ng_fail2ban_regex = 'sshd.*Failed password for',
|
||||
#String $ng_fail2ban_maxretry = '5',
|
||||
String $ng_fail2ban_maxretry = '5',
|
||||
#String $ng_fail2ban_findtime = '600',
|
||||
#String $ng_fail2ban_bantime = '3600',
|
||||
String $ng_fail2ban_bantime = '3600',
|
||||
String $ng_fail2ban_ignoreip = '127.0.0.1/8 ::1 192.168.1.0/24'
|
||||
|
||||
) {
|
||||
# Default facts
|
||||
@@ -4659,6 +4784,12 @@ class confdroid_nagios::params (
|
||||
$ng_svc_perfdata_file = "${ng_log_dir}/service-perfdata"
|
||||
$ng_debug_file = "${ng_log_dir}/nagios.debug"
|
||||
|
||||
# fail2ban
|
||||
$fn_jail_path = '/etc/fail2ban/jail.d'
|
||||
$fn_jail_file = "${fn_jail_path}/${ng_jail_order}-nagios.conf"
|
||||
$fn_filter_path = '/etc/fail2ban/filter.d'
|
||||
$fn_filter_file = "${fn_filter_path}/${ng_jail_order}-nagios.conf"
|
||||
|
||||
# includes must be last
|
||||
include confdroid_nagios::main::config
|
||||
}</pre>
|
||||
|
||||
Reference in New Issue
Block a user