Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/facter/log4jscanner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
data['vulnerable_jars_count'] = vulnerable_jars.count
data['errors'] = errors
data['last_scan'] = last_runtime
data['warnings'] = warnings
data
end
end
10 changes: 9 additions & 1 deletion manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
# @param cron_monthday
# @param cron_weekday
# @param cron_minute
# @param skip_initial_scan
# If this parameter is set, then the scan data won't be generated until the cron job gets to it
# @param windows_directories
# Which directories to scan on Windows nodes
# @param windows_skip
Expand All @@ -36,6 +38,7 @@
$cron_monthday = absent,
$cron_weekday = absent,
$cron_minute = fqdn_rand(59),
Boolean $skip_initial_scan = false,
Array[String] $windows_directories = ['C:'],
Array[String] $windows_skip = ['C:\Windows\Temp'],
Integer $scheduled_task_every = 1,
Expand Down Expand Up @@ -219,7 +222,12 @@
mode => $scan_script_mode,
content => epp("${module_name}/${scan_script}.epp", $template_data),
require => File[$scan_bin],
notify => Exec[$generate_scan_data_exec],
}

unless $skip_initial_scan {
if $generate_scan_data_exec {
File[$scan_cmd] ~> Exec[$generate_scan_data_exec]
}
}

if $fact_upload_exec {
Expand Down
1 change: 0 additions & 1 deletion spec/classes/log4jscanner_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@
.with_mode(scan_script_mode)
.with_content(default_script_regex)
.with_require("File[#{scan_bin}]")
.with_notify('Exec[Log4jscanner generate scan data]')
is_expected.to contain_exec('Log4jscanner fact upload')
.with_command(fact_upload_cmd)
.with_path(['/usr/bin', '/bin', '/sbin', '/usr/local/bin', cache_dir])
Expand Down