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

Automatically convert encrypted values to Sensitive[T] #302

Open
woky opened this issue Aug 3, 2020 · 4 comments
Open

Automatically convert encrypted values to Sensitive[T] #302

woky opened this issue Aug 3, 2020 · 4 comments

Comments

@woky
Copy link

woky commented Aug 3, 2020

So I'm learning to use secrets and I stumbled upon https://blog.example42.com/2019/04/04/puppet_sensitive_data/ and https://puppet.com/blog/my-journey-securing-sensitive-data-puppet-code/. Both blogs get into error when they declare class parameter as Sensitive[String] $foo and receive String, and solve it by manually converting data types for each value that's deemed sensitive in YAML like this:

lookup_options:
  profile::db::password:
    convert_to: "Sensitive"

Couldn't hiera-eyaml do it automatically for all encrypted types?

I guess to not break backward compatibility this would have to be an opt-in in hiear.yaml, e.g.:

defaults:
  lookup_key: eyaml_lookup_key
  options:
    eyaml_convert_to_sensitive: true
    pkcs7_private_key: /etc/puppetlabs/puppet/eyaml/private_key.pkcs7.pem
    pkcs7_public_key: /etc/puppetlabs/puppet/eyaml/public_key.pkcs7.pem
@woky
Copy link
Author

woky commented Aug 3, 2020

I assume that this project is for editing EYAML while Puppet itself decrypts them so it's more of a request to change eyaml_lookup_key.rb.

@woky woky closed this as completed Aug 3, 2020
@woky woky reopened this Aug 3, 2020
@iscb1962
Copy link

iscb1962 commented Feb 23, 2023

Is this something thats likely to be done at some point ? I'm seeing more modules expecting sensitive strings and TBH its a PITA having to add lookup_options for each piece of hieradata.

@bastelfreak
Copy link
Member

I am happy to review such a PR. Would you be interested in providing one?

@iscb1962
Copy link

I'm afraid it's probably beyond my skills to do so.

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

No branches or pull requests

3 participants