On Friday, November 8, 2013 at 1:44 PM, Clif Smith wrote:
I support numerous applications and am wanting to store the credentials to those apps in data bags and then search for them within cookbooks using the application and environment so I can reuse the recipe. For example, for app1 in the production environment I’d have the following data bag item in the users data bag:
While I’m able to search for it without decrypting:chef > app_creds = search(:users, "app1:* AND production:*")=> [data_bag_item["users", "app1up", {"id"=>"app1up", "app1"=>{"encrypted_data"=>"OhQVqYCC+4wFXXyy1HL7dHqJUtdQGpl3TLJWgC2FWCg=\n", "iv"=>"3WZrbIjQNRkuW3wr7yjfuA==\n", "version"=>1, "cipher"=>"aes-256-cbc"}, "production"=>{"encrypted_data"=>"r2tqUuPP6wFtX44tOwkURhRHuKP5vggUvgPXJrO42uQ=\n", "iv"=>"FyA0plsx6+5EowuNdkiMZw==\n", "version"=>1, "cipher"=>"aes-256-cbc"}, "password"=>{"encrypted_data"=>"6OZzWcDCdVAUSGhcdZhM8Gzd/OuvoweiMzeeGyHEczI=\n", "iv"=>"pkX1LAVWNeukHbEmzzNTpw==\n", "version"=>1, "cipher"=>"aes-256-cbc"}}]]I’m unable to search and decrypt it:chef > app_creds = Chef::EncryptedDataBagItem.load(:users, "app1:* AND production:*")
Archive powered by MHonArc 2.6.16.