Adoptable Cookbooks List

Looking for a cookbook to adopt? You can now see a list of cookbooks available for adoption!
List of Adoptable Cookbooks

Supermarket Belongs to the Community

Supermarket belongs to the community. While Chef has the responsibility to keep it running and be stewards of its functionality, what it does and how it works is driven by the community. The chef/supermarket repository will continue to be where development of the Supermarket application takes place. Come be part of shaping the direction of Supermarket by opening issues and pull requests or by joining us on the Chef Mailing List.

Select Badges

Select Supported Platforms

Select Status

The chef-vault cookbook has been deprecated

Author provided reason for deprecation:

The chef-vault cookbook has been deprecated and is no longer being maintained by its authors. Use of the chef-vault cookbook is no longer recommended.


chef-vault (26) Versions 1.1.2

Installs the chef-vault gem and provides chef_vault_item recipe helper

cookbook 'chef-vault', '= 1.1.2', :supermarket
cookbook 'chef-vault', '= 1.1.2'
knife supermarket install chef-vault
knife supermarket download chef-vault
Quality -%

chef-vault Cookbook

This cookbook is responsible for installing the chef-vault gem and
providing some helper methods to load encrypted data bags that are in
The Vault. It also provides a resource that can be used to store
secrets as a Chef Vault item in a recipe.

Chef Vault is a library by Nordstrom's infrastructure operations team
that helps manage encrypted data bags.


This cookbook should work on any system/platform that is supported by

This cookbook is specifically tested on Ubuntu and CentOS platforms
using Test Kitchen. See .kitchen.yml for platforms and test suites.

Helper Method

This cookbook provides a nice helper method for the Chef Recipe DSL so
you can write:

chef_vault_item("secrets", "dbpassword")

Instead of:

ChefVault::Item.load("secrets", "dbpassword")

This has logic to allow for development and testing of recipes, see
Attributes below.


  • node['chef-vault']['version'] - Specify a version of the chef-vault gem if required. Default is nil, so the latest version will be installed.

The following attribute is special and not specifically related to
this cookbook, but is used in the helper.

  • node['dev_mode'] - If this is true, chef_vault_item will attempt to load the specified item as a regular Data Bag Item with Chef::DataBagItem.load. This is intended to be used only for testing, and not as a fall back to avoid issues loading encrypted items.



The chef_vault_secret resource can be used in recipes to store
secrets in Chef Vault items. Where possible and relevant, this
resource attempts to map behavior and functionality to the knife


The actions generally map to the knife vault sub-commands, with an
exception that create does an update, because the resource enforces
declarative state. To get the knife vault create behavior, use

  • :create - Default action. Creates the item, or updates it if it already exists.
  • :create_if_missing - Calls the create action unless it exists.
  • :delete - Deletes the item and the item's keys ("id"_keys).


  • id - Name attribute. The name of the data bag item.
  • data_bag - Required. The data bag that contains the item.
  • admins - A list of admin users who should have access to the item. Corresponds to the "admin" option when using the chef-vault knife plugin. Can be specified as a comma separated string or an array. See examples, below.
  • clients - A search query for the nodes' API clients that should have access to the item.
  • search - Search query that would match the same used for the clients, gets stored as a field in the item.
  • raw_data - The raw data, as a Ruby Hash, that will be stored in the item. See examples, below.

At least one of admins or clients should be specified, otherwise
nothing will have access to the item.


From the test cookbook embedded in this repository.

chef_vault_secret 'clean-energy' do
  data_bag 'green'
  raw_data({'auth' => 'Forged in a mold'})
  admins 'hydroelectric'
  search '*:*'

Assuming that the green data bag exists, this will create the
clean-energy item as a ChefVault encrypted item, which also creates
clean-energy_keys that has the list of admins, clients, and the
shared secrets. For example, the content looks like this in plaintext:

  "id": "clean-energy",
  "auth": {
    "encrypted_data": "y+l7H4okLu4wisryCaIT+7XeAgomcdgFo3v3p6RKWnXvgvimdzjFGMUfdGId\nq+pP\n",
    "iv": "HLr0uyy9BrieTDmS0TbbmA==\n",
    "version": 1,
    "cipher": "aes-256-cbc"

And the encrypted data decrypted using the specified client:

$ knife vault show green clean-energy -z -u hydroelectric -k clients/hydroelectric.pem
auth: Forged in a mold
id:   clean-energy

Another example, showing multiple admins allowed access to an item
using a comma-separated string, or an array:

chef_vault_secret 'root-password' do
  admins 'jtimberman,paulmooring'
  data_bag 'secrets'
  raw_data({'auth' => 'DontUseThisPasswordForRoot'})
  search '*:*'
chef_vault_secret 'root-password' do
  admins ['jtimberman', 'paulmooring']
  data_bag 'secrets'
  raw_data({'auth' => 'DontUseThisPasswordForRoot'})
  search '*:*'

Internally, the provider will convert the admins array to a
comma-delimited string.

When using the chef_vault_secret resource, the data_bag must exist
first. If it doesn't, you can create it in your recipe with a

  ruby_block "create-data_bag-secrets" do
    block do
      databag ='secrets')
    action :create

Or, use the cheffish gem, which provides resources for Chef objects
(nodes, roles, data bags, etc):

chef_data_bag 'secrets'

Note that there is a bug in versions of cheffish prior to 0.5.beta.3.
Also, cheffish requires the openssl-pkcs8 gem, which has C
extensions, so openssl development headers and C build tools need to
be installed. To use this, you can create a recipe like the one in
the [test cookbook](test/fixtures/cookbooks/test/recipes/chef_vault_secret.rb).


Include the recipe before using the Chef Vault library in recipes.

include_recipe 'chef-vault'
secret_stuff = ChefVault::Item.load("secrets", "a_secret")

Or, use the helper library method:

secret_stuff = chef_vault_item("secrets", "a_secret")

If you need a specific version of the chef-vault RubyGem, then
specify it with the attribute, node['chef-vault']['version'].

To use the chef_vault_secret resource in your cookbooks' recipes,
declare a dependency on this cookbook, and then use the resource as
described in the Examples above.


This repository contains a CONTRIBUTING file that describes the
contribution process for Chef cookbooks.

License and Authors

License:: Apache License, Version 2.0

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
See the License for the specific language governing permissions and
limitations under the License.

Dependent cookbooks

This cookbook has no specified dependencies.

Contingent cookbooks

an_minimart Applicable Versions
askbot Applicable Versions
awscreds Applicable Versions
azure_pipelines_agent_macos Applicable Versions
cerner_splunk Applicable Versions
certificate Applicable Versions
chef-secrets Applicable Versions
chef-splunk Applicable Versions
chef-splunk-windows Applicable Versions
chef_vault_try_notify Applicable Versions
chef_vault_users Applicable Versions
cobbpass Applicable Versions
cockpit Applicable Versions
consul Applicable Versions
database_application Applicable Versions
django_platform Applicable Versions
drone Applicable Versions
duo-unix Applicable Versions
encrypted_blockdevice Applicable Versions
encrypted_volume Applicable Versions
f5-bigip Applicable Versions
file-vault Applicable Versions
ghost Applicable Versions
git_dwk Applicable Versions
gitlab-vault Applicable Versions
hashicorp-vault Applicable Versions
http_platform Applicable Versions
jenkins-server Applicable Versions
jmccann-docker-host Applicable Versions
lxc-web-panel Applicable Versions
mapr Applicable Versions
msodbcsql Applicable Versions
mw_server_base Applicable Versions
nessus Applicable Versions
netrc Applicable Versions
no-ip Applicable Versions
op5_manage Applicable Versions
opendkim-milter Applicable Versions
opsview Applicable Versions
pacemaker Applicable Versions
paramount Applicable Versions
pbis-open Applicable Versions
percona Applicable Versions
postfix-dovecot Applicable Versions
r1337-certmanage Applicable Versions
rancher-ha Applicable Versions
realmd-sssd Applicable Versions
rotate-passwords Applicable Versions
secrets_management Applicable Versions
snipe-it Applicable Versions
snipeit_api Applicable Versions
ssl-key-vault Applicable Versions
ssl-vault Applicable Versions
sssd_ad Applicable Versions
supermarket Applicable Versions
teampass Applicable Versions
uchiwa Applicable Versions
vsts_agent_macos Applicable Versions

No quality metric results found