SlideShare a Scribd company logo
1 of 112
Download to read offline
Chef Vault: A Deep Dive
Nell Shamrell-Harrington
@nellshamrell
Chef Conf 2017
What do I do when I need
to share static information
among my nodes?
Chef Vault: A Deep Dive @nellshamrell
App Node 1 App Node 2
Chef Vault: A Deep Dive @nellshamrell
Database
App Node 1 App Node 2
Chef Vault: A Deep Dive @nellshamrell
Load Balancer
Database
App Node 1 App Node 2
Chef Vault: A Deep Dive @nellshamrell
Load Balancer
Database
App Node 1 App Node 2
Chef Vault: A Deep Dive @nellshamrell
Load Balancer
Database
App Node 1 App Node 2App Node 3
Use a data bag!
What if that information
needs to be encrypted?
It’s a little more
complicated…
Secrets management systems
must find a balance between
security and usability
Preventing unauthorized
access is only half of
managing security
Security must also enable
authorized users to access
what they need when
they need it
A system that is secure
but unusable is
inherently insecure
When choosing a secret
management tool, you
must understand…
1. Your own environment
1. Your own environment
2. The capabilities and
limits of the tool
No tool is one 

size fits all.
We will focus on Chef
Vault, but we will also
explore alternatives
Chef Vault: A Deep Dive @nellshamrell
• Sr. Software Engineer at Chef
• Core maintainer of Supermarket and Habitat
• Co-host of Foodfight Podcast
• @nellshamrell
• nshamrell@chef.io
Nell Shamrell-Harrington
Encrypted Data bags
Chef Vault: A Deep Dive @nellshamrell
Load Balancer
Database
App Node 1 App Node 2App Node 3
Chef Vault: A Deep Dive @nellshamrell
Encrypted Data bags
$ cat my_item.json
{“db_password”:“some_password”}
Workstation
JSON file with data
Chef Vault: A Deep Dive @nellshamrell
$ openssl rand -base64 512 | tr -d 'rn' > my_key
Workstation
Generates a key
Encrypted Data bags
Chef Vault: A Deep Dive @nellshamrell
$
Workstation
my_key
Encrypted Data bags
Chef Vault: A Deep Dive @nellshamrell
my_databag
$ knife data bag from file my_databag my_item.json
Workstation
my_key
my_item_info
my_item
Creates data bag
Encrypted Data bags
Chef Vault: A Deep Dive @nellshamrell
$ knife data bag from file my_databag my_item.json
--secret-file /path/to/my_key
Workstation
my_key
my_databag
my_item
my_key
Encrypted Data bags
Key to
encrypt
data bag
Chef Vault: A Deep Dive @nellshamrell
$
my_key
Workstation
my_key
my_databag
my_item
Encrypted Data bags
Chef Vault: A Deep Dive @nellshamrell
$ knife data bag show my_databage my_item
—secret-file /path/to/my_key
Workstation
my_key
my_key
my_databag
my_item
Encrypted Data bags
Shows data bag
Chef Vault: A Deep Dive @nellshamrell
$ knife data bag show my_databage my_item
—secret-file /path/to/my_key
Workstation
my_key
my_key
my_databag
my_item
Encrypted Data bags
Key to
decrypt
data bag
Chef Vault: A Deep Dive @nellshamrell
Workstation
my_key
my_databag
my_item
my_item_info
$ knife data bag show my_databage my_item
—secret-file /path/to/my_key
Encrypted Data bags
Chef Vault: A Deep Dive @nellshamrell
workstation_1 workstation_2 workstation_3
my_databag
my_item
Encrypted Data bags
Chef Vault: A Deep Dive @nellshamrell
workstation_1 workstation_2 workstation_3
my_key my_key my_key
my_databag
my_item
Encrypted Data bags
Chef Vault: A Deep Dive @nellshamrell
workstation_1 workstation_2 workstation_3
my_key my_key my_key
node_1
my_key
node_2
my_key
node_3
my_key
my_databag
my_item
Encrypted Data bags
Chef Vault: A Deep Dive @nellshamrell
• Limited by need to distribute and
share a key
Encrypted Data bags
Chef Vault: A Deep Dive @nellshamrell
• Limited by need to distribute and
share a key
• What if someone leaves?
Encrypted Data bags
Chef Vault: A Deep Dive @nellshamrell
• Limited by need to distribute and share
a key
• What if someone leaves?
• If the key is compromised on one
node/workstation, data is compromised
for all nodes/workstations
Encrypted Data bags
Key rotation is hard…
…but it’s not impossible
Chef Vault is one
approach to solving
this problem
Chef Vault: A Deep Dive @nellshamrell
• Originally created by Nordstrom Chefs!
Chef Vault
Chef Vault: A Deep Dive @nellshamrell
• Originally created by Nordstrom Chefs!
• Ownership transferred to Chef in 2015
Chef Vault
Chef Vault: A Deep Dive @nellshamrell
• Originally created by Nordstrom Chefs!
• Ownership transferred to Chef in 2015
• Completely open source
• https://github.com/chef/chef-vault
Chef Vault
Chef Vault: A Deep Dive @nellshamrell
Chef Vault
Chef Server
Chef Vault: A Deep Dive @nellshamrell
Chef Server
node_2
node_1
Chef Vault
Chef Vault: A Deep Dive @nellshamrell
Chef Server
node_1
node_2
node_1_client
node_2_client
Chef Vault
Chef Vault: A Deep Dive @nellshamrell
Chef Server
node_1
node_2
key_1
key_2
Chef Vault
node_1_client
node_2_client
Chef Vault: A Deep Dive @nellshamrell
Chef Server
node_1
node_2
key_1.pub
key_2.pub
key_1
key_2
Chef Vault
node_1_client
node_2_client
Chef Vault: A Deep Dive @nellshamrell
Chef Server
user_1
user_2
Chef Vault
Chef Vault: A Deep Dive @nellshamrell
Chef Server
user_1
user_2
user_1
user_2
Chef Vault
Chef Vault: A Deep Dive @nellshamrell
Chef Server
user_1
user_2
user_1
user_2
key_3
key_4
Chef Vault
Chef Vault: A Deep Dive @nellshamrell
Chef Server
user_1
user_2
user_1
user_2
key_3.pub
key_4.pub
key_3
key_4
Chef Vault
Chef Vault: A Deep Dive @nellshamrell
my_vault
my_item
Chef Vault
Chef Vault: A Deep Dive @nellshamrell
my_vault
my_item
shared_key
Chef Vault
Chef Vault: A Deep Dive @nellshamrell
my_vault
my_item
user_1 node_1
shared_key
Chef Vault
Chef Vault: A Deep Dive @nellshamrell
my_vault
my_item
user_1
key_3
node_1
key_1
shared_key
Chef Vault
Chef Vault: A Deep Dive @nellshamrell
my_vault
my_item
user_1
key_3
node_1
shared_key
copy
shared_key
copy
key_1
shared_key
Chef Vault
Chef Vault: A Deep Dive @nellshamrell
my_vault
my_item
user_1
key_3
node_1
shared_key
copy
shared_key
copy
key_1key_3
key_1
shared_key
Chef Vault
Chef Vault: A Deep Dive @nellshamrell
my_vault
my_item
user_1
key_3
node_1
shared_key
copy
shared_key
copy
key_1
key_1
shared_key
Decrypts
Chef Vault
Chef Vault: A Deep Dive @nellshamrell
my_vault
my_item
user_1
key_3
node_1
shared_key
copy
shared_key
copy
key_1
key_1
Chef Vault
Decrypts
Chef Vault: A Deep Dive @nellshamrell
my_vault
my_item
user_1
key_3
node_1
shared_key
copy
shared_key
copy
key_1
Chef Vault
Decrypts
Chef Vault: A Deep Dive @nellshamrell
my_vault
my_item
user_1
key_3
node_1
shared_key
copy
shared_key
copy
key_1
Chef Vault
Decrypts
Chef Vault uses layers of
encryption to balance
security and usability
Chef Vault: A Deep Dive @nellshamrell
Chef Server
node_1
node_2
user_1
user_2
Chef Vault
Chef Vault: A Deep Dive @nellshamrell
Creating a Vault
Workstation
$ gem install chef-vault
Installs Chef Vault
Chef Vault: A Deep Dive @nellshamrell
Creating a Vault
Workstation
$ knife vault create my_vault my_item
Creates vault
Chef Vault: A Deep Dive @nellshamrell
Creating a Vault
$ knife vault create my_vault my_item
-A “user_1,user_2”
Workstation
Users with access to vault
Chef Vault: A Deep Dive @nellshamrell
Creating a Vault
$ knife vault create my_vault my_item
-A “user_1,user_2,node_1,node_2”
Workstation
Nodes with access to vault
Chef Vault: A Deep Dive @nellshamrell
Creating a Vault
$ knife vault create my_vault my_item
-A “user_1,user_2,node_1,node_2” -M client
Workstation
Mode (client or solo)
Chef Vault: A Deep Dive @nellshamrell
Creating a Vault
$ knife vault create my_vault my_item
-A “user_1,user_2,node_1,node_2” -M client -J ./
my_item.json
Workstation
File with data
Chef Vault: A Deep Dive @nellshamrell
Creating a Vault
Workstation
my_vault
my_item
$ knife vault create my_vault my_item
-A “user_1,user_2,node_1,node_2” -M client -J ./
my_item.json
Chef Vault: A Deep Dive @nellshamrell
Creating a Vault
Workstation
my_vault
my_item my_item_keys
Authorized keys
$ knife vault create my_vault my_item
-A “user_1,user_2,node_1,node_2” -M client -J ./
my_item.json
Chef Vault: A Deep Dive @nellshamrell
Creating a Vault
$ knife vault show my_vault my_item
Workstation
my_vault
my_item my_item_keys
Shows vault
Chef Vault: A Deep Dive @nellshamrell
Viewing a Vault
$ knife vault show my_vault my_item
db_password: some_password
id: my_item
Workstation
Chef Vault: A Deep Dive @nellshamrell
Viewing a Vault
$ knife vault show my_vault my_item
db_password:
cipher: aes-256-cbc
encrypted_data:
dsiBtNHX8Sbis42yKuYBvbdNXPpu8bQfJrS20op7zoys
fR8roFlzp
VHyoaG2
4yb3
Unauthorized Workstation
Using Chef Vault
Chef Vault: A Deep Dive @nellshamrell
Using a Vault in a Recipe
metadata.rb
gem ‘chef-vault’
Chef Vault: A Deep Dive @nellshamrell
Using a Vault in a Recipe
recipe.rb
chef_gem ‘chef-vault’ do
compile_time true if respond_to?(:compile_time)
end
Chef Vault: A Deep Dive @nellshamrell
Using a Vault in a Recipe
chef_gem ‘chef-vault’ do
compile_time true if respond_to?(:compile_time)
end
require ‘chef-vault’
recipe.rb
Chef Vault: A Deep Dive @nellshamrell
Using a Vault in a Recipe
chef_gem ‘chef-vault’ do
compile_time true if respond_to?(:compile_time)
end
require ‘chef-vault’
vault = chef_vault_item(“my_vault”, “my_item”)
recipe.rb
Chef Vault: A Deep Dive @nellshamrell
Using a Vault in a Recipe
chef_gem ‘chef-vault’ do
compile_time true if respond_to?(:compile_time)
end
require ‘chef-vault’
vault = chef_vault_item(“my_vault”, “my_item”)
node.set[‘database’][‘password’] = vault[‘password’]
recipe.rb
Maintaining a Chef Vault
Chef Vault: A Deep Dive @nellshamrell
Editing a Vault
$ knife vault edit my_vault my_item
Workstation
my_vault
my_item my_item_keys
Edits vault
Chef Vault: A Deep Dive @nellshamrell
Adding a User or Node
$ knife vault update my_vault my_keys -A “new-
username”
Workstation
my_vault
my_item my_item_keys
Adds user/node
Chef Vault: A Deep Dive @nellshamrell
Removing a User or Node
$ knife vault remove my_vault my_item -A
“some_user”
Workstation
my_vault
my_item my_item_keys
Remove user/node
Chef Vault: A Deep Dive @nellshamrell
Refreshing Keys
$ knife vault refresh my_vault my_item
Workstation
my_vault
my_item my_item_keys
Refresh user/node keys
Chef Vault: A Deep Dive @nellshamrell
Destroying a Vault
$ knife vault delete my_vault my_item
Workstation
my_vault
my_item my_item_keys
Destroys vault item
Chef Vault: A Deep Dive @nellshamrell
Destroying a Vault
$ knife vault delete my_vault my_item
Workstation
my_vault
Chef Vault: A Deep Dive @nellshamrell
Destroying a Vault
$ knife data bag delete my_vault
Workstation
my_vault
Destroys vault
Chef Vault: A Deep Dive @nellshamrell
Destroying a Vault
$ knife data bag delete my_vault
Workstation
Real Life Example:
Supermarket
Chef Vault: A Deep Dive @nellshamrell
Load Balancer
Postgres
DB
App Node App Node App Node
Redis
Cache
Supermarket Production
Chef Vault: A Deep Dive @nellshamrell
Load Balancer
Postgres
DB
App Node App Node App Node
Redis
Cache
Supermarket Staging
Chef Vault: A Deep Dive @nellshamrell
apps
Chef Vault: A Deep Dive @nellshamrell
apps
supermarket_staging
supermarket_prod
Chef Vault: A Deep Dive @nellshamrell
apps
supermarket_staging
supermarket_prod
supermarket_staging_keys
supermarket_prod_keys
Limits of Chef Vault
Chef Vault: A Deep Dive @nellshamrell
• Adding new nodes requires human
intervention
• Not compatible with autoscaling
groups
Chef Vault
Chef Vault: A Deep Dive @nellshamrell
• Adding new nodes requires human
intervention
• Not compatible with autoscaling groups
• Could theoretically have one node
keep all keys and distribute those - but
that is a major security risk
Chef Vault
Chef Vault: A Deep Dive @nellshamrell
• No audit logs of access
Chef Vault
Chef Vault Alternatives
Chef Vault: A Deep Dive @nellshamrell
• Alternatives
• Hashicorp Vault (https://
www.vaultproject.io)
Chef Vault
Chef Vault: A Deep Dive @nellshamrell
• Alternatives
• Hashicorp Vault (https://
www.vaultproject.io)
• Citadel (https://github.com/poise/
citadel)
Chef Vault
Which tool is best?
It depends on your
needs…
Chef Vault: A Deep Dive @nellshamrell
• Where is your infrastructure?
(Citadel is AWS only)
Considerations
Chef Vault: A Deep Dive @nellshamrell
• Where is your infrastructure? (Citadel
is AWS only)
• Do you need autoscaling groups?
(Chef Vault is not a good fit)
Considerations
Chef Vault: A Deep Dive @nellshamrell
• Where is your infrastructure? (Citadel
is AWS only)
• Do you need autoscaling groups?
(Chef Vault is not a good fit)
• Do you want dynamic secrets?
(Hashicorp vault is your best bet)
Considerations
Key rotation is hard…
…but it’s not impossible
Encrypted information systems
must find a balance between
security and accessibility
Chef Vault: A Deep Dive @nellshamrell
• Sr. Software Engineer at Chef
• Core maintainer of Supermarket and Habitat
• Co-host of Foodfight Podcast
• @nellshamrell
• nshamrell@chef.io
Nell Shamrell-Harrington

More Related Content

Similar to Chef Vault: A Deep Dive on Securing Secrets in Chef Infra

Introduction to devsecdotio
Introduction to devsecdotioIntroduction to devsecdotio
Introduction to devsecdotioBram Vogelaar
 
The Null Object Pattern
The Null Object PatternThe Null Object Pattern
The Null Object Patternmodern_legend
 
A tale of application development
A tale of application developmentA tale of application development
A tale of application developmentNicolas Corrarello
 
Keep it Secret, Keep it Safe - Docker Secrets and DI
Keep it Secret, Keep it Safe - Docker Secrets and DIKeep it Secret, Keep it Safe - Docker Secrets and DI
Keep it Secret, Keep it Safe - Docker Secrets and DIDana Luther
 
Extending kubernetes with CustomResourceDefinitions
Extending kubernetes with CustomResourceDefinitionsExtending kubernetes with CustomResourceDefinitions
Extending kubernetes with CustomResourceDefinitionsStefan Schimanski
 

Similar to Chef Vault: A Deep Dive on Securing Secrets in Chef Infra (7)

Chef advance
Chef advanceChef advance
Chef advance
 
Chef advance
Chef advanceChef advance
Chef advance
 
Introduction to devsecdotio
Introduction to devsecdotioIntroduction to devsecdotio
Introduction to devsecdotio
 
The Null Object Pattern
The Null Object PatternThe Null Object Pattern
The Null Object Pattern
 
A tale of application development
A tale of application developmentA tale of application development
A tale of application development
 
Keep it Secret, Keep it Safe - Docker Secrets and DI
Keep it Secret, Keep it Safe - Docker Secrets and DIKeep it Secret, Keep it Safe - Docker Secrets and DI
Keep it Secret, Keep it Safe - Docker Secrets and DI
 
Extending kubernetes with CustomResourceDefinitions
Extending kubernetes with CustomResourceDefinitionsExtending kubernetes with CustomResourceDefinitions
Extending kubernetes with CustomResourceDefinitions
 

More from Nell Shamrell-Harrington

This Week in Rust: 400 Issues and Counting!
This Week in Rust: 400 Issues and Counting!This Week in Rust: 400 Issues and Counting!
This Week in Rust: 400 Issues and Counting!Nell Shamrell-Harrington
 
Higher. Faster. Stronger. Your Applications with Habitat
Higher. Faster. Stronger. Your Applications with HabitatHigher. Faster. Stronger. Your Applications with Habitat
Higher. Faster. Stronger. Your Applications with HabitatNell Shamrell-Harrington
 
Containers, Virtual Machines, and Bare Metal, Oh My!
Containers, Virtual Machines, and Bare Metal, Oh My!Containers, Virtual Machines, and Bare Metal, Oh My!
Containers, Virtual Machines, and Bare Metal, Oh My!Nell Shamrell-Harrington
 
Creating Packages that Run Anywhere with Chef Habitat
Creating Packages that Run Anywhere with Chef HabitatCreating Packages that Run Anywhere with Chef Habitat
Creating Packages that Run Anywhere with Chef HabitatNell Shamrell-Harrington
 
First Do No Harm: Surgical Refactoring (extended edition)
First Do No Harm: Surgical Refactoring (extended edition)First Do No Harm: Surgical Refactoring (extended edition)
First Do No Harm: Surgical Refactoring (extended edition)Nell Shamrell-Harrington
 
A Supermarket of Your Own: Running a Private Chef Supermarket
A Supermarket of Your Own: Running a Private Chef SupermarketA Supermarket of Your Own: Running a Private Chef Supermarket
A Supermarket of Your Own: Running a Private Chef SupermarketNell Shamrell-Harrington
 

More from Nell Shamrell-Harrington (20)

This Week in Rust: 400 Issues and Counting!
This Week in Rust: 400 Issues and Counting!This Week in Rust: 400 Issues and Counting!
This Week in Rust: 400 Issues and Counting!
 
The Rust Borrow Checker
The Rust Borrow CheckerThe Rust Borrow Checker
The Rust Borrow Checker
 
Higher. Faster. Stronger. Your Applications with Habitat
Higher. Faster. Stronger. Your Applications with HabitatHigher. Faster. Stronger. Your Applications with Habitat
Higher. Faster. Stronger. Your Applications with Habitat
 
Habitat Service Discovery
Habitat Service DiscoveryHabitat Service Discovery
Habitat Service Discovery
 
Web Operations101
Web Operations101Web Operations101
Web Operations101
 
Rust Traits And You: A Deep Dive
Rust Traits And You: A Deep DiveRust Traits And You: A Deep Dive
Rust Traits And You: A Deep Dive
 
Rust, Redis, and Protobuf - Oh My!
Rust, Redis, and Protobuf - Oh My!Rust, Redis, and Protobuf - Oh My!
Rust, Redis, and Protobuf - Oh My!
 
Containers, Virtual Machines, and Bare Metal, Oh My!
Containers, Virtual Machines, and Bare Metal, Oh My!Containers, Virtual Machines, and Bare Metal, Oh My!
Containers, Virtual Machines, and Bare Metal, Oh My!
 
Open Source Governance 101
Open Source Governance 101Open Source Governance 101
Open Source Governance 101
 
DevOps in Politics
DevOps in PoliticsDevOps in Politics
DevOps in Politics
 
Open Source Governance - The Hard Parts
Open Source Governance - The Hard PartsOpen Source Governance - The Hard Parts
Open Source Governance - The Hard Parts
 
Creating Packages that Run Anywhere with Chef Habitat
Creating Packages that Run Anywhere with Chef HabitatCreating Packages that Run Anywhere with Chef Habitat
Creating Packages that Run Anywhere with Chef Habitat
 
Refactoring terraform
Refactoring terraformRefactoring terraform
Refactoring terraform
 
Refactoring Infrastructure Code
Refactoring Infrastructure CodeRefactoring Infrastructure Code
Refactoring Infrastructure Code
 
Devops: A History
Devops: A HistoryDevops: A History
Devops: A History
 
First Do No Harm: Surgical Refactoring (extended edition)
First Do No Harm: Surgical Refactoring (extended edition)First Do No Harm: Surgical Refactoring (extended edition)
First Do No Harm: Surgical Refactoring (extended edition)
 
First Do No Harm: Surgical Refactoring
First Do No Harm: Surgical RefactoringFirst Do No Harm: Surgical Refactoring
First Do No Harm: Surgical Refactoring
 
A Supermarket of Your Own: Running a Private Chef Supermarket
A Supermarket of Your Own: Running a Private Chef SupermarketA Supermarket of Your Own: Running a Private Chef Supermarket
A Supermarket of Your Own: Running a Private Chef Supermarket
 
Public Supermarket: The Insider's Tour
Public Supermarket: The Insider's TourPublic Supermarket: The Insider's Tour
Public Supermarket: The Insider's Tour
 
Beneath the Surface - Rubyconf 2013
Beneath the Surface - Rubyconf 2013Beneath the Surface - Rubyconf 2013
Beneath the Surface - Rubyconf 2013
 

Recently uploaded

Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 

Recently uploaded (20)

Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 

Chef Vault: A Deep Dive on Securing Secrets in Chef Infra

  • 1. Chef Vault: A Deep Dive Nell Shamrell-Harrington @nellshamrell Chef Conf 2017
  • 2. What do I do when I need to share static information among my nodes?
  • 3. Chef Vault: A Deep Dive @nellshamrell App Node 1 App Node 2
  • 4. Chef Vault: A Deep Dive @nellshamrell Database App Node 1 App Node 2
  • 5. Chef Vault: A Deep Dive @nellshamrell Load Balancer Database App Node 1 App Node 2
  • 6. Chef Vault: A Deep Dive @nellshamrell Load Balancer Database App Node 1 App Node 2
  • 7. Chef Vault: A Deep Dive @nellshamrell Load Balancer Database App Node 1 App Node 2App Node 3
  • 8. Use a data bag!
  • 9. What if that information needs to be encrypted?
  • 10. It’s a little more complicated…
  • 11. Secrets management systems must find a balance between security and usability
  • 12. Preventing unauthorized access is only half of managing security
  • 13. Security must also enable authorized users to access what they need when they need it
  • 14. A system that is secure but unusable is inherently insecure
  • 15. When choosing a secret management tool, you must understand…
  • 16. 1. Your own environment
  • 17. 1. Your own environment 2. The capabilities and limits of the tool
  • 18. No tool is one 
 size fits all.
  • 19. We will focus on Chef Vault, but we will also explore alternatives
  • 20. Chef Vault: A Deep Dive @nellshamrell • Sr. Software Engineer at Chef • Core maintainer of Supermarket and Habitat • Co-host of Foodfight Podcast • @nellshamrell • nshamrell@chef.io Nell Shamrell-Harrington
  • 22. Chef Vault: A Deep Dive @nellshamrell Load Balancer Database App Node 1 App Node 2App Node 3
  • 23. Chef Vault: A Deep Dive @nellshamrell Encrypted Data bags $ cat my_item.json {“db_password”:“some_password”} Workstation JSON file with data
  • 24. Chef Vault: A Deep Dive @nellshamrell $ openssl rand -base64 512 | tr -d 'rn' > my_key Workstation Generates a key Encrypted Data bags
  • 25. Chef Vault: A Deep Dive @nellshamrell $ Workstation my_key Encrypted Data bags
  • 26. Chef Vault: A Deep Dive @nellshamrell my_databag $ knife data bag from file my_databag my_item.json Workstation my_key my_item_info my_item Creates data bag Encrypted Data bags
  • 27. Chef Vault: A Deep Dive @nellshamrell $ knife data bag from file my_databag my_item.json --secret-file /path/to/my_key Workstation my_key my_databag my_item my_key Encrypted Data bags Key to encrypt data bag
  • 28. Chef Vault: A Deep Dive @nellshamrell $ my_key Workstation my_key my_databag my_item Encrypted Data bags
  • 29. Chef Vault: A Deep Dive @nellshamrell $ knife data bag show my_databage my_item —secret-file /path/to/my_key Workstation my_key my_key my_databag my_item Encrypted Data bags Shows data bag
  • 30. Chef Vault: A Deep Dive @nellshamrell $ knife data bag show my_databage my_item —secret-file /path/to/my_key Workstation my_key my_key my_databag my_item Encrypted Data bags Key to decrypt data bag
  • 31. Chef Vault: A Deep Dive @nellshamrell Workstation my_key my_databag my_item my_item_info $ knife data bag show my_databage my_item —secret-file /path/to/my_key Encrypted Data bags
  • 32. Chef Vault: A Deep Dive @nellshamrell workstation_1 workstation_2 workstation_3 my_databag my_item Encrypted Data bags
  • 33. Chef Vault: A Deep Dive @nellshamrell workstation_1 workstation_2 workstation_3 my_key my_key my_key my_databag my_item Encrypted Data bags
  • 34. Chef Vault: A Deep Dive @nellshamrell workstation_1 workstation_2 workstation_3 my_key my_key my_key node_1 my_key node_2 my_key node_3 my_key my_databag my_item Encrypted Data bags
  • 35. Chef Vault: A Deep Dive @nellshamrell • Limited by need to distribute and share a key Encrypted Data bags
  • 36. Chef Vault: A Deep Dive @nellshamrell • Limited by need to distribute and share a key • What if someone leaves? Encrypted Data bags
  • 37. Chef Vault: A Deep Dive @nellshamrell • Limited by need to distribute and share a key • What if someone leaves? • If the key is compromised on one node/workstation, data is compromised for all nodes/workstations Encrypted Data bags
  • 38. Key rotation is hard…
  • 39. …but it’s not impossible
  • 40. Chef Vault is one approach to solving this problem
  • 41. Chef Vault: A Deep Dive @nellshamrell • Originally created by Nordstrom Chefs! Chef Vault
  • 42. Chef Vault: A Deep Dive @nellshamrell • Originally created by Nordstrom Chefs! • Ownership transferred to Chef in 2015 Chef Vault
  • 43. Chef Vault: A Deep Dive @nellshamrell • Originally created by Nordstrom Chefs! • Ownership transferred to Chef in 2015 • Completely open source • https://github.com/chef/chef-vault Chef Vault
  • 44. Chef Vault: A Deep Dive @nellshamrell Chef Vault Chef Server
  • 45. Chef Vault: A Deep Dive @nellshamrell Chef Server node_2 node_1 Chef Vault
  • 46. Chef Vault: A Deep Dive @nellshamrell Chef Server node_1 node_2 node_1_client node_2_client Chef Vault
  • 47. Chef Vault: A Deep Dive @nellshamrell Chef Server node_1 node_2 key_1 key_2 Chef Vault node_1_client node_2_client
  • 48. Chef Vault: A Deep Dive @nellshamrell Chef Server node_1 node_2 key_1.pub key_2.pub key_1 key_2 Chef Vault node_1_client node_2_client
  • 49. Chef Vault: A Deep Dive @nellshamrell Chef Server user_1 user_2 Chef Vault
  • 50. Chef Vault: A Deep Dive @nellshamrell Chef Server user_1 user_2 user_1 user_2 Chef Vault
  • 51. Chef Vault: A Deep Dive @nellshamrell Chef Server user_1 user_2 user_1 user_2 key_3 key_4 Chef Vault
  • 52. Chef Vault: A Deep Dive @nellshamrell Chef Server user_1 user_2 user_1 user_2 key_3.pub key_4.pub key_3 key_4 Chef Vault
  • 53. Chef Vault: A Deep Dive @nellshamrell my_vault my_item Chef Vault
  • 54. Chef Vault: A Deep Dive @nellshamrell my_vault my_item shared_key Chef Vault
  • 55. Chef Vault: A Deep Dive @nellshamrell my_vault my_item user_1 node_1 shared_key Chef Vault
  • 56. Chef Vault: A Deep Dive @nellshamrell my_vault my_item user_1 key_3 node_1 key_1 shared_key Chef Vault
  • 57. Chef Vault: A Deep Dive @nellshamrell my_vault my_item user_1 key_3 node_1 shared_key copy shared_key copy key_1 shared_key Chef Vault
  • 58. Chef Vault: A Deep Dive @nellshamrell my_vault my_item user_1 key_3 node_1 shared_key copy shared_key copy key_1key_3 key_1 shared_key Chef Vault
  • 59. Chef Vault: A Deep Dive @nellshamrell my_vault my_item user_1 key_3 node_1 shared_key copy shared_key copy key_1 key_1 shared_key Decrypts Chef Vault
  • 60. Chef Vault: A Deep Dive @nellshamrell my_vault my_item user_1 key_3 node_1 shared_key copy shared_key copy key_1 key_1 Chef Vault Decrypts
  • 61. Chef Vault: A Deep Dive @nellshamrell my_vault my_item user_1 key_3 node_1 shared_key copy shared_key copy key_1 Chef Vault Decrypts
  • 62. Chef Vault: A Deep Dive @nellshamrell my_vault my_item user_1 key_3 node_1 shared_key copy shared_key copy key_1 Chef Vault Decrypts
  • 63. Chef Vault uses layers of encryption to balance security and usability
  • 64. Chef Vault: A Deep Dive @nellshamrell Chef Server node_1 node_2 user_1 user_2 Chef Vault
  • 65. Chef Vault: A Deep Dive @nellshamrell Creating a Vault Workstation $ gem install chef-vault Installs Chef Vault
  • 66. Chef Vault: A Deep Dive @nellshamrell Creating a Vault Workstation $ knife vault create my_vault my_item Creates vault
  • 67. Chef Vault: A Deep Dive @nellshamrell Creating a Vault $ knife vault create my_vault my_item -A “user_1,user_2” Workstation Users with access to vault
  • 68. Chef Vault: A Deep Dive @nellshamrell Creating a Vault $ knife vault create my_vault my_item -A “user_1,user_2,node_1,node_2” Workstation Nodes with access to vault
  • 69. Chef Vault: A Deep Dive @nellshamrell Creating a Vault $ knife vault create my_vault my_item -A “user_1,user_2,node_1,node_2” -M client Workstation Mode (client or solo)
  • 70. Chef Vault: A Deep Dive @nellshamrell Creating a Vault $ knife vault create my_vault my_item -A “user_1,user_2,node_1,node_2” -M client -J ./ my_item.json Workstation File with data
  • 71. Chef Vault: A Deep Dive @nellshamrell Creating a Vault Workstation my_vault my_item $ knife vault create my_vault my_item -A “user_1,user_2,node_1,node_2” -M client -J ./ my_item.json
  • 72. Chef Vault: A Deep Dive @nellshamrell Creating a Vault Workstation my_vault my_item my_item_keys Authorized keys $ knife vault create my_vault my_item -A “user_1,user_2,node_1,node_2” -M client -J ./ my_item.json
  • 73. Chef Vault: A Deep Dive @nellshamrell Creating a Vault $ knife vault show my_vault my_item Workstation my_vault my_item my_item_keys Shows vault
  • 74. Chef Vault: A Deep Dive @nellshamrell Viewing a Vault $ knife vault show my_vault my_item db_password: some_password id: my_item Workstation
  • 75. Chef Vault: A Deep Dive @nellshamrell Viewing a Vault $ knife vault show my_vault my_item db_password: cipher: aes-256-cbc encrypted_data: dsiBtNHX8Sbis42yKuYBvbdNXPpu8bQfJrS20op7zoys fR8roFlzp VHyoaG2 4yb3 Unauthorized Workstation
  • 77. Chef Vault: A Deep Dive @nellshamrell Using a Vault in a Recipe metadata.rb gem ‘chef-vault’
  • 78. Chef Vault: A Deep Dive @nellshamrell Using a Vault in a Recipe recipe.rb chef_gem ‘chef-vault’ do compile_time true if respond_to?(:compile_time) end
  • 79. Chef Vault: A Deep Dive @nellshamrell Using a Vault in a Recipe chef_gem ‘chef-vault’ do compile_time true if respond_to?(:compile_time) end require ‘chef-vault’ recipe.rb
  • 80. Chef Vault: A Deep Dive @nellshamrell Using a Vault in a Recipe chef_gem ‘chef-vault’ do compile_time true if respond_to?(:compile_time) end require ‘chef-vault’ vault = chef_vault_item(“my_vault”, “my_item”) recipe.rb
  • 81. Chef Vault: A Deep Dive @nellshamrell Using a Vault in a Recipe chef_gem ‘chef-vault’ do compile_time true if respond_to?(:compile_time) end require ‘chef-vault’ vault = chef_vault_item(“my_vault”, “my_item”) node.set[‘database’][‘password’] = vault[‘password’] recipe.rb
  • 83. Chef Vault: A Deep Dive @nellshamrell Editing a Vault $ knife vault edit my_vault my_item Workstation my_vault my_item my_item_keys Edits vault
  • 84. Chef Vault: A Deep Dive @nellshamrell Adding a User or Node $ knife vault update my_vault my_keys -A “new- username” Workstation my_vault my_item my_item_keys Adds user/node
  • 85. Chef Vault: A Deep Dive @nellshamrell Removing a User or Node $ knife vault remove my_vault my_item -A “some_user” Workstation my_vault my_item my_item_keys Remove user/node
  • 86. Chef Vault: A Deep Dive @nellshamrell Refreshing Keys $ knife vault refresh my_vault my_item Workstation my_vault my_item my_item_keys Refresh user/node keys
  • 87. Chef Vault: A Deep Dive @nellshamrell Destroying a Vault $ knife vault delete my_vault my_item Workstation my_vault my_item my_item_keys Destroys vault item
  • 88. Chef Vault: A Deep Dive @nellshamrell Destroying a Vault $ knife vault delete my_vault my_item Workstation my_vault
  • 89. Chef Vault: A Deep Dive @nellshamrell Destroying a Vault $ knife data bag delete my_vault Workstation my_vault Destroys vault
  • 90. Chef Vault: A Deep Dive @nellshamrell Destroying a Vault $ knife data bag delete my_vault Workstation
  • 92. Chef Vault: A Deep Dive @nellshamrell Load Balancer Postgres DB App Node App Node App Node Redis Cache Supermarket Production
  • 93. Chef Vault: A Deep Dive @nellshamrell Load Balancer Postgres DB App Node App Node App Node Redis Cache Supermarket Staging
  • 94. Chef Vault: A Deep Dive @nellshamrell apps
  • 95. Chef Vault: A Deep Dive @nellshamrell apps supermarket_staging supermarket_prod
  • 96. Chef Vault: A Deep Dive @nellshamrell apps supermarket_staging supermarket_prod supermarket_staging_keys supermarket_prod_keys
  • 97. Limits of Chef Vault
  • 98. Chef Vault: A Deep Dive @nellshamrell • Adding new nodes requires human intervention • Not compatible with autoscaling groups Chef Vault
  • 99. Chef Vault: A Deep Dive @nellshamrell • Adding new nodes requires human intervention • Not compatible with autoscaling groups • Could theoretically have one node keep all keys and distribute those - but that is a major security risk Chef Vault
  • 100. Chef Vault: A Deep Dive @nellshamrell • No audit logs of access Chef Vault
  • 102. Chef Vault: A Deep Dive @nellshamrell • Alternatives • Hashicorp Vault (https:// www.vaultproject.io) Chef Vault
  • 103. Chef Vault: A Deep Dive @nellshamrell • Alternatives • Hashicorp Vault (https:// www.vaultproject.io) • Citadel (https://github.com/poise/ citadel) Chef Vault
  • 104. Which tool is best?
  • 105. It depends on your needs…
  • 106. Chef Vault: A Deep Dive @nellshamrell • Where is your infrastructure? (Citadel is AWS only) Considerations
  • 107. Chef Vault: A Deep Dive @nellshamrell • Where is your infrastructure? (Citadel is AWS only) • Do you need autoscaling groups? (Chef Vault is not a good fit) Considerations
  • 108. Chef Vault: A Deep Dive @nellshamrell • Where is your infrastructure? (Citadel is AWS only) • Do you need autoscaling groups? (Chef Vault is not a good fit) • Do you want dynamic secrets? (Hashicorp vault is your best bet) Considerations
  • 109. Key rotation is hard…
  • 110. …but it’s not impossible
  • 111. Encrypted information systems must find a balance between security and accessibility
  • 112. Chef Vault: A Deep Dive @nellshamrell • Sr. Software Engineer at Chef • Core maintainer of Supermarket and Habitat • Co-host of Foodfight Podcast • @nellshamrell • nshamrell@chef.io Nell Shamrell-Harrington