Skip to content

fiddyspence/puppet-certencryption

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Puppet::Util::Certencryption library to use SSL certs to encrypt/decrypt data

Library to do RSA based encryption for Puppet

There are 4 methods:

  • encrypt(the rsa key, the file)
  • decrypt(the rsa key, the file)
  • encryptstring(the rsa key, the string)
  • decryptstring(the rsa key, the string)

Also included are a parser function (decrypt()) and a fact demonstrating how to pass data around

Sample Puppet code to use an encrypted fact

This example uses the sample encfact fact in the lib/facter directory of this repo:

class foo {
  $foovar = decrypt('/etc/foo/privatekey.pem',$::encfact')
  notify { $foovar: }
}

Sample ruby code

require 'puppet'
require 'puppet/util/certencryption'
a=Puppet::Util::Certencryption.new
moo = a.encryptstring('/etc/puppetlabs/puppet/ssl/private_keys/puppet1.spence.org.uk.local.pem','moo')
puts moo
clear = a.decryptstring('/etc/puppetlabs/puppet/ssl/private_keys/puppet1.spence.org.uk.local.pem',moo)
puts clear

About

Puppet::Util library to do SSL RSA encryption

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published