SlideShare a Scribd company logo
Keeping a Secret with HashiCorp Vault
Copyright © 2020 HashiCorp
Keeping a Secret
Retrofitting applications to use Vault
Nick Cabatoff
Vault software engineer at HashiCorp
Why do
secrets
matter?
▪ Data breaches are a routine occurrence these
days.
▪ These can result in lawsuits and fines (GDPR) for
the breachee.
▪ Victims whose personal information was stolen
face privacy loss & identity theft.
▪ Securing your secrets can prevent or limit scope of
breaches.
Harm:
Unauthorized data access,
identity spoofing, private data
egress, fines
Secret:
Something that would increase
your risk if someone else got it
Secret vs.
sensitive data:
▪ Secret: used for auth
▪ Sensitive: confidential
What’s a secret?
How do you
keep a
secret?
Forget about computers for now.
What best practices should a person follow
to keep a secret?
Keep track of who
you told
Tell as few people
as possible
Try not to have long-
term secrets
What’s a secret?
How does Vault help you keep a secret?
▪ Centralized secrets
▪ Identity-based authentication
▪ Automated secret rotation
▪ Audit Logs
All consumers of Vault secrets must solve
two problems:
1. Authentication to Vault
2. Retrieval of secrets
– At startup
– When secret expires or is rotated
Onboarding
applications
Vault Authentication /
Secure Introduction
How can app prove to Vault who it is without
storing a secret outside of Vault?
▪ Running in Nomad or Kubernetes? Scheduler can vouch
for app.
▪ Running in a cloud? Cloud IAM service can identify app.
If none of the above? This talk is for you.
We may have to store a secret outside of Vault, but we can
mitigate the risks.
Secure
Introduction
1. Don't let authentication secrets live forever
2. Distribute auth secrets securely
3. Limit exposure if auth secrets disclosed
4. Have a break-glass procedure if auth secret stolen
5. Detect unauthorized access to auth secrets
Secure
Introduction
Best practices
Secure Introduction
Best practices
1. Don't let secrets live forever Limited uses, short ttl
2. Distribute secrets securely
3. Limit exposure: Use principle of least privilege in
your roles
4. Break-glass procedure: Use audit log and revoke API
5. Detect unauthorized access: App should alert if secret absent/no good
Options:
1. Deploy Vault token alongside app
2. Deploy approle roleid/secretid alongside app
3. Deploy TLS client certificates and use cert auth method
Secure
Introduction
On premise,
no scheduler
Option 1: Distributing tokens
One reason you might want to do this instead of using approle: it makes it easy
to use envconsul or consul-template
If distributing tokens directly:
▪ use a token role, similar to what we do with approle roles
▪ distribute single-use token with a short TTL
▪ use response wrapping to embed another longer-lived token
Option 2: Approle Authentication
Setup
vault auth enable approle
vault write auth/approle/role/myrole token_policies="myapp" token_ttl=1h
vault read -field=role_id auth/approle/role/myrole/role-id > role-id
vault write -f -field=secret_id auth/approle/role/myrole/secret-id > secret-id
Administrator
Deployer
Approle Authentication
Application Login
$ grep . role-id secret-id
role-id:4bdd6e8e-47e5-5d6f-c698-397a373c9c56
secret-id:6490149e-aa11-2cb1-f4ae-b2f9da824a62
$ vault write auth/approle/login role_id=$(cat role-id) secret_id=$(cat secret-id)
Key Value
--- -----
token s.pstokYLHuv3rBGrb7zHVCF6l
token_duration 1h
policies ["default" "myapp"]
Approle vs Userpass Authentication
Isn't role_id just a username and secret_id a password?
Differences between approle and userpass:
▪ approle can have multiple secret_ids for each role
– give each app a role, each app instance a secret_id
▪ secret_ids can be bound to specific CIDRs
▪ secret_ids can have TTLs and limited uses
Approle workflow example
Getting Vault Secrets into
Application Memory
▪ Unrealistic to require every secrets-using app speak
directly to Vault
▪ Another option: use a helper like Vault Agent, consul-
template, envconsul
Onboarding
applications
Retrofit or helper?
Helper supervisors
envconsul, consul-template
Two supervisor-style tools to retrofit Vault integration into your apps:
envconsul: Query Vault, put secret in env variables of your application
consul-template: Query Vault, put secret in config files of your application
Both:
▪ Require a Vault token
▪ Poll Vault, restart app when secret changes (consul-template can also signal instead of restart)
Vault Agent auto-auth + template
Vault agent is just a mode of regular Vault binary:
vault agent
Agent uses auto-auth to get a token, e.g. approle login using role_id+secret_id
Agent template feature writes secrets to file(s) read by your app
Configure a kill command to signal your app whenever template rendered
Note: not a supervisor like envconsul/consul-template
▪ Define an approle role with appropriate privileges,
restrictions
▪ Bundle Vault Agent and role_id along with your app
▪ Deliver single-use secret_id with short TTL to your
app/Agent
▪ Agent authenticates with role_id, secret_id
▪ Agent renders secrets via template, signals your app
▪ App reads rendered template, alerts if secrets
missing/unuseable
Review
Approle
Resources
▪ Talk: Think Like A Vault Developer: Secure Introduction at Scale
▪ Blog: Authenticating Applications with Vault Approle
▪ Learn: AppRole With Terraform & Chef
▪ Learn: Secure Introduction of Vault Clients
Thank You!
26

More Related Content

What's hot (20)

PDF
Hashicorp Vault: Open Source Secrets Management at #OPEN18
Kangaroot
 
PPTX
Hashicorp Vault ppt
Shrey Agarwal
 
PDF
Secret Management with Hashicorp’s Vault
AWS Germany
 
PDF
Using Vault to decouple MySQL Secrets
Derek Downey
 
PPTX
Vault - Secret and Key Management
Anthony Ikeda
 
PDF
Vault 101
Hazzim Anaya
 
PDF
Overview of secret management solutions and architecture
Yuechuan (Mike) Chen
 
PDF
Eliminating Secret Sprawl in the Cloud with HashiCorp Vault - 07.11.2018
HashiCorp
 
PDF
HashiCorp's Vault - The Examples
Michał Czeraszkiewicz
 
PDF
Chickens & Eggs: Managing secrets in AWS with Hashicorp Vault
Jeff Horwitz
 
PDF
Credential store using HashiCorp Vault
Mayank Patel
 
PDF
Neil Saunders (Beamly) - Securing your AWS Infrastructure with Hashicorp Vault
Outlyer
 
PDF
Adopting HashiCorp Vault
Nicolas Corrarello
 
PDF
Kafka Security 101 and Real-World Tips
confluent
 
PPTX
Apache Kafka Best Practices
DataWorks Summit/Hadoop Summit
 
PDF
20명 규모의 팀에서 Vault 사용하기
Doyoon Kim
 
PPTX
Vault Open Source vs Enterprise v2
Stenio Ferreira
 
PPTX
Azure governance
girish goudar
 
PDF
Building an Enterprise-Grade Azure Governance Model
Karl Ots
 
PDF
Azure Security Overview
David J Rosenthal
 
Hashicorp Vault: Open Source Secrets Management at #OPEN18
Kangaroot
 
Hashicorp Vault ppt
Shrey Agarwal
 
Secret Management with Hashicorp’s Vault
AWS Germany
 
Using Vault to decouple MySQL Secrets
Derek Downey
 
Vault - Secret and Key Management
Anthony Ikeda
 
Vault 101
Hazzim Anaya
 
Overview of secret management solutions and architecture
Yuechuan (Mike) Chen
 
Eliminating Secret Sprawl in the Cloud with HashiCorp Vault - 07.11.2018
HashiCorp
 
HashiCorp's Vault - The Examples
Michał Czeraszkiewicz
 
Chickens & Eggs: Managing secrets in AWS with Hashicorp Vault
Jeff Horwitz
 
Credential store using HashiCorp Vault
Mayank Patel
 
Neil Saunders (Beamly) - Securing your AWS Infrastructure with Hashicorp Vault
Outlyer
 
Adopting HashiCorp Vault
Nicolas Corrarello
 
Kafka Security 101 and Real-World Tips
confluent
 
Apache Kafka Best Practices
DataWorks Summit/Hadoop Summit
 
20명 규모의 팀에서 Vault 사용하기
Doyoon Kim
 
Vault Open Source vs Enterprise v2
Stenio Ferreira
 
Azure governance
girish goudar
 
Building an Enterprise-Grade Azure Governance Model
Karl Ots
 
Azure Security Overview
David J Rosenthal
 

Similar to Keeping a Secret with HashiCorp Vault (20)

PPTX
hashicorp-virtualdays-vaultkeeping-a-secret-200409143039.pptx
hamzaaqqa7
 
PPTX
Hashicorp Chicago HUG - Secure and Automated Workflows in Azure with Vault an...
Stenio Ferreira
 
PDF
Secure Secret Management on a Budget: Reasoning about Scalable SM with Vault ...
Mary Racter
 
PDF
London HUG 19/5 - Kubernetes and vault
London HashiCorp User Group
 
PDF
Vault 1.1: Secret Caching with Vault Agent and Other New Features
Mitchell Pronschinske
 
PDF
Public Vs. Private Keys
101 Blockchains
 
PDF
iOS Application Security.pdf
Ravi Aggarwal
 
PPTX
Kubernetes and container security
Volodymyr Shynkar
 
PPTX
Secure your web app presentation
Frans Lytzen
 
PPTX
PuppetConf 2017: Securing Secrets for Puppet, Without Interrupting Flow- Ryan...
Puppet
 
PDF
OAuth2 & OpenID Connect with Spring Security
Shuto Uwai
 
PDF
"Trust Wallet Clone Script for Secure Crypto Wallets"
Malgo Technologies Pvt Ltd
 
PDF
Shifting security left simplifying security for k8s open shift environments
LibbySchulze
 
PDF
Security Checklist: how iOS can help protecting your data.
Tomek Cejner
 
PDF
9 Writing Secure Android Applications
Sam Bowne
 
PPTX
5 ways
OliviaJune1
 
PDF
PCI Compliance on AWS - Evident.io @ AWS Pop-up Loft 2/26/2015
Evident.io
 
PDF
Designing Secure APIs
Steven Chen
 
PDF
APIsecure 2023 - Enhancing API Security with Runtime Secrets & Attestation, T...
apidays
 
PDF
Tor in Haskell & Other Unikernel Tricks
C4Media
 
hashicorp-virtualdays-vaultkeeping-a-secret-200409143039.pptx
hamzaaqqa7
 
Hashicorp Chicago HUG - Secure and Automated Workflows in Azure with Vault an...
Stenio Ferreira
 
Secure Secret Management on a Budget: Reasoning about Scalable SM with Vault ...
Mary Racter
 
London HUG 19/5 - Kubernetes and vault
London HashiCorp User Group
 
Vault 1.1: Secret Caching with Vault Agent and Other New Features
Mitchell Pronschinske
 
Public Vs. Private Keys
101 Blockchains
 
iOS Application Security.pdf
Ravi Aggarwal
 
Kubernetes and container security
Volodymyr Shynkar
 
Secure your web app presentation
Frans Lytzen
 
PuppetConf 2017: Securing Secrets for Puppet, Without Interrupting Flow- Ryan...
Puppet
 
OAuth2 & OpenID Connect with Spring Security
Shuto Uwai
 
"Trust Wallet Clone Script for Secure Crypto Wallets"
Malgo Technologies Pvt Ltd
 
Shifting security left simplifying security for k8s open shift environments
LibbySchulze
 
Security Checklist: how iOS can help protecting your data.
Tomek Cejner
 
9 Writing Secure Android Applications
Sam Bowne
 
5 ways
OliviaJune1
 
PCI Compliance on AWS - Evident.io @ AWS Pop-up Loft 2/26/2015
Evident.io
 
Designing Secure APIs
Steven Chen
 
APIsecure 2023 - Enhancing API Security with Runtime Secrets & Attestation, T...
apidays
 
Tor in Haskell & Other Unikernel Tricks
C4Media
 
Ad

More from Mitchell Pronschinske (20)

PDF
Getting Started with Kubernetes and Consul
Mitchell Pronschinske
 
PDF
Multi-Cloud with Nomad and Consul Connect
Mitchell Pronschinske
 
PDF
Code quality for Terraform
Mitchell Pronschinske
 
PDF
Dynamic Azure Credentials for Applications and CI/CD Pipelines
Mitchell Pronschinske
 
PPTX
Migrating from VMs to Kubernetes using HashiCorp Consul Service on Azure
Mitchell Pronschinske
 
PPTX
Empowering developers and operators through Gitlab and HashiCorp
Mitchell Pronschinske
 
PPTX
Automate and simplify multi cloud complexity with f5 and hashi corp
Mitchell Pronschinske
 
PDF
Vault 1.5 Overview
Mitchell Pronschinske
 
PPTX
Using new sentinel features in terraform cloud
Mitchell Pronschinske
 
PDF
Military Edge Computing with Vault and Consul
Mitchell Pronschinske
 
PDF
Unlocking the Cloud operating model with GitHub Actions
Mitchell Pronschinske
 
PDF
Vault 1.4 integrated storage overview
Mitchell Pronschinske
 
PDF
Unlocking the Cloud Operating Model
Mitchell Pronschinske
 
PPTX
Cisco ACI with HashiCorp Terraform (APAC)
Mitchell Pronschinske
 
PPTX
Governance for Multiple Teams Sharing a Nomad Cluster
Mitchell Pronschinske
 
PDF
Integrating Terraform and Consul
Mitchell Pronschinske
 
PPTX
Unlocking the Cloud Operating Model: Deployment
Mitchell Pronschinske
 
PPTX
Modern Scheduling for Modern Applications with Nomad
Mitchell Pronschinske
 
PPTX
Moving to a Microservice World: Leveraging Consul on Azure
Mitchell Pronschinske
 
PPTX
Remote Culture at HashiCorp
Mitchell Pronschinske
 
Getting Started with Kubernetes and Consul
Mitchell Pronschinske
 
Multi-Cloud with Nomad and Consul Connect
Mitchell Pronschinske
 
Code quality for Terraform
Mitchell Pronschinske
 
Dynamic Azure Credentials for Applications and CI/CD Pipelines
Mitchell Pronschinske
 
Migrating from VMs to Kubernetes using HashiCorp Consul Service on Azure
Mitchell Pronschinske
 
Empowering developers and operators through Gitlab and HashiCorp
Mitchell Pronschinske
 
Automate and simplify multi cloud complexity with f5 and hashi corp
Mitchell Pronschinske
 
Vault 1.5 Overview
Mitchell Pronschinske
 
Using new sentinel features in terraform cloud
Mitchell Pronschinske
 
Military Edge Computing with Vault and Consul
Mitchell Pronschinske
 
Unlocking the Cloud operating model with GitHub Actions
Mitchell Pronschinske
 
Vault 1.4 integrated storage overview
Mitchell Pronschinske
 
Unlocking the Cloud Operating Model
Mitchell Pronschinske
 
Cisco ACI with HashiCorp Terraform (APAC)
Mitchell Pronschinske
 
Governance for Multiple Teams Sharing a Nomad Cluster
Mitchell Pronschinske
 
Integrating Terraform and Consul
Mitchell Pronschinske
 
Unlocking the Cloud Operating Model: Deployment
Mitchell Pronschinske
 
Modern Scheduling for Modern Applications with Nomad
Mitchell Pronschinske
 
Moving to a Microservice World: Leveraging Consul on Azure
Mitchell Pronschinske
 
Remote Culture at HashiCorp
Mitchell Pronschinske
 
Ad

Recently uploaded (20)

PDF
ChatPharo: an Open Architecture for Understanding How to Talk Live to LLMs
ESUG
 
PPT
Brief History of Python by Learning Python in three hours
adanechb21
 
PDF
SAP GUI Installation Guide for Windows | Step-by-Step Setup for SAP Access
SAP Vista, an A L T Z E N Company
 
PPTX
Chess King 25.0.0.2500 With Crack Full Free Download
cracked shares
 
PPTX
Contractor Management Platform and Software Solution for Compliance
SHEQ Network Limited
 
PDF
Generating Union types w/ Static Analysis
K. Matthew Dupree
 
PDF
Download iTop VPN Free 6.1.0.5882 Crack Full Activated Pre Latest 2025
imang66g
 
PDF
AI Image Enhancer: Revolutionizing Visual Quality”
docmasoom
 
PDF
System Center 2025 vs. 2022; What’s new, what’s next_PDF.pdf
Q-Advise
 
PDF
Applitools Platform Pulse: What's New and What's Coming - July 2025
Applitools
 
PPTX
Presentation about Database and Database Administrator
abhishekchauhan86963
 
PDF
Salesforce Implementation Services Provider.pdf
VALiNTRY360
 
PDF
Step-by-Step Guide to Install SAP HANA Studio | Complete Installation Tutoria...
SAP Vista, an A L T Z E N Company
 
PDF
Supabase Meetup: Build in a weekend, scale to millions
Carlo Gilmar Padilla Santana
 
PDF
Troubleshooting Virtual Threads in Java!
Tier1 app
 
PDF
10 posting ideas for community engagement with AI prompts
Pankaj Taneja
 
PDF
Why Are More Businesses Choosing Partners Over Freelancers for Salesforce.pdf
Cymetrix Software
 
PDF
Malaysia’s e-Invoice System: A Complete Guide for Businesses
Matiyas Solutions
 
PDF
Salesforce Pricing Update 2025: Impact, Strategy & Smart Cost Optimization wi...
GetOnCRM Solutions
 
PDF
Adobe Illustrator Crack Full Download (Latest Version 2025) Pre-Activated
imang66g
 
ChatPharo: an Open Architecture for Understanding How to Talk Live to LLMs
ESUG
 
Brief History of Python by Learning Python in three hours
adanechb21
 
SAP GUI Installation Guide for Windows | Step-by-Step Setup for SAP Access
SAP Vista, an A L T Z E N Company
 
Chess King 25.0.0.2500 With Crack Full Free Download
cracked shares
 
Contractor Management Platform and Software Solution for Compliance
SHEQ Network Limited
 
Generating Union types w/ Static Analysis
K. Matthew Dupree
 
Download iTop VPN Free 6.1.0.5882 Crack Full Activated Pre Latest 2025
imang66g
 
AI Image Enhancer: Revolutionizing Visual Quality”
docmasoom
 
System Center 2025 vs. 2022; What’s new, what’s next_PDF.pdf
Q-Advise
 
Applitools Platform Pulse: What's New and What's Coming - July 2025
Applitools
 
Presentation about Database and Database Administrator
abhishekchauhan86963
 
Salesforce Implementation Services Provider.pdf
VALiNTRY360
 
Step-by-Step Guide to Install SAP HANA Studio | Complete Installation Tutoria...
SAP Vista, an A L T Z E N Company
 
Supabase Meetup: Build in a weekend, scale to millions
Carlo Gilmar Padilla Santana
 
Troubleshooting Virtual Threads in Java!
Tier1 app
 
10 posting ideas for community engagement with AI prompts
Pankaj Taneja
 
Why Are More Businesses Choosing Partners Over Freelancers for Salesforce.pdf
Cymetrix Software
 
Malaysia’s e-Invoice System: A Complete Guide for Businesses
Matiyas Solutions
 
Salesforce Pricing Update 2025: Impact, Strategy & Smart Cost Optimization wi...
GetOnCRM Solutions
 
Adobe Illustrator Crack Full Download (Latest Version 2025) Pre-Activated
imang66g
 

Keeping a Secret with HashiCorp Vault

  • 2. Copyright © 2020 HashiCorp Keeping a Secret Retrofitting applications to use Vault
  • 3. Nick Cabatoff Vault software engineer at HashiCorp
  • 4. Why do secrets matter? ▪ Data breaches are a routine occurrence these days. ▪ These can result in lawsuits and fines (GDPR) for the breachee. ▪ Victims whose personal information was stolen face privacy loss & identity theft. ▪ Securing your secrets can prevent or limit scope of breaches.
  • 5. Harm: Unauthorized data access, identity spoofing, private data egress, fines Secret: Something that would increase your risk if someone else got it Secret vs. sensitive data: ▪ Secret: used for auth ▪ Sensitive: confidential What’s a secret?
  • 6. How do you keep a secret? Forget about computers for now. What best practices should a person follow to keep a secret?
  • 7. Keep track of who you told Tell as few people as possible Try not to have long- term secrets What’s a secret?
  • 8. How does Vault help you keep a secret? ▪ Centralized secrets ▪ Identity-based authentication ▪ Automated secret rotation ▪ Audit Logs
  • 9. All consumers of Vault secrets must solve two problems: 1. Authentication to Vault 2. Retrieval of secrets – At startup – When secret expires or is rotated Onboarding applications
  • 11. How can app prove to Vault who it is without storing a secret outside of Vault? ▪ Running in Nomad or Kubernetes? Scheduler can vouch for app. ▪ Running in a cloud? Cloud IAM service can identify app. If none of the above? This talk is for you. We may have to store a secret outside of Vault, but we can mitigate the risks. Secure Introduction
  • 12. 1. Don't let authentication secrets live forever 2. Distribute auth secrets securely 3. Limit exposure if auth secrets disclosed 4. Have a break-glass procedure if auth secret stolen 5. Detect unauthorized access to auth secrets Secure Introduction Best practices
  • 13. Secure Introduction Best practices 1. Don't let secrets live forever Limited uses, short ttl 2. Distribute secrets securely 3. Limit exposure: Use principle of least privilege in your roles 4. Break-glass procedure: Use audit log and revoke API 5. Detect unauthorized access: App should alert if secret absent/no good
  • 14. Options: 1. Deploy Vault token alongside app 2. Deploy approle roleid/secretid alongside app 3. Deploy TLS client certificates and use cert auth method Secure Introduction On premise, no scheduler
  • 15. Option 1: Distributing tokens One reason you might want to do this instead of using approle: it makes it easy to use envconsul or consul-template If distributing tokens directly: ▪ use a token role, similar to what we do with approle roles ▪ distribute single-use token with a short TTL ▪ use response wrapping to embed another longer-lived token
  • 16. Option 2: Approle Authentication Setup vault auth enable approle vault write auth/approle/role/myrole token_policies="myapp" token_ttl=1h vault read -field=role_id auth/approle/role/myrole/role-id > role-id vault write -f -field=secret_id auth/approle/role/myrole/secret-id > secret-id Administrator Deployer
  • 17. Approle Authentication Application Login $ grep . role-id secret-id role-id:4bdd6e8e-47e5-5d6f-c698-397a373c9c56 secret-id:6490149e-aa11-2cb1-f4ae-b2f9da824a62 $ vault write auth/approle/login role_id=$(cat role-id) secret_id=$(cat secret-id) Key Value --- ----- token s.pstokYLHuv3rBGrb7zHVCF6l token_duration 1h policies ["default" "myapp"]
  • 18. Approle vs Userpass Authentication Isn't role_id just a username and secret_id a password? Differences between approle and userpass: ▪ approle can have multiple secret_ids for each role – give each app a role, each app instance a secret_id ▪ secret_ids can be bound to specific CIDRs ▪ secret_ids can have TTLs and limited uses
  • 20. Getting Vault Secrets into Application Memory
  • 21. ▪ Unrealistic to require every secrets-using app speak directly to Vault ▪ Another option: use a helper like Vault Agent, consul- template, envconsul Onboarding applications Retrofit or helper?
  • 22. Helper supervisors envconsul, consul-template Two supervisor-style tools to retrofit Vault integration into your apps: envconsul: Query Vault, put secret in env variables of your application consul-template: Query Vault, put secret in config files of your application Both: ▪ Require a Vault token ▪ Poll Vault, restart app when secret changes (consul-template can also signal instead of restart)
  • 23. Vault Agent auto-auth + template Vault agent is just a mode of regular Vault binary: vault agent Agent uses auto-auth to get a token, e.g. approle login using role_id+secret_id Agent template feature writes secrets to file(s) read by your app Configure a kill command to signal your app whenever template rendered Note: not a supervisor like envconsul/consul-template
  • 24. ▪ Define an approle role with appropriate privileges, restrictions ▪ Bundle Vault Agent and role_id along with your app ▪ Deliver single-use secret_id with short TTL to your app/Agent ▪ Agent authenticates with role_id, secret_id ▪ Agent renders secrets via template, signals your app ▪ App reads rendered template, alerts if secrets missing/unuseable Review Approle
  • 25. Resources ▪ Talk: Think Like A Vault Developer: Secure Introduction at Scale ▪ Blog: Authenticating Applications with Vault Approle ▪ Learn: AppRole With Terraform & Chef ▪ Learn: Secure Introduction of Vault Clients