Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for keep_secret parameter #92

Closed
wants to merge 10 commits into from

Conversation

stepanstipl
Copy link
Contributor

Typical use case is to use this module for managing sensitive values like passwords, which we do not want in the logs. Using this new parameter keep_secret will prevent this.

Accepted values:

  • false - default, normal behavior
  • true - value will be replaced with "[sorry, this is secret]"
  • md5 - value will be replaced with it's md5 hash

@nibalizer
Copy link

This looks solid to me.


Parameter `keep_secret` allows to prevent outputing actual values to the log. Possible values are:
* `false` - default, normal behavior
* `true` - value will be replaced with `[sorry, this is secret]`
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we reword this to make it clear that we're redacting stuff from the logs? Otherwise this is mergable.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, what formulation did you have in mind?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just something along the lines of:

###Passwords and other sensitive information

In order to support sensitive information we have the following parameters available to control how entries within Puppet logfiles look.

####keep_secret

This parameter allows you to prevent outputting actual values contained within the catalog to the logfile. Possible values are:

  • false: This allows all values to be passed to logfiles. (default)
  • true: The values in the logfiles will be replaced with [redacted sensitive information].

(something like that, then with the corresponding change to sorry this is secret to match the wording!)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cheers, I've updated this in accordance with suggestions.

@apenney
Copy link

apenney commented Apr 25, 2014

This is looking great! The only thing we're missing is unit and acceptance tests. Any chance you could take a look at those? They should be relatively easy in this case (I hope!) as you can crib from similar nearby tests.

@stepanstipl
Copy link
Contributor Author

Hi Ashley, I've added unit tests for keep_secret, can you have a look if those are what's expected? I'll also try to have a look at the acceptance tests. Cheers

@igalic
Copy link
Contributor

igalic commented May 29, 2014

@stepanstipl the unit tests look very good, we're very much looking forward for your acceptance tests

@stepanstipl
Copy link
Contributor Author

Ok I've added acceptance tests. Not sure why unit tests fail suddenly, they run fine on my machine and seems to be unrelated to changes I've made.

@stepanstipl
Copy link
Contributor Author

Seems to be issue with new version of rspec-puppet - rodjek/rspec-puppet#200, I've pinned down rspec dependency to gem 'rspec','<3.0.0', :require => false which fixes it.

@@ -10,6 +10,7 @@ group :development, :test do
gem 'puppet-lint', :require => false
gem 'serverspec', :require => false
gem 'pry', :require => false
gem 'rspec','<3.0.0', :require => false
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sooner or later we'll have to be rspec compatible.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I agree and I can remove that, but in that case it won't pass Travis CI. Btw. those are not tests that I've added, it's just that rspec recently updated :).

@puppetcla
Copy link

Waiting for CLA signature by @stepanstipl

@stepanstipl - We require a Contributor License Agreement (CLA) for people who contribute to Puppet, but we have an easy click-through license with instructions, which is available at https://cla.puppetlabs.com/

Note: if your contribution is trivial and you think it may be exempt from the CLA, please post a short reply to this comment with details. http://docs.puppetlabs.com/community/trivial_patch_exemption.html

@stepanstipl
Copy link
Contributor Author

Hi, I've just signed the CLA

@puppetcla
Copy link

CLA signed by all contributors.

@igalic
Copy link
Contributor

igalic commented Aug 18, 2014

cool. @stepanstipl can you rebase your and squash them down to a few logical commits?

@underscorgan
Copy link
Contributor

@stepanstipl thanks for the contribution! I'm going to close this for now though, since we haven't heard from you in a while and it needs to be rebased, have conflicts resolved, and be squashed. If this is work you'd still like to see added to the module please address the required work and submit a new PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants