# Encrypted Data Bags - Multiple Secrets?

**URL:** <https://discourse.chef.io/t/encrypted-data-bags-multiple-secrets/10271>\
**Category:** Chef Infra (archive)\
**Created:** [January 23, 2017, 2:04pm UTC](https://discourse.chef.io/t/encrypted-data-bags-multiple-secrets/10271 "2017-01-23T14:04:26Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alexander\_Skwar](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/alexander_skwar/32/1205_2.png) [@Alexander\_Skwar](https://discourse.chef.io/u/Alexander_Skwar)\
**Post date:** [January 23, 2017, 2:04pm UTC](https://discourse.chef.io/t/encrypted-data-bags-multiple-secrets/10271/1 "2017-01-23T14:04:26Z")

</div>

Hi

(Using chef zero 12.3.0 on Ubuntu 16.04.)

With encrypted data bags, every data bag item might be encrypted with a different secret. Okay.

The [data bags documentation](https://docs.chef.io/data_bags.html#load-with-recipe-dsl) and also the source code of [encrypted\_data\_bag\_item.rb](https://github.com/chef/chef/blob/master/lib/chef/encrypted_data_bag_item.rb) show only one configuration parameter for the secret:

```
# If the shared secret is not specified at initialization or load,
# then the contents of the file referred to in
# Chef::Config[:encrypted_data_bag_secret] will be used as the
# secret. The default path is /etc/chef/encrypted_data_bag_secret

```

Do you guys actually use multiple secrets on one chef node? If so, how do you actually use it? I mean, how and where do you store the secrets? Something like this?

```ruby
Chef::Config[:encrypted_data_bag_secret] + ".d/secret-name1"
Chef::Config[:encrypted_data_bag_secret] + ".d/secret-name2"
…
Chef::Config[:encrypted_data_bag_secret] + ".d/secret-nameN"

```

Cheers,  
Alexander
