voxpupuli / puppet-yum

Puppet module for Yum
https://forge.puppet.com/puppet/yum
MIT License
16 stars 99 forks source link

Option to disable display of diff in the puppet log #276

Open teluq-pbrideau opened 1 year ago

teluq-pbrideau commented 1 year ago

Pull Request (PR) description

In addition to https://github.com/voxpupuli/puppet-yum/pull/275 There is conditions where the sensitive information is displayed in the logs. This add option to completely disable output in the logs.

class example {
  class { 'yum' :
    show_diff => false,
  }
}

Tests

I’m not a pro in the tests suite alley, feel free to comment on any other way I could have fixed the tests… It took me way longer to fix the tests than to add the new config.

As the yum::config now includes yum to retreive yum::show_diff, the tests are done on every supported OS for the variables to be set correctly.

I had to modify the versionlock tests to make them pass. The diff is quite hard to read, so here the summary of what I did:

teluq-pbrideau commented 1 year ago

I’ve merged the changes in master here, but the static validation test fail, is it because of REFERENCE.md is outdated ? How can I make this test pass? I've generated the REFERENCE.md file with puppet strings generate --format markdown successfully

teluq-pbrideau commented 1 year ago

Here, I’ve successfully merged and successfully make tests pass again. Can we move forward with this please?

teluq-pbrideau commented 3 weeks ago

Maybe I could add a notice in the README about the risks of using sensitive parameters, as noted on my original issue? What do you think?

The password is not censored when another config is changed:

--- /etc/yum.conf       2022-09-28 10:53:13.958280359 -0400
+++ /etc/yum.conf.augnew        2022-09-28 11:44:01.581689900 -0400
@@ -10,5 +10,5 @@
 metadata_expire=0
 mirrorlist_expire=0
 proxy=http://host.example.com:3128
-proxy_username=user
+proxy_username=anotheruser
 proxy_password=mysecretpassword

Notice: /Stage[main]/Yum/Yum::Config[proxy_username]/Augeas[yum.conf_proxy_username]/returns: executed successfully (corrective)

It might lure people in a false sense of security by using Sensitive parameters...