Documentation by YARD 0.9.36
-Alphabetic Index
- -Puppet Class Listing A-Z
- - -
-
-
-
|
-
File Listing
--
-
-
-
- README - - -
From 56c9f218444e12a41554e5c09d8b17cb00a88116 Mon Sep 17 00:00:00 2001 From: 12ww1160 <12ww1160@confdroid.com> Date: Tue, 22 Sep 2026 11:54:36 +0200 Subject: [PATCH] OP#785 initial commit --- .vscode/settings.json | 1 + Jenkinsfile | 39 +- README.md | 59 +- doc/_index.html | 143 ---- doc/css/common.css | 8 - doc/css/full_list.css | 58 -- doc/css/style.css | 497 ------------- doc/file.README.html | 162 ----- doc/frames.html | 22 - doc/index.html | 162 ----- doc/js/app.js | 314 --------- doc/js/full_list.js | 216 ------ doc/js/jquery.js | 4 - doc/puppet_class_list.html | 92 --- doc/puppet_classes/clamav_cd.html | 129 ---- .../clamav_cd_3A_3Amain_3A_3Aconfig.html | 161 ----- .../clamav_cd_3A_3Amain_3A_3Adirs.html | 154 ----- .../clamav_cd_3A_3Amain_3A_3Afiles.html | 236 ------- .../clamav_cd_3A_3Amain_3A_3Ainstall.html | 139 ---- .../clamav_cd_3A_3Amain_3A_3Aservice.html | 194 ------ doc/puppet_classes/clamav_cd_3A_3Aparams.html | 653 ------------------ doc/top-level-namespace.html | 98 --- manifests/init.pp | 12 +- manifests/main/config.pp | 14 +- manifests/main/dirs.pp | 14 +- manifests/main/files.pp | 14 +- manifests/main/install.pp | 12 +- manifests/main/service.pp | 14 +- manifests/params.pp | 20 +- 29 files changed, 119 insertions(+), 3522 deletions(-) delete mode 100644 doc/_index.html delete mode 100644 doc/css/common.css delete mode 100644 doc/css/full_list.css delete mode 100644 doc/css/style.css delete mode 100644 doc/file.README.html delete mode 100644 doc/frames.html delete mode 100644 doc/index.html delete mode 100644 doc/js/app.js delete mode 100644 doc/js/full_list.js delete mode 100644 doc/js/jquery.js delete mode 100644 doc/puppet_class_list.html delete mode 100644 doc/puppet_classes/clamav_cd.html delete mode 100644 doc/puppet_classes/clamav_cd_3A_3Amain_3A_3Aconfig.html delete mode 100644 doc/puppet_classes/clamav_cd_3A_3Amain_3A_3Adirs.html delete mode 100644 doc/puppet_classes/clamav_cd_3A_3Amain_3A_3Afiles.html delete mode 100644 doc/puppet_classes/clamav_cd_3A_3Amain_3A_3Ainstall.html delete mode 100644 doc/puppet_classes/clamav_cd_3A_3Amain_3A_3Aservice.html delete mode 100644 doc/puppet_classes/clamav_cd_3A_3Aparams.html delete mode 100644 doc/top-level-namespace.html diff --git a/.vscode/settings.json b/.vscode/settings.json index e8e4fe0..551a816 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -6,6 +6,7 @@ "bofh", "clamav", "clamd", + "clamdscan", "clamonacc", "clamscan", "Clamuko", diff --git a/Jenkinsfile b/Jenkinsfile index fe517fd..bdcfbd3 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,5 +1,5 @@ pipeline { - agent { + agent any { label 'puppet' } @@ -69,7 +69,7 @@ pipeline { withCredentials([string(credentialsId: 'sonar-token', variable: 'SONAR_TOKEN')]) { sh ''' /opt/sonar-scanner/bin/sonar-scanner \ - -Dsonar.projectKey=clamav_cd \ + -Dsonar.projectKey=confdroid_clamav \ -Dsonar.sources=. \ -Dsonar.host.url=https://sonarqube.confdroid.com \ -Dsonar.token=$SONAR_TOKEN @@ -90,16 +90,39 @@ pipeline { 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 -o merge_request.create \ - -o merge_request.target=master \ - -o merge_request.title="Auto-merge for build $BUILD_NUMBER" \ - -o merge_request.description="Automated changes from Jenkins build $BUILD_NUMBER" \ - -o merge_request.merge_when_pipeline_succeeds=true \ - origin jenkins-build-$BUILD_NUMBER + 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 + ''' + } + } + } + } + } } } \ No newline at end of file diff --git a/README.md b/README.md index a8e31d8..c6cd162 100644 --- a/README.md +++ b/README.md @@ -1,47 +1,61 @@ # Readme -[](https://jenkins.confdroid.com/job/clamav_cd/)| +[](https://jenkins.confdroid.com/job/confdroid_clamav/) -[[_TOC_]] +[](https://deepwiki.com/grizzlycoda/puppet_collection) + +- [Readme](#readme) + - [Synopsis](#synopsis) + - [WARNING](#warning) + - [Features](#features) + - [Dependencies](#dependencies) + - [Deployment](#deployment) + - [Parameters](#parameters) + - [SELINUX](#selinux) + - [Support](#support) + - [Tests](#tests) + - [Contact Us](#contact-us) + - [Disclaimer](#disclaimer) ## Synopsis `Clamav` is a powerful antivirus scanner with several components. -`clamav_cd` is a puppet module to manage clamav installations and configurations. +`confdroid_clamav` is a puppet module to manage clamav installations and configurations. ## WARNING ***Attention: Never use this puppet module on systems which have been previously configured manually. It is impossible to predict how and what would have been configured, hence previous configurations outside the scope of this module may be overwritten! Automated configurations require a test environment to verify that the module suits the purpose intended by the user, as well as tune the parameters, before deploying into live production*** ## Features -* install all required binaries including s-nail as mail program to send alerts when infected files are found -* manage required config files -* manage cronjob settings via parameters -* run cron job to scan the file system ( by default starting at root, configurable) -* manage services + +- install all required binaries including s-nail as mail program to send alerts when infected files are found +- 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 +- manage services ## Dependencies All dependencies must be included in the catalogue. -* [cd_resources](https://gitlab.confdroid.com/puppet/cd_resources) for managing yum repo resources. +- [confdroid_resources](https://sourcecode.confdroid.com/confdroid/confdroid_resources) for managing yum repo resources. ### Deployment -* native Puppet deployment +- native Puppet deployment via site.pp or nodes.pp ```bash node 'example.example.net' { - include clamav_cd + include confdroid_clamav } ``` -* through Foreman: +- through Foreman: -In order to apply parameters through Foreman, **__clamav_cd::params__** must be added to the host or host group in question. +In order to apply parameters through Foreman, **__confdroid_clamav::params__*- must be added to the host or host group in question. See [more details about class deployment on Confdroid.com](https://confdroid.com/2017/05/deploying-our-puppet-modules/). @@ -55,21 +69,22 @@ All files and directories are configured with correct selinux context. If selinu ## Support -* OS: Rocky 9 -* Puppet 6-8 +- OS: Rocky 9 +- Puppet 8 ## Tests -* Puppet Lint - * excluded tests: - * `--no-class_inherits_from_params_class-check`:relevant only to non-supported outdated puppet versions -* Puppet Parser -* ERB Template Parser -* Sonar Quality Gate +- Puppet Lint + - excluded tests: + - `--no-class_inherits_from_params_class-check`:relevant only to non-supported outdated puppet versions +- Puppet Parser +- ERB Template Parser +- Sonar Quality Gate ## Contact Us -[contact Us](https://confdroid.com/contact/) +- [contact Us](https://confdroid.com/contact/) +- [Feedback Portal](https://feedback.confdroid.com) ## Disclaimer diff --git a/doc/_index.html b/doc/_index.html deleted file mode 100644 index dc4ce47..0000000 --- a/doc/_index.html +++ /dev/null @@ -1,143 +0,0 @@ - - -
- - -
-
-
-
|
-
| t |
- - - -6 -7 -8 -9 -10 -11 -12- |
-
- # File 'manifests/init.pp', line 6
-
-class clamav_cd {
- include clamav_cd::params
-
- resources { 'firewall':
- purge => true,
- }
-}
- |
-
clamav_cd::main::config.pp Module name: clamav_cd Author: Arne Teuke (arne_teuke@confdroid.com)
- -
- - - -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26- |
-
- # File 'manifests/main/config.pp', line 7
-
-class clamav_cd::main::config (
-
-) inherits clamav_cd::params {
- include clamav_cd::main::service
-
- # Ensure the SELinux boolean antivirus_can_scan_system is enabled if disabled
- exec { 'enable_antivirus_can_scan_system':
- command => '/usr/sbin/setsebool -P antivirus_can_scan_system 1',
- unless => '/usr/sbin/getsebool antivirus_can_scan_system | grep --quiet "on"',
- path => ['/usr/sbin', '/bin'],
- }
-
- # create a cron job to run a daily scan
- cron { 'clamscan':
- command => $cv_shell_script,
- user => $cv_cron_user,
- hour => $cv_cron_hour,
- minute => $cv_cron_minute,
- }
-}
- |
-
clamav_cd::main::dirs.pp Module name: clamav_cd Author: Arne Teuke (arne_teuke@confdroid.com)
- -
- - - -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22- |
-
- # File 'manifests/main/dirs.pp', line 6
-
-class clamav_cd::main::dirs (
-
-) inherits clamav_cd::params {
- require clamav_cd::main::install
-
- # config.d dir
- file { $cv_config_d_dir:
- ensure => directory,
- owner => 'root',
- group => 'root',
- mode => '0755',
- selrange => s0,
- selrole => object_r,
- seltype => etc_t,
- seluser => system_u,
- }
-}
- |
-
clamav_cd::main::files.pp Module name: clamav_cd Author: Arne Teuke (arne_teuke@confdroid.com)
- -
- - - -6 -7 -8 -9 -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 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63- |
-
- # File 'manifests/main/files.pp', line 6
-
-class clamav_cd::main::files (
-
-) inherits clamav_cd::params {
- require clamav_cd::main::dirs
-
- # clamd config file
- file { $cv_clamd_config_file:
- ensure => file,
- owner => 'root',
- group => 'root',
- mode => '0644',
- selrange => s0,
- selrole => object_r,
- seltype => etc_t,
- seluser => system_u,
- content => template($cv_clamd_config_erb),
- notify => Service[$cv_service],
- }
-
- # freshclam config file
- file { $cv_freshclam_file:
- ensure => file,
- owner => 'root',
- group => 'root',
- mode => '0600',
- selrange => s0,
- selrole => object_r,
- seltype => etc_t,
- seluser => system_u,
- content => template($cv_freshclam_erb),
- }
-
- # freshclam service config file
- file { $cv_freshclam_svc :
- ensure => file,
- owner => 'root',
- group => 'root',
- mode => '0600',
- selrange => s0,
- selrole => object_r,
- seltype => etc_t,
- seluser => system_u,
- content => template($cv_freshclam_svc_erb),
- }
-
- # shell script for scanning and alerting
- file { $cv_shell_script :
- ensure => file,
- owner => 'root',
- group => 'root',
- mode => '0750',
- selrange => s0,
- selrole => object_r,
- seltype => etc_t,
- seluser => system_u,
- content => template($cv_shell_script_erb),
- }
-}
- |
-
clamav_cd ::main::install.pp Module name: clamav_cd Author: Arne Teuke (arne_teuke@confdroid.com)
- -
- - - -7 -8 -9 -10 -11 -12 -13 -14 -15- |
-
- # File 'manifests/main/install.pp', line 7
-
-class clamav_cd::main::install (
-
-) inherits clamav_cd::params {
- require confdroid_resources::main::epel
-
- package { $reqpackages:
- ensure => $pkg_ensure,
- }
-}
- |
-
clamav_cd::main::service.pp Module name: clamav_cd Author: Arne Teuke (arne_teuke@confdroid.com)
- -
- - - -6 -7 -8 -9 -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 -42- |
-
- # File 'manifests/main/service.pp', line 6
-
-class clamav_cd::main::service (
-
-) inherits clamav_cd::params {
- require clamav_cd::main::files
-
- if $cv_enable_clamd == true {
- service { $cv_service:
- ensure => running,
- hasstatus => true,
- hasrestart => true,
- enable => true,
- }
- } else {
- service { $cv_service:
- ensure => stopped,
- hasstatus => true,
- hasrestart => true,
- enable => false,
- }
- }
-
- if $cv_enable_freshclam == true {
- service { $cv_freshclam:
- ensure => running,
- hasstatus => true,
- hasrestart => true,
- enable => true,
- }
- } else {
- service { $cv_freshclam:
- ensure => stopped,
- hasstatus => true,
- hasrestart => true,
- enable => false,
- }
- }
-}
- |
-
clamav_cd::params.pp Module name: clamav_cd Author: Arne Teuke (arne_teuke@confdroid.com)
- -
- - - -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84 -85 -86 -87 -88 -89- |
-
- # File 'manifests/params.pp', line 39
-
-class clamav_cd::params (
-
-# installation
- Array $reqpackages = ['clamav','clamd','s-nail'],
- String $pkg_ensure = 'present',
-
-# clamd
- String $cv_logfile = '/var/log/clamd.scan',
- String $cv_logfileunlock = 'no',
- String $cv_logfilemaxsize = '2M',
- String $cv_logtime = 'yes',
- String $cv_logclean = 'no',
- String $cv_logsyslog = 'yes',
- String $cv_logfacility = 'LOG_MAIL',
- String $cv_logverbose = 'no',
- String $cv_logrotate = 'yes',
- String $cv_preludeenable = 'no',
- String $cv_preludeanalyzername = 'ClamAV',
- String $cv_tcpsocket = '3310',
- String $cv_tcpaddress = 'localhost',
- String $cv_alert_email = 'you@example.com',
- String $cv_cron_hour = '2',
- String $cv_cron_minute = '0',
- String $cv_cron_user = 'root',
- String $cv_scan_dir = '/',
- String $cv_alert_file = 'tmp/clamav-alert.txt',
- Boolean $cv_enable_freshclam = true,
- Boolean $cv_enable_clamd = true,
-
-) {
- # service
- $cv_service = 'clamd@scan'
- $cv_freshclam = 'freshclam'
-
- # dirs
- $cv_config_d_dir = '/etc/clamd.d'
-
- # files
- $cv_clamd_config_file = "${cv_config_d_dir}/scan.conf"
- $cv_clamd_config_erb = 'clamav_cd/scan_conf.erb'
- $cv_freshclam_file = '/etc/freshclam.conf'
- $cv_freshclam_erb = 'clamav_cd/freshclam_conf.erb'
- $cv_freshclam_svc = '/usr/lib/systemd/system/freshclam.service'
- $cv_freshclam_svc_erb = 'clamav_cd/freshclam_svc.erb'
- $cv_shell_script = "${cv_config_d_dir}/scan.sh"
- $cv_shell_script_erb = 'clamav_cd/scan.sh.erb'
-
- # includes must be last
-
- include clamav_cd::main::config
-}
- |
-