-
Notifications
You must be signed in to change notification settings - Fork 3
Description
Hi,
the module sets the environment to upload the facts to within the variable $fact_upload_params, see
log4jscanner/manifests/init.pp
Line 76 in 53d702d
| $fact_upload_params = "facts upload --environment ${environment}" |
While this is simple, it has an unfortunate (and annoying) side effect. Due to the notify later on:
log4jscanner/manifests/init.pp
Line 222 in 53d702d
| notify => Exec[$generate_scan_data_exec], |
It means that a simple environment change will trigger a full log4jscanner run, as puppet will rewrite the script. Which can take ages and is wasteful.
If one is using environment based setups, and switches often between them, testing a single change in ones puppet can mean a ten minute run of log4jscanner.
Thats less than optimal.
I suggest adjusting to either use a
puppet config print
or, better,
awk -F ': ' '/^environment:/ {print $2}' $(puppet config print lastrunreport)
to get at the value.
The latter would cover setups, where people do not use puppets configfile to set the actual environment a machine runs in, by just taking what the last puppet run used.