Compare commits
1 Commits
master
...
089ce65839
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
089ce65839 |
@@ -33,8 +33,7 @@
|
||||
- manage required config files
|
||||
- manage cronjob settings via parameters
|
||||
- run cron job to scan the file system (by default starting at root, configurable) via clamdscan
|
||||
- set ConcurrentDatabaseReload option `yes`/`no` to optimize RAM consumption. defaults to `no`
|
||||
- manage `freshclam` and `clamd` services
|
||||
- manage services
|
||||
|
||||
## Dependencies
|
||||
|
||||
|
||||
@@ -98,11 +98,6 @@
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<span class='object_link'><a href="puppet_classes/confdroid_clamav_3A_3Aparams.html" title="puppet_classes::confdroid_clamav::params (puppet_class)">confdroid_clamav::params</a></span>
|
||||
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
|
||||
@@ -107,9 +107,7 @@
|
||||
</li><li>
|
||||
<p>run cron job to scan the file system (by default starting at root, configurable) via clamdscan</p>
|
||||
</li><li>
|
||||
<p>set ConcurrentDatabaseReload option <code>yes</code>/<code>no</code> to optimize RAM consumption. defaults to <code>no</code></p>
|
||||
</li><li>
|
||||
<p>manage <code>freshclam</code> and <code>clamd</code> services</p>
|
||||
<p>manage services</p>
|
||||
</li></ul>
|
||||
|
||||
<h2 id="label-Dependencies">Dependencies</h2>
|
||||
|
||||
@@ -107,9 +107,7 @@
|
||||
</li><li>
|
||||
<p>run cron job to scan the file system (by default starting at root, configurable) via clamdscan</p>
|
||||
</li><li>
|
||||
<p>set ConcurrentDatabaseReload option <code>yes</code>/<code>no</code> to optimize RAM consumption. defaults to <code>no</code></p>
|
||||
</li><li>
|
||||
<p>manage <code>freshclam</code> and <code>clamd</code> services</p>
|
||||
<p>manage services</p>
|
||||
</li></ul>
|
||||
|
||||
<h2 id="label-Dependencies">Dependencies</h2>
|
||||
|
||||
@@ -78,13 +78,6 @@
|
||||
</li>
|
||||
|
||||
|
||||
<li id="object_puppet_classes::confdroid_clamav::params" class="odd">
|
||||
<div class="item">
|
||||
<span class='object_link'><a href="puppet_classes/confdroid_clamav_3A_3Aparams.html" title="puppet_classes::confdroid_clamav::params (puppet_class)">confdroid_clamav::params</a></span>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
@@ -64,7 +64,7 @@
|
||||
|
||||
<dl>
|
||||
<dt>Inherits:</dt>
|
||||
<dd><span class='object_link'><a href="confdroid_clamav_3A_3Aparams.html" title="puppet_classes::confdroid_clamav::params (puppet_class)">confdroid_clamav::params</a></span></dd>
|
||||
<dd>confdroid_clamav::params</dd>
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@
|
||||
|
||||
<dl>
|
||||
<dt>Inherits:</dt>
|
||||
<dd><span class='object_link'><a href="confdroid_clamav_3A_3Aparams.html" title="puppet_classes::confdroid_clamav::params (puppet_class)">confdroid_clamav::params</a></span></dd>
|
||||
<dd>confdroid_clamav::params</dd>
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@
|
||||
|
||||
<dl>
|
||||
<dt>Inherits:</dt>
|
||||
<dd><span class='object_link'><a href="confdroid_clamav_3A_3Aparams.html" title="puppet_classes::confdroid_clamav::params (puppet_class)">confdroid_clamav::params</a></span></dd>
|
||||
<dd>confdroid_clamav::params</dd>
|
||||
</dl>
|
||||
|
||||
|
||||
@@ -158,23 +158,7 @@
|
||||
60
|
||||
61
|
||||
62
|
||||
63
|
||||
64
|
||||
65
|
||||
66
|
||||
67
|
||||
68
|
||||
69
|
||||
70
|
||||
71
|
||||
72
|
||||
73
|
||||
74
|
||||
75
|
||||
76
|
||||
77
|
||||
78
|
||||
79</pre>
|
||||
63</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'manifests/main/files.pp', line 6</span>
|
||||
@@ -209,7 +193,6 @@ class confdroid_clamav::main::files (
|
||||
seltype => etc_t,
|
||||
seluser => system_u,
|
||||
content => template($cv_freshclam_erb),
|
||||
notify => Service[$cv_freshclam],
|
||||
}
|
||||
|
||||
# freshclam service config file
|
||||
@@ -223,21 +206,6 @@ class confdroid_clamav::main::files (
|
||||
seltype => etc_t,
|
||||
seluser => system_u,
|
||||
content => template($cv_freshclam_svc_erb),
|
||||
notify => Service[$cv_freshclam],
|
||||
}
|
||||
|
||||
# clamd service config file
|
||||
file { $cv_clamd_svc :
|
||||
ensure => file,
|
||||
owner => 'root',
|
||||
group => 'root',
|
||||
mode => '0600',
|
||||
selrange => s0,
|
||||
selrole => object_r,
|
||||
seltype => etc_t,
|
||||
seluser => system_u,
|
||||
content => template($cv_clamd_svc_erb),
|
||||
notify => Service[$cv_service],
|
||||
}
|
||||
|
||||
# shell script for scanning and alerting
|
||||
|
||||
@@ -64,7 +64,7 @@
|
||||
|
||||
<dl>
|
||||
<dt>Inherits:</dt>
|
||||
<dd><span class='object_link'><a href="confdroid_clamav_3A_3Aparams.html" title="puppet_classes::confdroid_clamav::params (puppet_class)">confdroid_clamav::params</a></span></dd>
|
||||
<dd>confdroid_clamav::params</dd>
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@
|
||||
|
||||
<dl>
|
||||
<dt>Inherits:</dt>
|
||||
<dd><span class='object_link'><a href="confdroid_clamav_3A_3Aparams.html" title="puppet_classes::confdroid_clamav::params (puppet_class)">confdroid_clamav::params</a></span></dd>
|
||||
<dd>confdroid_clamav::params</dd>
|
||||
</dl>
|
||||
|
||||
|
||||
|
||||
@@ -535,96 +535,6 @@ inherited by all classes except defines.
|
||||
—
|
||||
<div class='inline'>
|
||||
<p>whether to use advanced exclude paths</p>
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
|
||||
<span class='name'>cv_concurrentdatabasereload</span>
|
||||
|
||||
|
||||
<span class='type'>(<tt>String</tt>)</span>
|
||||
|
||||
|
||||
<em class="default">(defaults to: <tt>'no'</tt>)</em>
|
||||
|
||||
|
||||
—
|
||||
<div class='inline'>
|
||||
<p>whether to enable concurrent database reloads. This is useful when you have multiple clamd instances running on the same machine. If you have only one clamd instance, this should be set to ‘no’.</p>
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
|
||||
<span class='name'>cv_clamd_max_mem</span>
|
||||
|
||||
|
||||
<span class='type'>(<tt>String</tt>)</span>
|
||||
|
||||
|
||||
<em class="default">(defaults to: <tt>'512M'</tt>)</em>
|
||||
|
||||
|
||||
—
|
||||
<div class='inline'>
|
||||
<p>maximum memory usage for clamd.</p>
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
|
||||
<span class='name'>cv_clamd_cpu_quota</span>
|
||||
|
||||
|
||||
<span class='type'>(<tt>String</tt>)</span>
|
||||
|
||||
|
||||
<em class="default">(defaults to: <tt>'30%'</tt>)</em>
|
||||
|
||||
|
||||
—
|
||||
<div class='inline'>
|
||||
<p>maximum CPU usage for clamd.</p>
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
|
||||
<span class='name'>cv_nice_value</span>
|
||||
|
||||
|
||||
<span class='type'>(<tt>String</tt>)</span>
|
||||
|
||||
|
||||
<em class="default">(defaults to: <tt>'19'</tt>)</em>
|
||||
|
||||
|
||||
—
|
||||
<div class='inline'>
|
||||
<p>nice value for clamd. This is a number between -20 and 19. The lower the number, the higher the priority. The default is 19, which is the lowest priority.</p>
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
<li>
|
||||
|
||||
<span class='name'>cv_timeout_start_sec</span>
|
||||
|
||||
|
||||
<span class='type'>(<tt>String</tt>)</span>
|
||||
|
||||
|
||||
<em class="default">(defaults to: <tt>'420'</tt>)</em>
|
||||
|
||||
|
||||
—
|
||||
<div class='inline'>
|
||||
<p>timeout for starting the clamd service.</p>
|
||||
</div>
|
||||
|
||||
</li>
|
||||
@@ -640,6 +550,16 @@ inherited by all classes except defines.
|
||||
<pre class="lines">
|
||||
|
||||
|
||||
40
|
||||
41
|
||||
42
|
||||
43
|
||||
44
|
||||
45
|
||||
46
|
||||
47
|
||||
48
|
||||
49
|
||||
50
|
||||
51
|
||||
52
|
||||
@@ -681,27 +601,10 @@ inherited by all classes except defines.
|
||||
88
|
||||
89
|
||||
90
|
||||
91
|
||||
92
|
||||
93
|
||||
94
|
||||
95
|
||||
96
|
||||
97
|
||||
98
|
||||
99
|
||||
100
|
||||
101
|
||||
102
|
||||
103
|
||||
104
|
||||
105
|
||||
106
|
||||
107
|
||||
108</pre>
|
||||
91</pre>
|
||||
</td>
|
||||
<td>
|
||||
<pre class="code"><span class="info file"># File 'manifests/params.pp', line 50</span>
|
||||
<pre class="code"><span class="info file"># File 'manifests/params.pp', line 40</span>
|
||||
|
||||
class confdroid_clamav::params (
|
||||
|
||||
@@ -731,12 +634,7 @@ class confdroid_clamav::params (
|
||||
String $cv_alert_file = 'tmp/clamav-alert.txt',
|
||||
Boolean $cv_enable_freshclam = true,
|
||||
Boolean $cv_enable_clamd = true,
|
||||
Boolean $cv_use_excludepaths = true,
|
||||
String $cv_concurrentdatabasereload = 'no',
|
||||
String $cv_clamd_max_mem = '512M',
|
||||
String $cv_clamd_cpu_quota = '30%',
|
||||
String $cv_nice_value = '19',
|
||||
String $cv_timeout_start_sec = '420'
|
||||
Boolean $cv_use_excludepaths = true
|
||||
|
||||
) {
|
||||
# service
|
||||
@@ -753,8 +651,6 @@ class confdroid_clamav::params (
|
||||
$cv_freshclam_erb = 'confdroid_clamav/freshclam_conf.erb'
|
||||
$cv_freshclam_svc = '/usr/lib/systemd/system/freshclam.service'
|
||||
$cv_freshclam_svc_erb = 'confdroid_clamav/freshclam_svc.erb'
|
||||
$cv_clamd_svc = '/usr/lib/systemd/system/clamd@.service'
|
||||
$cv_clamd_svc_erb = 'confdroid_clamav/clamd_svc.erb'
|
||||
$cv_shell_script = "${cv_config_d_dir}/scan.sh"
|
||||
$cv_shell_script_erb = 'confdroid_clamav/scan.sh.erb'
|
||||
|
||||
|
||||
@@ -33,7 +33,6 @@ class confdroid_clamav::main::files (
|
||||
seltype => etc_t,
|
||||
seluser => system_u,
|
||||
content => template($cv_freshclam_erb),
|
||||
notify => Service[$cv_freshclam],
|
||||
}
|
||||
|
||||
# freshclam service config file
|
||||
@@ -47,21 +46,6 @@ class confdroid_clamav::main::files (
|
||||
seltype => etc_t,
|
||||
seluser => system_u,
|
||||
content => template($cv_freshclam_svc_erb),
|
||||
notify => Service[$cv_freshclam],
|
||||
}
|
||||
|
||||
# clamd service config file
|
||||
file { $cv_clamd_svc :
|
||||
ensure => file,
|
||||
owner => 'root',
|
||||
group => 'root',
|
||||
mode => '0600',
|
||||
selrange => s0,
|
||||
selrole => object_r,
|
||||
seltype => etc_t,
|
||||
seluser => system_u,
|
||||
content => template($cv_clamd_svc_erb),
|
||||
notify => Service[$cv_service],
|
||||
}
|
||||
|
||||
# shell script for scanning and alerting
|
||||
|
||||
@@ -36,16 +36,6 @@
|
||||
# @param [Boolean] cv_enable_freshclam whether to enable the freshclam service
|
||||
# @param [Boolean] cv_enable_clamd whether to enable the clamd service
|
||||
# @param [Boolean] cv_use_excludepaths whether to use advanced exclude paths
|
||||
# @param [String] cv_concurrentdatabasereload whether to enable concurrent
|
||||
# database reloads. This is useful when you have multiple clamd instances
|
||||
# running on the same machine. If you have only one clamd instance, this
|
||||
# should be set to 'no'.
|
||||
# @param [String] cv_clamd_max_mem maximum memory usage for clamd.
|
||||
# @param [String] cv_clamd_cpu_quota maximum CPU usage for clamd.
|
||||
# @param [String] cv_nice_value nice value for clamd. This is a number between
|
||||
# -20 and 19. The lower the number, the higher the priority. The default is
|
||||
# 19, which is the lowest priority.
|
||||
# @param [String] cv_timeout_start_sec timeout for starting the clamd service.
|
||||
##############################################################################
|
||||
class confdroid_clamav::params (
|
||||
|
||||
@@ -75,12 +65,8 @@ class confdroid_clamav::params (
|
||||
String $cv_alert_file = 'tmp/clamav-alert.txt',
|
||||
Boolean $cv_enable_freshclam = true,
|
||||
Boolean $cv_enable_clamd = true,
|
||||
Boolean $cv_use_excludepaths = true,
|
||||
String $cv_concurrentdatabasereload = 'no',
|
||||
String $cv_clamd_max_mem = '512M',
|
||||
String $cv_clamd_cpu_quota = '30%',
|
||||
String $cv_nice_value = '19',
|
||||
String $cv_timeout_start_sec = '420'
|
||||
Boolean $cv_use_excludepaths = true
|
||||
String $cv_concurrentdatabasereload = 'no'
|
||||
|
||||
) {
|
||||
# service
|
||||
@@ -97,8 +83,6 @@ class confdroid_clamav::params (
|
||||
$cv_freshclam_erb = 'confdroid_clamav/freshclam_conf.erb'
|
||||
$cv_freshclam_svc = '/usr/lib/systemd/system/freshclam.service'
|
||||
$cv_freshclam_svc_erb = 'confdroid_clamav/freshclam_svc.erb'
|
||||
$cv_clamd_svc = '/usr/lib/systemd/system/clamd@.service'
|
||||
$cv_clamd_svc_erb = 'confdroid_clamav/clamd_svc.erb'
|
||||
$cv_shell_script = "${cv_config_d_dir}/scan.sh"
|
||||
$cv_shell_script_erb = 'confdroid_clamav/scan.sh.erb'
|
||||
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
################################################################################
|
||||
### clamd.svc created by Puppet, manual changes will be overwritten!!! ###
|
||||
################################################################################
|
||||
|
||||
[Unit]
|
||||
Description = clamd scanner (%i) daemon
|
||||
Documentation=man:clamd(8) man:clamd.conf(5) https://www.clamav.net/documents/
|
||||
After = syslog.target nss-lookup.target network.target
|
||||
|
||||
[Service]
|
||||
Type = forking
|
||||
ExecStart = /usr/sbin/clamd -c /etc/clamd.d/%i.conf
|
||||
# Reload the database
|
||||
ExecReload=/bin/kill -USR2 $MAINPID
|
||||
Restart = on-failure
|
||||
TimeoutStartSec=<%= @cv_timeout_start_sec %>
|
||||
MemoryMax=<%= @cv_clamd_max_mem %>
|
||||
CPUQuota=<%= @cv_clamd_cpu_quota %>
|
||||
Nice=<%= @cv_nice_value %>
|
||||
|
||||
[Install]
|
||||
WantedBy = multi-user.target
|
||||
Reference in New Issue
Block a user