Skip to content

Instantly share code, notes, and snippets.

View nmattam's full-sized avatar

Nibin Abraham Mattam nmattam

View GitHub Profile
@nmattam
nmattam / script.rb
Created September 19, 2016 22:02 — forked from acharlieh/script.rb
Figuring out that one vagrant vault key wasn't updated
require 'chef-vault'
data = JSON.parse(File.open('data_bags/cerner_splunk/license_secrets_keys.json').read())
keys = (data['clients'] + data['admins']).inject({}) do |m,c|
pem = (c == 'knife_workstation') ? 'fake-key.pem' : "pems/#{c}.pem"
private_key = OpenSSL::PKey::RSA.new(File.open(pem).read())
m[c] = private_key.private_decrypt(Base64.decode64(data[c]))
m
end