Recommit for updates in build 15

This commit is contained in:
Jenkins Server
2025-06-08 15:34:03 +02:00
parent 9b1ca10b82
commit 3ad5bab82a
3 changed files with 180 additions and 12 deletions

View File

@@ -113,7 +113,15 @@ clamav_cd.
15
16
17
18</pre>
18
19
20
21
22
23
24
25
26</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'manifests/main/config.pp', line 7</span>
@@ -129,6 +137,14 @@ class clamav_cd::main::config (
unless =&gt; &#39;/usr/sbin/getsebool antivirus_can_scan_system | grep --quiet &quot;on&quot;&#39;,
path =&gt; [&#39;/usr/sbin&#39;, &#39;/bin&#39;],
}
# create a cron job to run a daily scan
cron { &#39;clamscan&#39;:
command =&gt; $cv_shell_script,
user =&gt; $cv_cron_user,
hour =&gt; $cv_cron_hour,
minute =&gt; $cv_cron_minute,
}
}</pre>
</td>
</tr>

View File

@@ -145,7 +145,20 @@
47
48
49
50</pre>
50
51
52
53
54
55
56
57
58
59
60
61
62
63</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'manifests/main/files.pp', line 6</span>
@@ -194,6 +207,19 @@ class clamav_cd::main::files (
seluser =&gt; system_u,
content =&gt; template($cv_freshclam_svc_erb),
}
# shell script for scanning and alerting
file { $cv_shell_script :
ensure =&gt; file,
owner =&gt; &#39;root&#39;,
group =&gt; &#39;root&#39;,
mode =&gt; &#39;0750&#39;,
selrange =&gt; s0,
selrole =&gt; object_r,
seltype =&gt; etc_t,
seluser =&gt; system_u,
content =&gt; template($cv_shell_script_erb),
}
}</pre>
</td>
</tr>

View File

@@ -115,7 +115,7 @@ inherited by all classes except defines.
<span class='type'>(<tt>Array</tt>)</span>
<em class="default">(defaults to: <tt>[&#39;clamav&#39;,&#39;clamd&#39;]</tt>)</em>
<em class="default">(defaults to: <tt>[&#39;clamav&#39;,&#39;clamd&#39;,&#39;s-nail&#39;]</tt>)</em>
&mdash;
@@ -373,6 +373,114 @@ inherited by all classes except defines.
&mdash;
<div class='inline'>
<p>ip address to listen on</p>
</div>
</li>
<li>
<span class='name'>cv_alert_email</span>
<span class='type'>(<tt>String</tt>)</span>
<em class="default">(defaults to: <tt>&#39;you@example.com&#39;</tt>)</em>
&mdash;
<div class='inline'>
<p>email address to send alerts</p>
</div>
</li>
<li>
<span class='name'>cv_cron_hour</span>
<span class='type'>(<tt>String</tt>)</span>
<em class="default">(defaults to: <tt>&#39;2&#39;</tt>)</em>
&mdash;
<div class='inline'>
<p>which hour the scan should start</p>
</div>
</li>
<li>
<span class='name'>cv_cron_minute</span>
<span class='type'>(<tt>String</tt>)</span>
<em class="default">(defaults to: <tt>&#39;0&#39;</tt>)</em>
&mdash;
<div class='inline'>
<p>which minute the scan should start</p>
</div>
</li>
<li>
<span class='name'>cv_cron_user</span>
<span class='type'>(<tt>String</tt>)</span>
<em class="default">(defaults to: <tt>&#39;root&#39;</tt>)</em>
&mdash;
<div class='inline'>
<p>which user should run the cron job</p>
</div>
</li>
<li>
<span class='name'>cv_scan_dir</span>
<span class='type'>(<tt>String</tt>)</span>
<em class="default">(defaults to: <tt>&#39;/&#39;</tt>)</em>
&mdash;
<div class='inline'>
<p>which directory should be scanned</p>
</div>
</li>
<li>
<span class='name'>cv_alert_file</span>
<span class='type'>(<tt>String</tt>)</span>
<em class="default">(defaults to: <tt>&#39;tmp/clamav-alert.txt&#39;</tt>)</em>
&mdash;
<div class='inline'>
<p>location and name of the alert file</p>
</div>
</li>
@@ -388,12 +496,6 @@ inherited by all classes except defines.
<pre class="lines">
31
32
33
34
35
36
37
38
39
@@ -428,15 +530,30 @@ inherited by all classes except defines.
68
69
70
71</pre>
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'manifests/params.pp', line 31</span>
<pre class="code"><span class="info file"># File 'manifests/params.pp', line 37</span>
class clamav_cd::params (
# installation
Array $reqpackages = [&#39;clamav&#39;,&#39;clamd&#39;],
Array $reqpackages = [&#39;clamav&#39;,&#39;clamd&#39;,&#39;s-nail&#39;],
String $pkg_ensure = &#39;present&#39;,
# clamd
@@ -453,6 +570,13 @@ class clamav_cd::params (
String $cv_preludeanalyzername = &#39;ClamAV&#39;,
String $cv_tcpsocket = &#39;3310&#39;,
String $cv_tcpaddress = &#39;localhost&#39;,
String $cv_alert_email = &#39;you@example.com&#39;,
String $cv_cron_hour = &#39;2&#39;,
String $cv_cron_minute = &#39;0&#39;,
String $cv_cron_user = &#39;root&#39;,
String $cv_scan_dir = &#39;/&#39;,
String $cv_alert_file = &#39;tmp/clamav-alert.txt&#39;,
) {
# service
@@ -469,6 +593,8 @@ class clamav_cd::params (
$cv_freshclam_erb = &#39;clamav_cd/freshclam_conf.erb&#39;
$cv_freshclam_svc = &#39;/usr/lib/systemd/system/freshclam.service&#39;
$cv_freshclam_svc_erb = &#39;clamav_cd/freshclam_svc.erb&#39;
$cv_shell_script = &quot;${cv_config_d_dir}/scan.sh&quot;
$cv_shell_script_erb = &#39;clamav_cd/scan.sh.erb&#39;
# includes must be last