Closed
Description
Describe the Bug
We are passing a Sensitive object from vault_lookup to the file resource type using stdlib::deferrable_epp.
Running puppet agent --test
results in the updated secret being rendered to the screen in plain text.
Expected Behavior
The file resource type should not render Sensitive variable values in clear text in file difference output. The value rendered to output should be changed from Redacted to Redacted.
Steps to Reproduce
Steps to reproduce the behavior:
$my_vars = {
'url' => $external_url,
'app_id' => $external_app_id,
'app_token => Deferred('vault_lookup::lookup', [
$path_to_app_id_token, {
'vault_addr' => $vault_url,
'cert_role' => $servertype,
'field' => 'app_id_token_pw',
},
]),
}
file { '/opt/my_app/my_script.sh':
ensure => file,
owner => 'root',
group => 'root',
mode => '0750',
content => stdlib::deferrable_epp("${module_name}/opt/my_app/my_script.sh.epp", $my_vars),
}
- In HashiCorp vault, update the token value.
- On the Linux server, execute:
sudo puppet agent --test
- The output should show the new token value and the old token value in clear text.
Environment
- Version puppet-agent 8.5.1, puppetlabs-stdlib 9.6.0, and puppet-vault_lookup 1.1.0
- Platform Ubuntu 22.04
Additional Context
I'm pretty sure the secret was not displayed when it changed under puppet 7.24.