coderanger/pychef — pull request #26 by kamilbednarz (2014-01-01 17:52:08+00:00)
Title: Add support for encrypted data bag items

Hello,

I noticed there is no support for interaction with encrypted data bag items so I created one, I hope you will like it.

It's based on the m2crypto package (python wrapper over openssl) - AFAIK it's available as a system package for most of the popular distributions (RedHat - https://access.redhat.com/site/documentation/en-US/Red_Hat_Enterprise_Linux/5/html/5.7_Technical_Notes/m2crypto.html, Ubuntu - http://packages.ubuntu.com/pl/lucid/python-m2crypto) so it should not be a problem to create such a dependency.

The pull request contains some specs, I also tested the interaction with OpsCode's knife and it works just great!

Please notice there is no support for Chef encryption in legacy version 0, since it uses some custom ruby-based keygen implementation for encryption (http://apidock.com/ruby/v1_9_2_180/OpenSSL/Cipher/pkcs5_keyivgen) and I couldn't find a Python equivalent. Version 0 is also deprecated/disabled in Chef 11 according to this article http://docs.opscode.com/chef/essentials_data_bags.html so it shouldn't be a big problem and I guess the feature is still very useful.

Please let me know if you have any questions or concerns.

Best regards from Poland,
Kamil Bednarz

Please let me know if you