summaryrefslogtreecommitdiff
path: root/lib/chef/encrypted_data_bag_item.rb
Commit message (Collapse)AuthorAgeFilesLines
* Revert change that removed use of Chef::Config.platform_specific_pathLance Albertson2020-09-151-1/+1
| | | | Signed-off-by: Lance Albertson <lance@osuosl.org>
* move dist implementation into chef-utilsMarc Chamberland2020-09-151-2/+1
| | | | | Signed-off-by: Marc Chamberland <chamberland.marc@gmail.com> Signed-off-by: Lance Albertson <lance@osuosl.org>
* use autoloading for many required gemsmwrock2020-09-081-2/+2
| | | | Signed-off-by: mwrock <matt@mattwrock.com>
* Bump deps and resolve new Chefstyle warningsTim Smith2020-08-251-1/+1
| | | | Signed-off-by: Tim Smith <tsmith@chef.io>
* Remove copyright dateslcg/remove-copyright-datesLamont Granquist2020-04-131-1/+1
| | | | | | | | Legally incredibly dubious, particularly since we don't follow it strictly as policy, and we have git history instead, which does it right. This is just a waste of time and a cargo cult. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Style/StringLiteralsInInterpolationLamont Granquist2019-07-051-1/+1
| | | | | | since we use double quotes, be consistent everywhere. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Style/RegexpLiteralLamont Granquist2019-07-051-1/+1
| | | | | | | given how many regexps we have with /'s in the match this seems like a very good one. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Style/NegatedIfLamont Granquist2019-07-051-2/+2
| | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* fix Layout/EmptyLineAfterGuardClauseLamont Granquist2019-07-021-0/+3
| | | | | | | i like this one, gives visual priority to returns or raises that are buried in the middle of things. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* more distro constantsMarc Chamberland2019-06-031-1/+2
| | | | Signed-off-by: Marc Chamberland <mchamberland@pbsc.com>
* Convert require to require_relativeLamont Granquist2019-05-081-4/+4
| | | | | | | This gives a speed boost since rubygems does not have to scan through every gem in the gemset in order to find the file. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* replace some instances of to_hash with to_hlcg/to-h-cleanupLamont Granquist2018-09-261-2/+4
| | | | | | | | | | | to_hash on a lot of these objects should go away, but even eliminating all our calls to to_hash on these objects internally is difficult. (e.g. converting the knife ui code to call #to_h means we wind up calling nil#to_h which "helpfully" becomes '{}' which is hilarious and i don't know why someone thought that was a good idea). Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* fix Style/MutableConstantLamont Granquist2018-07-021-2/+2
| | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* fix specs: RedundantReturn, RedundantSelf, RedundantBeginLamont Granquist2017-02-131-2/+2
| | | | | | department of redundancy department Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* fix Style/SelfAssignmentLamont Granquist2016-12-061-1/+1
| | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* autofixing whitespace copsLamont Granquist2016-02-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | 4174 Style/SpaceInsideHashLiteralBraces 1860 Style/SpaceAroundOperators 1336 Style/SpaceInsideBlockBraces 1292 Style/AlignHash 997 Style/SpaceAfterComma 860 Style/SpaceAroundEqualsInParameterDefault 310 Style/EmptyLines 294 Style/IndentationConsistency 267 Style/TrailingWhitespace 238 Style/ExtraSpacing 212 Style/SpaceBeforeBlockBraces 166 Style/MultilineOperationIndentation 144 Style/TrailingBlankLines 120 Style/EmptyLineBetweenDefs 101 Style/IndentationWidth 82 Style/SpaceAroundBlockParameters 40 Style/EmptyLinesAroundMethodBody 29 Style/EmptyLinesAroundAccessModifier 1 Style/RescueEnsureAlignment
* Update all auth email address from opscode.com and getchef.com to chef.io.Noah Kantrowitz2016-02-021-1/+1
| | | Generated via git ls-files | xargs perl -pi -e "s/(Author.*?<[^@]+@)(?:opscode\\.com|getchef\\.com)(>)/\\1chef.io\\2/gi"
* Replace all Opscode copyrights with Chef Software.Noah Kantrowitz2016-02-021-1/+1
| | | Created via git ls-files | xargs perl -pi -e "s/(Copyright.*?), Opscode(,)? Inc(\.)?/\\1, Chef Software Inc./gi"
* Copyright year update for 2016 and massive cleanup.Noah Kantrowitz2016-02-021-1/+1
| | | Generated via git ls-files | xargs perl -pi -e "s/[Cc]opyright (?:\([Cc]\) )?((?\!$(date +%Y))\\d{4})(-\\d{4})?([, ][ \d]+)*(,|(?= ))/Copyright \\1-$(date +%Y),/g"
* Use double quotes by defaultThom May2016-01-141-7/+7
| | | | | | | This is an entirely mechanically generated (chefstyle -a) change, to go along with chef/chefstyle#5 . We should pick something and use it consistently, and my opinion is that double quotes are the appropriate thing.
* Enable autodetection of encrypted data bag items.Claire McQuin2014-08-221-1/+1
|
* [CHEF-5356-gcm] Chef::EncryptedDataBagItem Version3 implementation using GCMXabier de Zuazo2014-07-011-0/+1
|
* Fix few typonishigori2014-03-261-1/+1
|
* Add documentation for Chef::EncryptedDataBag.loadSeth Vargo2014-03-141-0/+36
|
* CHEF-4441: emit reasonable error message when there is no default data bag ↵John Keiser2013-12-031-0/+3
| | | | secret
* Split EncryptedDataBagItem into multiple filesJohn Keiser2013-12-031-303/+3
|
* [CHEF-3615] Make encrypted data bag format configurabledanielsdeleo2013-04-301-2/+27
| | | | | | | | | * Add an option to configure the version used when encrypting data bag items. This allows users to opt-in to newer encrypted data bag formats while the default remains compatible with earlier chef versions. * Add an option to set a minimum valid encrypted data bag item format. This is useful on the client so that, for example, a MITM attacker cannot downgrade a v2 EDBI to v1.
* [CHEF-3615] version 2 encryptor/decryptor for EDBIsdanielsdeleo2013-04-301-86/+121
| | | | | | | | | | | | | | | | Authenticated encryption data bag items will be version 2 of the encrypted data bag item format instead of tacked on to the version 1 format. Authenticated encryption via OpenSSL cipher was considered, but older openssl versions do not have, e.g., aes-256-gcm, so we are implementing encrypt-then-mac with hmac-sha256 on top of existing aes cipher. Code passes tests but is not yet exposed in configuration. TODO: * Allow user to set desired version for encrypt. * Allow user to set minimum required version for decrypt. Without this change, a MITM could simply change the format version to 1 to bypass the hmac.
* [CHEF-3858] ensure invalid key always fails to decryptdanielsdeleo2013-04-301-1/+29
| | | | | | | | | | In Ci, we occasionally see test failures when decryption with an incorrect key does not raise an error, but instead returns garbage. This fixes that issue by adding an HMAC-SHA2-256 of the encrypted data to the version 1 format. For backwards compatibility, decryption will continue if the hmac is missing; therefore, this does not increase the security of encrypted data bag items.
* [CHEF-3858] rescue bad json errors and re-raise as decryption failuresdanielsdeleo2013-04-261-0/+5
|
* [CHEF-4011] move default secret file path to Chef::ConfigSeth Chisamore2013-04-111-2/+1
| | | | | | | | | | * Remove references to DEFAULT_SECRET_FILE from `Chef::EncryptedDataBagItem`. * Add new `:encrypted_data_bag_secret` value to `Chef::Config` * Ensure Chef::Config[:encrypted_data_bag_secret] is nil if the secret does not exist at the default path. * Updated test coverage in `config_spec` and `encrypted_data_bag_item_spec`.
* prefer `File.exist?` to `File.exists?`Seth Chisamore2013-04-111-1/+1
| | | | File.exists? was deprecated in Ruby 1.9
* [CHEF-3616] add cipher field to edbi metadatadanielsdeleo2012-11-161-1/+16
| | | | | | Adds "cipher" to the metadata fields for encrypted data bag items. This enables user-configurable ciphers in the future. Cipher is still hard-coded to aes-256-cbc for now.
* [CHEF-3392] fix ruby 1.8 detection of version 1 formatdanielsdeleo2012-11-151-1/+1
|
* [CHEF-3392] remove unused `from_plain_hash` methoddanielsdeleo2012-11-151-4/+0
|
* [CHEF-3392] use yajl to avoid custom class inflationdanielsdeleo2012-11-151-2/+3
|
* [CHEF-3392] JSON serialize encrypted data bags, use random IVdanielsdeleo2012-11-141-21/+193
| | | | | | | * Use JSON instead of YAML to serialize encrypted data bag values before encrypting. * Use a random IV for each encrypted value for resilience against some types of crypto attacks. Fixes CHEF-3480.
* [OC-3564] move core Chef to the repo root \o/ \m/Seth Chisamore2012-10-301-0/+139
The opscode/chef repository now only contains the core Chef library code used by chef-client, knife and chef-solo!