Puppet Class: vulnerability::setup
- Defined in:
- manifests/setup.pp
Summary
Ensure the your vulnerability scanning is setup correctly.Overview
vulnerability::setup
Key settings are:
-
directories
-
excludes
-
ttl_hours
See the file “LICENSE” for the full license governing this code.
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 |
# File 'manifests/setup.pp', line 55
class vulnerability::setup (
Stdlib::Absolutepath $cache_dir,
Stdlib::Absolutepath $config_dir,
Array[Stdlib::Absolutepath] $directories,
Array[String[1]] $excludes,
Vulnerability::Level $level,
Integer $ttl_hours,
String[1] $update_url
) {
include vulnerability::clear_facter_cache
fact_config { 'cve_list':
ttl => "${ttl_hours} hours",
}
$properties = case $facts['kernel'] {
'Linux': { { 'owner' => 'root' } }
'windows': { { 'owner' => 'Administrator' } }
default: {
fail "vulnerability scanning not (yet) supported on ${facts['kernel']}"
}
}
file { "${config_dir}/grype.yaml":
ensure => 'file',
content => epp('vulnerability/grype.yaml.epp', {
'cache_dir' => $cache_dir,
'update_url' => $update_url,
'excludes' => $excludes,
}),
mode => '0755',
* => $properties,
notify => Fact_cache['cve_list'],
}
# lint:ignore:strict_indent
$config = @("CONFIG"/L)
directories = ${directories.join(',')}
excludes = ${excludes.join(',')}
level = ${level}
| CONFIG
# lint:endignore:strict_indent
file { "${config_dir}/vulnerability.conf":
ensure => 'file',
content => $config,
mode => '0755',
* => $properties,
notify => Fact_cache['cve_list'],
}
}
|