
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Table of Contents generated with DocToc
Notice: The default secret key location is now /etc/puppet-decrypt/encryptor_secret_key
Puppet Decrypt is a gem that gives puppet the ability to encrypt and decrypt strings. This is useful for making sure secret data - like database passwords - remains secret. It uses a model similar to jasypt Encrypting Application Configuration Files or Maven Password Encryption. It is a simple alternative to the Secret variables in Puppet with Hiera and GPG approach.
Advantages:
Disadvantages:
The shared secret "master password" may seem more difficult to grant and revoke access than the asymetric keypair approach used by hiera-gpg. However both systems are protecting shared secret data! So if you want to fully revoke someone's access you need to change or revoke their decryption key (which is easier with hiera-gpg) AND to change any secrets that key protected (e.g.: your production database passwords).
It should be possible to install via a Gem in Puppet 3+. However, this method is easier, but does seem to have some quirks. If you have any issues, try installing as a module instead.
Add this line to your application's Gemfile:
gem 'puppet-decrypt'
And then execute:
$ bundle
Or install it yourself as:
$ gem install puppet-decrypt
If installing as a module, you'll need to deal with the Gem prerequisites manually.
$ gem install encryptor
Puppet Decrypt can be installed with the puppet module subcommand, which is included in Puppet 2.7.14 and later.
$ sudo puppet module install devopsy-puppet_decrypt
The command will tell you where it is installing the module; take note:
$ sudo puppet module install devopsy/puppet_decrypt
warning: iconv couldn't be loaded, which is required for UTF-8/UTF-16 conversions
Preparing to install into /etc/puppet/modules ...
Downloading from http://forge.puppetlabs.com ...
Installing -- do not interrupt ...
/etc/puppet/modules
└── devopsy-puppet_decrypt (v0.1.0)
After installing it, you must add the lib directory of the module to your $RUBYLIB. Add the following to your .profile file (replacing /etc/puppet/modules with the directory from the install command, if necessary), then run source ~/.profile to re-load it in the current shell:
export RUBYLIB=/etc/puppet/modules/puppet_decrypt/lib:$RUBYLIB
You can verify that it is installed and usable by running:
# puppet help crypt
Put the secret key in /etc/puppet-decrypt/encryptor_secret_key on machines where puppet needs to decrypt the value. Make sure the file's read permissions are restricted!
Use the puppet face to encrypt a value
$ puppet crypt encrypt my_secret_value
ENC[ANN3I3AWxXWmr5QAW3qgxw==]
Or to decrypt a value
$ puppet crypt decrypt ENC[ANN3I3AWxXWmr5QAW3qgxw==]
my_secret_value
Put that value into hiera, extlookup, or any other data source you want. Hiera example:
database_password: ENC[ANN3I3AWxXWmr5QAW3qgxw==]
In your puppet code, load the value normally and then pass it to decrypt.
decrypt(hiera('database_password'))
Or encrypt a secret passing it to encrypt, if you need to save the secret to external storage, for example.
$encrypted_secret_to_save = encrypt($data)
Puppet Decrypt now supports using more than just the default secret key location. You can easily use multiple secret keys for the same project.
For the Puppet face, you just use the --secretkey option to pass an alternate secret key location.
$ echo 'example' > alt_key.txt
$ puppet crypt encrypt abc123 --secretkey alt_key
ENC[c4S4hMCDv1b7FkZgOBRTOA==]
$ puppet crypt decrypt ENC[c4S4hMCDv1b7FkZgOBRTOA==] --secretkey alt_key
abc123
There are two ways to use the alternate keys from the function. You can pass it it as part of the string in this format:
database_password: ENC:alt_key[c4S4hMCDv1b7FkZgOBRTOA==]
If you do that, instead of using the default secret key, it will look for alt_key in the same directory. So instead of /etc/puppet-decrypt/encryptor_secret_key it will use /etc/puppet-decrypt/alt_key.
Alternately, you can pass a hash to the function, containing a value and a secret key, like this:
db_password:
value: 'ENC[G6MjBDDFcapYLaKBFJvPSg==]'
secretkey: '/any/path/you/another/key'
This has the advantage of letting you place keys in alternate directories, not just /etc/puppet-decrypt.
If you use this alongside hiera, you can just switch the lookup from hiera to hiera-hash:
decrypt(hiera_hash('db_password'))
See features/hiera.feature for complete examples.
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)FAQs
Unknown package
We found that puppet-crypt demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.