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

Config file rendering shows plain-text password in diff #184

Closed
rmoriz opened this issue Feb 19, 2015 · 7 comments
Closed

Config file rendering shows plain-text password in diff #184

rmoriz opened this issue Feb 19, 2015 · 7 comments
Labels
Milestone

Comments

@rmoriz
Copy link

rmoriz commented Feb 19, 2015

Currently, each monitor template will throw a diff when converged which includes, e.g. the password in plain text (chef's default).

eg

   --- /etc/dd-agent/conf.d/postgres.yaml   2015-02-06 11:46:53.198260001 +0000
    +++ /tmp/chef-rendered-template20150219-19830-11k7o7q   2015-02-19 13:43:20.518260002 +0000
    @@ -5,6 +5,6 @@
       - host: localhost
         port: 5432
         username: datadog
    -    password: 
    +    password: secretpassphrase
         dbname: postgres

Please consider using sensitive true as resource option. See https://docs.chef.io/resource_common.html

@miketheman
Copy link
Contributor

@rmoriz That's a really good idea! I looked a bit, and that was introduced in Chef 11.10.0.
Since we still support Chef 10.x, and don't want to break backwards functionality, we could wrap the parameter in a case where we only set it for versions higher than when the parameter was introduced.

Something like:

chef > min_ver = Chef::Version.new('11.10.0')
 => 11.10.0
chef > current_ver = Chef::Version.new(Chef::VERSION)
 => 11.16.4
chef > current_ver > min_ver
 => true

How does that sound?

@rmoriz
Copy link
Author

rmoriz commented Feb 19, 2015

How about:

template "…" do
  sensitive true if respond_to?(:sensitive)
end

It's the way the Chef people recommend it, e.g. in this case: https://www.chef.io/blog/2015/02/17/chef-12-1-0-chef_gem-resource-warnings/

@miketheman
Copy link
Contributor

That sounds even better!

@miketheman
Copy link
Contributor

Going to slot this change for Next Major, as the behavior would likely apply unilaterally to all templates generated by the datadog_monitor resource, and this might change expected behaviors.

@miketheman miketheman added this to the Next Major milestone Apr 8, 2015
@PurrBiscuit
Copy link

+1 for this...we use jenkins for our chef runs and it logs the output. any way to get that output suppressed from those templates would be great.

@poblahblahblah
Copy link

👍

@miketheman miketheman modified the milestones: Next minor, Next Major Apr 21, 2016
@miketheman
Copy link
Contributor

Resolved via #274.

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

No branches or pull requests

4 participants