Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Taming secrets with Vault
Search
Jérémy Courtial
June 13, 2017
Programming
0
85
Taming secrets with Vault
Video:
https://www.youtube.com/watch?v=fZDd4-McNSU
Jérémy Courtial
June 13, 2017
Tweet
Share
More Decks by Jérémy Courtial
See All by Jérémy Courtial
sudo give the cloud
mrartichaut
0
26
An introduction to AppSec?
mrartichaut
0
47
Secure by design: introduction to threat modeling
mrartichaut
0
52
Lead Tech: Empowering the team
mrartichaut
0
48
Web Platform Security
mrartichaut
0
48
go doSomeThing()
mrartichaut
0
53
Practical Cryptography : Data Encryption
mrartichaut
0
62
Practical Cryptography : Password Hashing
mrartichaut
1
74
HTTP/2 : One connection to rule them all
mrartichaut
1
62
Other Decks in Programming
See All in Programming
Claude Agent SDK を使ってみよう
hyshu
0
1.1k
Six and a half ridiculous things to do with Quarkus
hollycummins
0
180
『毎日の移動』を支えるGoバックエンド内製開発
yutautsugi
2
250
AIと人間の共創開発!OSSで試行錯誤した開発スタイル
mae616
1
650
CSC509 Lecture 03
javiergs
PRO
0
340
Web フロントエンドエンジニアに開かれる AI Agent プロダクト開発 - Vercel AI SDK を観察して AI Agent と仲良くなろう! #FEC余熱NIGHT
izumin5210
3
550
ALL CODE BASE ARE BELONG TO STUDY
uzulla
25
6.3k
「ちょっと古いから」って避けてた技術書、今だからこそ読もう
mottyzzz
11
6.8k
SwiftDataを使って10万件のデータを読み書きする
akidon0000
0
150
After go func(): Goroutines Through a Beginner’s Eye
97vaibhav
0
410
CSC509 Lecture 06
javiergs
PRO
0
260
Domain-centric? Why Hexagonal, Onion, and Clean Architecture Are Answers to the Wrong Question
olivergierke
3
910
Featured
See All Featured
KATA
mclloyd
PRO
32
15k
It's Worth the Effort
3n
187
28k
Making the Leap to Tech Lead
cromwellryan
135
9.6k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.2k
Six Lessons from altMBA
skipperchong
29
4k
How GitHub (no longer) Works
holman
315
140k
Being A Developer After 40
akosma
91
590k
Building a Modern Day E-commerce SEO Strategy
aleyda
44
7.8k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
115
20k
Art, The Web, and Tiny UX
lynnandtonic
303
21k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
359
30k
Keith and Marios Guide to Fast Websites
keithpitt
411
23k
Transcript
Taming secrets with Vault Jérémy Courtial - Software Security Architect
Oodrive
Secrets & Sensitive data
zookeeper: hosts: zk.services.net environment: dev datasource: driverClassName: org.postgresql.Driver username: tk_user
password: qS5Ji;*bY*pX,94~gepF management: enabled: true context-path: /manage health: enabled: true master-key: YXplcnR5dWlvcHFzZGZnaGprbG13eGN2Ym4sOzo9QCMK server: port: 8080
zookeeper: hosts: zk.services.net environment: dev datasource: driverClassName: org.postgresql.Driver username: tk_user
password: qS5Ji;*bY*pX,94~gepF management: enabled: true context-path: /manage health: enabled: true master-key: YXplcnR5dWlvcHFzZGZnaGprbG13eGN2Ym4sOzo9QCMK server: port: 8080
Why bother?
Traditional security
Traditional security
Trusted network Traditional security
Trusted network def this_is_fine eval(someStr) end Traditional security
Traditional security
"I’m simply saying that hackers, uh… finds a way." Dr.
Ian Malcolm
Defense in depth Don't rely on a single line of
defense
Defense in depth Don't assume threats stop at the gateway
Defense in depth Try smaller trust boundaries
From..
To…
To…
CPU RAM root To… Secrets go here persistent storage users
network?
Traceability & Management
Where are our secrets?
Who can access them?
When are they accessed?
How do we rotate them?
We want those answers BEFORE we need them
The right tool SCM? Configuration management? Secrets management tool
Lots of secrets management tools nowadays Keywhiz (Square) Confidant (Lyft)
KMS (Amazon) Docker Secret
Open Source Multiple storage backends Standalone microservice API & CLI
High availability Encryption-as-a-Service Multiple types of secrets Audit friendly Authentication & Authorization
Demo
$ vault write secret/srvA/credentials pwd=azerty Success! Data written to: secret/srvA/credentials
$ vault read secret/srvA/credentials Key Value --- ----- refresh_interval 768h0m0s
pwd azerty
$ vault read /sys/policy/my-service-A path "secret/srvA/*" { capabilities = ["read"]
}
$ curl https://vault01/v1/secret/srvA/credentials -H 'X-Vault-Token:…' { "request_id": "f9e9b545-c624-ebbb-1dbd- d35e1074a478",
"lease_id": "", "renewable": false, "lease_duration": 2764800, "data": { "pwd": "azerty" …
Protecting secrets Turtles all the way down
Secrets are encrypted at rest How does Vault protect secrets?
Encryption keys only live in memory How does Vault protect
secrets?
How to obtain the Master Key? How does Vault protect
secrets?
Master key split in N shards K shards required Vault
sealed until a quorum is reached Shamir secret sharing
How do apps access secrets? Ask Vault at runtime Need
an authentication token How to pass the token to the app?
Secure introduction Secure distribution Short token lifetime Access detection
Scheduler Vault Service A
Generate wrapped token Policy: app_front Scheduler Vault Service A
Generate wrapped token Policy: app_front Scheduler Vault Service A wrapping_token:
wrap-token ttl: 1min num_use: 1 wrapped_token: app-token policy:app_front
wrapping_token: wrap-token ttl: 1min num_use: 1 wrapped_token: app-token policy:app_front token:
wrap-token num_use: 1 ttl: 1min Scheduler Vault Service A
Deploy / Start token: wrap-token num_use: 1 ttl: 1min wrapping_token:
wrap-token ttl: 1min num_use: 1 wrapped_token: app-token policy:app_front Scheduler Vault Service A
token: wrap-token num_use: 1 ttl: 1min Unwrap wrapping_token: wrap-token ttl:
1min num_use: 1 wrapped_token: app-token policy:app_front Scheduler Vault Service A
client_token: app-token policy:app_front Scheduler Vault Service A
token: app-token Read secret Scheduler Vault Service A
Secure introduction X X X Secure distribution Short token lifetime
Access detection
Vault @ Oodrive
Vault @ Oodrive One service in staging ZooKeeper as storage
backend "Good enough" introduction
Challenges @ Oodrive Ongoing transition to an orchestrated architecture
Challenges @ Oodrive For now: Puppet. No scheduler.
Challenges @ Oodrive Don't want to break everything twice
Challenges @ Oodrive Puppet Server and init script as "scheduler"
Challenges @ Oodrive Leverage existing Puppet authentication
VaultClient client = new Builder(vaultUri) .withTokenAuth(token) .build(); Credentials cred =
client.readSecret( "secret/my-service/db-credentials", Credentials.class); Vanilla Java Client
@SecretPath("credentials") Secret<Credentials> credentialsSecret; … Credentials cred = credentialsSecret.getValue(); Spring
Hopefully to be open sourced
Best practices
Least Privilege all the way!
Vault as single secrets repository
Secrets grouped under service name
Use roles for easier management
Enable ACL on ZooKeeper
Next steps Fully secure introduction Dynamic secrets (db credentials) Vault
as internal PKI
Thanks Questions? To win!