# Chef-Vault [![Gem Version](https://badge.fury.io/rb/chef-vault.png)](http://badge.fury.io/rb/chef-vault) [![Build Status](https://travis-ci.org/Nordstrom/chef-vault.png?branch=master)](https://travis-ci.org/Nordstrom/chef-vault) [![Code Climate](https://codeclimate.com/github/Nordstrom/chef-vault/badges/gpa.svg)](https://codeclimate.com/github/Nordstrom/chef-vault) ## DESCRIPTION: Gem that allows you to encrypt a Chef Data Bag Item using the public keys of a list of chef nodes. This allows only those chef nodes to decrypt the encrypted values. For a more detailed explanation of how chef-vault works, please refer to the file THEORY.md ## INSTALLATION: Be sure you are running the latest version Chef. Versions earlier than 0.10.0 don't support plugins: gem install chef This plugin is distributed as a Ruby Gem. To install it, run: gem install chef-vault Depending on your system's configuration, you may need to run this command with root privileges. ## KNIFE COMMANDS: See KNIFE_EXAMPLES.md for examples of commands ### knife.rb To set 'client' as the default mode, add the following line to the knife.rb file. ```knife[:vault_mode] = 'client'``` To set the default list of admins for creating and updating vaults, add the following line to the knife.rb file. ```knife[:vault_admins] = [ 'example-alice', 'example-bob', 'example-carol' ]``` (These values can be overridden on the command line by using -A) NOTE: chef-vault 1.0 knife commands are not supported! Please use chef-vault 2.0 commands. ### Vault knife vault create VAULT ITEM VALUES knife vault edit VAULT ITEM knife vault refresh VAULT ITEM knife vault update VAULT ITEM VALUES [--clean] knife vault remove VAULT ITEM VALUES knife vault delete VAULT ITEM knife vault rotate keys VAULT ITEM knife vault rotate all keys knife vault show VAULT ITEM [VALUES] knife vault download VAULT ITEM PATH Global Options:
Short | Long | Description | Default | Valid Values | Sub-Commands |
---|---|---|---|---|---|
-M MODE | --mode MODE | Chef mode to run in. Can be set in knife.rb | solo | "solo", "client" | all |
-S SEARCH | --search SEARCH | Chef Server SOLR Search Of Nodes | nil | create, remove, update | |
-A ADMINS | --admins ADMINS | Chef clients or users to be vault admins, can be comma list | nil | create, remove, update | |
-J FILE | --json FILE | JSON file to be used for values, will be merged with VALUES if VALUES is passed | nil | create, update | |
nil | --file FILE | File that chef-vault should encrypt. It adds "file-content" & "file-name" keys to the vault item | nil | create, update | |
-p DATA | --print DATA | Print extra vault data | nil | "search", "clients", "admins", "all" | show |
-F FORMAT | --format FORMAT | Format for decrypted output | summary | "summary", "json", "yaml", "pp" | show |
nil | --clean | Remove all client keys before re-encrypting with saved or specified search | nil | nil | update |
nil | --clean-unknown-clients | Remove unknown clients during key rotation | nil | nil | remove, rotate |