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
80
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
24
An introduction to AppSec?
mrartichaut
0
42
Secure by design: introduction to threat modeling
mrartichaut
0
47
Lead Tech: Empowering the team
mrartichaut
0
45
Web Platform Security
mrartichaut
0
44
go doSomeThing()
mrartichaut
0
49
Practical Cryptography : Data Encryption
mrartichaut
0
58
Practical Cryptography : Password Hashing
mrartichaut
1
68
HTTP/2 : One connection to rule them all
mrartichaut
1
57
Other Decks in Programming
See All in Programming
GitHub Actionsのキャッシュと手を挙げることの大切さとそれに必要なこと
satoshi256kbyte
5
420
CPython 인터프리터 구조 파헤치기 - PyCon Korea 24
kennethanceyer
0
250
ピラミッド、アイスクリームコーン、SMURF: 自動テストの最適バランスを求めて / Pyramid Ice-Cream-Cone and SMURF
twada
PRO
10
1.2k
Amazon Qを使ってIaCを触ろう!
maruto
0
380
外部システム連携先が10を超えるシステムでのアーキテクチャ設計・実装事例
kiwasaki
1
280
Duckdb-Wasmでローカルダッシュボードを作ってみた
nkforwork
0
110
Pinia Colada が実現するスマートな非同期処理
naokihaba
4
220
Compose 1.7のTextFieldはPOBox Plusで日本語変換できない
tomoya0x00
0
170
A Journey of Contribution and Collaboration in Open Source
ivargrimstad
0
620
Tauriでネイティブアプリを作りたい
tsucchinoko
0
360
Enabling DevOps and Team Topologies Through Architecture: Architecting for Fast Flow
cer
PRO
0
210
距離関数を極める! / SESSIONS 2024
gam0022
0
120
Featured
See All Featured
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
26
2.1k
Fireside Chat
paigeccino
33
3k
Designing the Hi-DPI Web
ddemaree
280
34k
Measuring & Analyzing Core Web Vitals
bluesmoon
3
78
How to Think Like a Performance Engineer
csswizardry
20
1.1k
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
Code Reviewing Like a Champion
maltzj
520
39k
The Language of Interfaces
destraynor
154
24k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
28
9.1k
Teambox: Starting and Learning
jrom
133
8.8k
Imperfection Machines: The Place of Print at Facebook
scottboms
264
13k
BBQ
matthewcrist
85
9.3k
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!