Documentation by YARD 0.9.36
+Alphabetic Index
+ +Puppet Class Listing A-Z
+ + +
+
+
+
|
+
File Listing
+-
+
+
+
- README + + +
diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index 31d7fc0..0000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "cSpell.words": [ - "ALLMATCHSCAN", - "authenticode", - "behaviour", - "bofh", - "clamav", - "clamd", - "clamdscan", - "clamonacc", - "clamscan", - "Clamuko", - "clamupdate", - "concurrentdatabasereload", - "Dazuko", - "dbname", - "epel", - "excludepaths", - "fanotify", - "fdpass", - "filesize", - "freshclam", - "getsebool", - "INADDR", - "kubelet", - "libclamav", - "logclean", - "logfacility", - "logfile", - "logfilemaxsize", - "logfileunlock", - "logrotation", - "logsyslog", - "logtime", - "logverbose", - "MAINPID", - "multiscan", - "mypass", - "myproxy", - "myusername", - "NOFILE", - "normalisation", - "PCRE", - "pipefail", - "preludeanalyzername", - "preludeenable", - "recieve", - "RLIMIT", - "safebrowsing", - "setsebool", - "subsig", - "subsigs", - "tcpaddre", - "tcpaddress", - "tcpsocket", - "VIRUSEVENT", - "virusgroup", - "VIRUSNAME", - "XMLDOCS", - "xxxyyzzzz" - ] -} \ No newline at end of file diff --git a/Jenkinsfile b/Jenkinsfile deleted file mode 100644 index 3de3324..0000000 --- a/Jenkinsfile +++ /dev/null @@ -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 - ''' - } - } - } - } - } - } -} \ No newline at end of file diff --git a/doc/_index.html b/doc/_index.html new file mode 100644 index 0000000..c845e3e --- /dev/null +++ b/doc/_index.html @@ -0,0 +1,143 @@ + + +
+ + +
+
+
+
|
+
| t |
+ + + +6 +7 +8 +9 +10 +11 +12+ |
+
+ # File 'manifests/init.pp', line 6
+
+class confdroid_clamav {
+ include confdroid_clamav::params
+
+ resources { 'firewall':
+ purge => true,
+ }
+}
+ |
+
confdroid_clamav::main::config.pp Module name: confdroid_clamav Author: 12ww1160 (12ww1160@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 confdroid_clamav::main::config (
+
+) inherits confdroid_clamav::params {
+ include confdroid_clamav::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,
+ }
+}
+ |
+
confdroid_clamav::main::dirs.pp Module name: confdroid_clamav Author: 12ww1160 (12ww1160@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 confdroid_clamav::main::dirs (
+
+) inherits confdroid_clamav::params {
+ require confdroid_clamav::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,
+ }
+}
+ |
+
confdroid_clamav::main::files.pp Module name: confdroid_clamav Author: 12ww1160 (12ww1160@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 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79+ |
+
+ # File 'manifests/main/files.pp', line 6
+
+class confdroid_clamav::main::files (
+
+) inherits confdroid_clamav::params {
+ require confdroid_clamav::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),
+ notify => Service[$cv_freshclam],
+ }
+
+ # 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),
+ 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
+ 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),
+ }
+}
+ |
+
confdroid_clamav ::main::install.pp Module name: confdroid_clamav Author: 12ww1160 (12ww1160@confdroid.com)
+ +
+ + + +7 +8 +9 +10 +11 +12 +13 +14 +15+ |
+
+ # File 'manifests/main/install.pp', line 7
+
+class confdroid_clamav::main::install (
+
+) inherits confdroid_clamav::params {
+ require confdroid_resources::main::epel
+
+ package { $cv_reqpackages:
+ ensure => $cv_pkg_ensure,
+ }
+}
+ |
+
confdroid_clamav::main::service.pp Module name: confdroid_clamav Author: 12ww1160 (12ww1160@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 confdroid_clamav::main::service (
+
+) inherits confdroid_clamav::params {
+ require confdroid_clamav::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,
+ }
+ }
+}
+ |
+
confdroid_clamav::params.pp Module name: confdroid_clamav Author: 12ww1160 (12ww1160@confdroid.com)
+ +
+ + + +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 +90 +91 +92 +93 +94 +95 +96 +97 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108+ |
+
+ # File 'manifests/params.pp', line 50
+
+class confdroid_clamav::params (
+
+# installation
+ Array $cv_reqpackages = ['clamav','clamd','s-nail'],
+ String $cv_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,
+ 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'
+
+) {
+ # 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 = 'confdroid_clamav/scan_conf.erb'
+ $cv_freshclam_file = '/etc/freshclam.conf'
+ $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'
+
+ # includes must be last
+
+ include confdroid_clamav::main::config
+}
+ |
+