Compare commits

...

5 Commits

Author SHA1 Message Date
Jenkins Server
ce83e4bbab Recommit for updates in build 4 2026-09-22 12:46:10 +02:00
Jenkins Server
deb6f938ae Merge remote-tracking branch 'origin/master' into jenkins-build-4 2026-09-22 12:45:26 +02:00
7f20c0e45e OP#785 add excludepaths and option to use it 2026-09-22 12:45:06 +02:00
2d3304abac OP#785 fix heading 2026-09-22 12:18:50 +02:00
Jenkins Server
048c910a4b Recommit for updates in build 3 2026-09-22 12:14:50 +02:00
10 changed files with 68 additions and 213 deletions

55
.vscode/settings.json vendored
View File

@@ -1,55 +0,0 @@
{
"cSpell.words": [
"ALLMATCHSCAN",
"authenticode",
"behaviour",
"bofh",
"clamav",
"clamd",
"clamdscan",
"clamonacc",
"clamscan",
"Clamuko",
"clamupdate",
"Dazuko",
"dbname",
"epel",
"fanotify",
"filesize",
"freshclam",
"getsebool",
"INADDR",
"libclamav",
"logclean",
"logfacility",
"logfile",
"logfilemaxsize",
"logfileunlock",
"logrotation",
"logsyslog",
"logtime",
"logverbose",
"mypass",
"myproxy",
"myusername",
"NOFILE",
"normalisation",
"PCRE",
"preludeanalyzername",
"preludeenable",
"recieve",
"RLIMIT",
"safebrowsing",
"setsebool",
"subsig",
"subsigs",
"tcpaddre",
"tcpaddress",
"tcpsocket",
"VIRUSEVENT",
"virusgroup",
"VIRUSNAME",
"XMLDOCS",
"xxxyyzzzz"
]
}

128
Jenkinsfile vendored
View File

@@ -1,128 +0,0 @@
pipeline {
agent {
label 'puppet'
}
post {
always {
deleteDir() /* clean up our workspace */
}
success {
updateGitlabCommitStatus state: 'success'
}
failure {
updateGitlabCommitStatus state: 'failed'
step([$class: 'Mailer', notifyEveryUnstableBuild: true, recipients: 'support@confdroid.com', sendToIndividuals: true])
}
}
options {
gitLabConnection('gitlab.confdroid.com')
}
stages {
stage('pull master') {
steps {
sshagent(['edd05eb6-26b5-4c7b-a5cc-ea2ab899f4fa']) {
sh '''
git config user.name "Jenkins Server"
git config user.email jenkins@confdroid.com
# Ensure we're on the development branch (triggered by push)
git checkout development
# Create jenkins branch from development
git checkout -b jenkins-build-$BUILD_NUMBER
# Optionally merge master into jenkins to ensure compatibility
git merge origin/master --no-ff || { echo "Merge conflict detected"; exit 1; }
'''
}
}
}
stage('puppet parser') {
steps {
sh '''for file in $(find . -iname \'*.pp\'); do
/opt/puppetlabs/bin/puppet parser validate --color false --render-as s --modulepath=modules $file || exit 1;
done;'''
}
}
stage('check templates') {
steps{
sh '''for file in $(find . -iname \'*.erb\');
do erb -P -x -T "-" $file | ruby -c || exit 1;
done;'''
}
}
stage('puppet-lint') {
steps {
sh '''/usr/local/bin/puppet-lint . \\
--no-variable_scope-check \\
|| { echo "Puppet lint failed"; exit 1; }
'''
}
}
stage('SonarScan') {
steps {
withCredentials([string(credentialsId: 'sonar-token', variable: 'SONAR_TOKEN')]) {
sh '''
/opt/sonar-scanner/bin/sonar-scanner \
-Dsonar.projectKey=confdroid_clamav \
-Dsonar.sources=. \
-Dsonar.host.url=https://sonarqube.confdroid.com \
-Dsonar.token=$SONAR_TOKEN
'''
}
}
}
stage('create Puppet documentation') {
steps {
sh '/opt/puppetlabs/bin/puppet strings'
}
}
stage('update repo') {
steps {
sshagent(['edd05eb6-26b5-4c7b-a5cc-ea2ab899f4fa']) {
sh '''
git config user.name "Jenkins Server"
git config user.email jenkins@confdroid.com
git rm -r --cached .vscode || echo "No .vscode to remove from git"
git add -A && git commit -am "Recommit for updates in build $BUILD_NUMBER" || echo "No changes to commit"
git push origin HEAD:master
'''
}
}
}
stage('Mirror to Gitea') {
steps {
sshagent(['edd05eb6-26b5-4c7b-a5cc-ea2ab899f4fa']) {
withCredentials([usernamePassword(
credentialsId: 'Jenkins-gitea',
usernameVariable: 'GITEA_USER',
passwordVariable: 'GITEA_TOKEN')]) {
script {
// Checkout from GitLab (already done implicitly)
sh '''
git checkout master
git pull origin master
git branch -D development
git branch -D jenkins-build-$BUILD_NUMBER
git rm -f Jenkinsfile
git rm -r --cached .vscode || echo "No .vscode to remove from git"
git commit --amend --no-edit --allow-empty
git remote add master https://sourcecode.confdroid.com/confdroid/confdroid_clamav.git
git -c credential.helper="!f() { echo username=${GITEA_USER}; echo password=${GITEA_TOKEN}; }; f" \
push master --mirror
'''
}
}
}
}
}
}
}

View File

@@ -9,7 +9,7 @@
- [WARNING](#warning)
- [Features](#features)
- [Dependencies](#dependencies)
- [Deployment](#deployment)
- [Deployment](#deployment)
- [Parameters](#parameters)
- [SELINUX](#selinux)
- [Support](#support)
@@ -41,7 +41,7 @@ All dependencies must be included in the catalogue.
- [confdroid_resources](https://sourcecode.confdroid.com/confdroid/confdroid_resources) for managing yum repo resources.
### Deployment
## Deployment
- native Puppet deployment

View File

@@ -60,9 +60,7 @@
<div id="content"><div id='filecontents'>
<h1 id="label-Readme">Readme</h1>
<p><a href="https://jenkins.confdroid.com/job/confdroid_clamav/"><img src="https://jenkins.confdroid.com/buildStatus/icon?job=confdroid_clamav&amp;style=plastic"></a></p>
<p><a href="https://deepwiki.com/grizzlycoda/puppet_collection"><img src="https://deepwiki.com/badge.svg"></a></p>
<p><a href="https://jenkins.confdroid.com/job/confdroid_clamav/"><img src="https://jenkins.confdroid.com/buildStatus/icon?job=confdroid_clamav&amp;style=plastic"></a> <a href="https://sonarqube.confdroid.com/dashboard?id=confdroid_clamav"><img src="https://sonarqube.confdroid.com/api/project_badges/measure?project=confdroid_clamav&amp;metric=security_hotspots&amp;token=sqb_cdcd204545668e8367aed118aa87ad814b58863b"></a> <a href="https://deepwiki.com/grizzlycoda/puppet_collection"><img src="https://deepwiki.com/badge.svg"></a></p>
<ul><li>
<p><a href="#readme">Readme</a></p>
</li><li>
@@ -73,9 +71,8 @@
<p><a href="#features">Features</a></p>
</li><li>
<p><a href="#dependencies">Dependencies</a></p>
<ul><li>
</li><li>
<p><a href="#deployment">Deployment</a></p>
</li></ul>
</li><li>
<p><a href="#parameters">Parameters</a></p>
</li><li>
@@ -120,7 +117,7 @@
<p><a href="https://sourcecode.confdroid.com/confdroid/confdroid_resources">confdroid_resources</a> for managing yum repo resources.</p>
</li></ul>
<h3 id="label-Deployment">Deployment</h3>
<h2 id="label-Deployment">Deployment</h2>
<ul><li>
<p>native Puppet deployment</p>
</li></ul>

View File

@@ -60,9 +60,7 @@
<div id="content"><div id='filecontents'>
<h1 id="label-Readme">Readme</h1>
<p><a href="https://jenkins.confdroid.com/job/confdroid_clamav/"><img src="https://jenkins.confdroid.com/buildStatus/icon?job=confdroid_clamav&amp;style=plastic"></a></p>
<p><a href="https://deepwiki.com/grizzlycoda/puppet_collection"><img src="https://deepwiki.com/badge.svg"></a></p>
<p><a href="https://jenkins.confdroid.com/job/confdroid_clamav/"><img src="https://jenkins.confdroid.com/buildStatus/icon?job=confdroid_clamav&amp;style=plastic"></a> <a href="https://sonarqube.confdroid.com/dashboard?id=confdroid_clamav"><img src="https://sonarqube.confdroid.com/api/project_badges/measure?project=confdroid_clamav&amp;metric=security_hotspots&amp;token=sqb_cdcd204545668e8367aed118aa87ad814b58863b"></a> <a href="https://deepwiki.com/grizzlycoda/puppet_collection"><img src="https://deepwiki.com/badge.svg"></a></p>
<ul><li>
<p><a href="#readme">Readme</a></p>
</li><li>
@@ -73,9 +71,8 @@
<p><a href="#features">Features</a></p>
</li><li>
<p><a href="#dependencies">Dependencies</a></p>
<ul><li>
</li><li>
<p><a href="#deployment">Deployment</a></p>
</li></ul>
</li><li>
<p><a href="#parameters">Parameters</a></p>
</li><li>
@@ -120,7 +117,7 @@
<p><a href="https://sourcecode.confdroid.com/confdroid/confdroid_resources">confdroid_resources</a> for managing yum repo resources.</p>
</li></ul>
<h3 id="label-Deployment">Deployment</h3>
<h2 id="label-Deployment">Deployment</h2>
<ul><li>
<p>native Puppet deployment</p>
</li></ul>

View File

@@ -120,8 +120,8 @@ class confdroid_clamav::main::install (
) inherits confdroid_clamav::params {
require confdroid_resources::main::epel
package { $reqpackages:
ensure =&gt; $pkg_ensure,
package { $cv_reqpackages:
ensure =&gt; $cv_pkg_ensure,
}
}</pre>
</td>

View File

@@ -109,7 +109,7 @@ inherited by all classes except defines.
<li>
<span class='name'>reqpackages</span>
<span class='name'>cv_reqpackages</span>
<span class='type'>(<tt>Array</tt>)</span>
@@ -127,7 +127,7 @@ inherited by all classes except defines.
<li>
<span class='name'>pkg_ensure</span>
<span class='name'>cv_pkg_ensure</span>
<span class='type'>(<tt>String</tt>)</span>
@@ -517,6 +517,24 @@ inherited by all classes except defines.
&mdash;
<div class='inline'>
<p>whether to enable the clamd service</p>
</div>
</li>
<li>
<span class='name'>cv_use_excludepaths</span>
<span class='type'>(<tt>Boolean</tt>)</span>
<em class="default">(defaults to: <tt>true</tt>)</em>
&mdash;
<div class='inline'>
<p>whether to use advanced exclude paths</p>
</div>
</li>
@@ -532,7 +550,6 @@ inherited by all classes except defines.
<pre class="lines">
39
40
41
42
@@ -582,16 +599,18 @@ inherited by all classes except defines.
86
87
88
89</pre>
89
90
91</pre>
</td>
<td>
<pre class="code"><span class="info file"># File 'manifests/params.pp', line 39</span>
<pre class="code"><span class="info file"># File 'manifests/params.pp', line 40</span>
class confdroid_clamav::params (
# installation
Array $reqpackages = [&#39;clamav&#39;,&#39;clamd&#39;,&#39;s-nail&#39;],
String $pkg_ensure = &#39;present&#39;,
Array $cv_reqpackages = [&#39;clamav&#39;,&#39;clamd&#39;,&#39;s-nail&#39;],
String $cv_pkg_ensure = &#39;present&#39;,
# clamd
String $cv_logfile = &#39;/var/log/clamd.scan&#39;,
@@ -615,6 +634,7 @@ class confdroid_clamav::params (
String $cv_alert_file = &#39;tmp/clamav-alert.txt&#39;,
Boolean $cv_enable_freshclam = true,
Boolean $cv_enable_clamd = true,
Boolean $cv_use_excludepaths = true
) {
# service

View File

@@ -9,7 +9,7 @@ class confdroid_clamav::main::install (
) inherits confdroid_clamav::params {
require confdroid_resources::main::epel
package { $reqpackages:
ensure => $pkg_ensure,
package { $cv_reqpackages:
ensure => $cv_pkg_ensure,
}
}

View File

@@ -3,8 +3,8 @@
# Author: 12ww1160 (12ww1160@confdroid.com)
# @summary Class holds all parameters for the confdroid_clamav module and is
# inherited by all classes except defines.
# @param [Array] reqpackages List of packages to install.
# @param [String] pkg_ensure
# @param [Array] cv_reqpackages List of packages to install.
# @param [String] cv_pkg_ensure
# which [package type](https://confdroid.com/2017/05/puppet-type-package/)
# to choose, i.e. `latest` or `present`.
# @param [String] cv_logfile where to log messages for the clamd service.
@@ -35,12 +35,13 @@
# @param [String] cv_alert_file location and name of the alert file
# @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
##############################################################################
class confdroid_clamav::params (
# installation
Array $reqpackages = ['clamav','clamd','s-nail'],
String $pkg_ensure = 'present',
Array $cv_reqpackages = ['clamav','clamd','s-nail'],
String $cv_pkg_ensure = 'present',
# clamd
String $cv_logfile = '/var/log/clamd.scan',
@@ -64,6 +65,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
) {
# service

View File

@@ -21,7 +21,7 @@ PreludeAnalyzerName ClamAV
# Log additional information about the infected file, such as its
# size and hash, together with the virus name.
#ExtendedDetectionInfo yes
ExtendedDetectionInfo yes
# This option allows you to save a process identifier of the listening
# daemon (main thread).
@@ -132,6 +132,28 @@ PreludeAnalyzerName ClamAV
#ExcludePath ^/proc/
#ExcludePath ^/sys/
<% if @cv_use_excludepaths %>
ExcludePath ^/proc
ExcludePath ^/sys
ExcludePath ^/dev
ExcludePath ^/run
ExcludePath ^/var/run
ExcludePath ^/var/tmp
ExcludePath ^/tmp
ExcludePath ^/var/lib/clamav
ExcludePath ^/var/log/clamav
ExcludePath ^/var/lib/docker
ExcludePath ^/var/lib/containerd
ExcludePath ^/var/lib/kubelet/pods
ExcludePath ^/var/lib/kubelet/plugins
ExcludePath ^/var/lib/kubelet/plugins_registry
ExcludePath ^/var/log/pods
ExcludePath ^/var/log/containers
ExcludePath ^/var/cache
ExcludePath ^/run/containerd
ExcludePath ^/run/docker
<% end %>
# Maximum depth directories are scanned at.
# Default: 15
#MaxDirectoryRecursion 20