Secret Management with Hashicorp's Vault Vault secret backends β static secrets 1234- foo- bar 1 vault write secret/app1/api-key βββ aws β βββ creds β βββ admin β βββ developer βββ database β βββ creds β βββ clients β βββ contracts βββ pki β βββ issue β βββ example-com βββ secret β βββ team β βββ app1 Vault β β βββ api-keys β β βββ google-analytics β β βββ paypal β βββ app2 2 vault read secret/app1/api-key β βββ foo βββ ssh β βββ creds β βββ erika β βββ erna βββ transit βββ decrypt app1 β βββ team-1-key βββ encrypt βββ team-1-key 3 1234- foo- bar Quelle / Max Mustermann οΏ½ X
Secret Management with Hashicorp's Vault Vault secret backends β dynamic secrets οΏ½ 24
Secret Management with Hashicorp's Vault Vault secret backends β dynamic secrets What they are β’ on-the- f ly created credentials (hence dynamic) for each instance of an app / user who wants a secret β’ usually short to medium long ttl β’ fully audited Quelle / Max Mustermann οΏ½ 25
Secret Management with Hashicorp's Vault Vault secret backends β dynamic secrets How they work (in a Nutshell) 1. provide Vault credentials for a user that has rights to create users or tokens in a remote system (e.g. db) 2. con f igure Vault with settings on how to create credentials 3. con f igure Vault with settings on how to invalidate credentials in the remote system Quelle / Max Mustermann οΏ½ 26
Secret Management with Hashicorp's Vault Vault secret backends β Databases οΏ½ 27
Secret Management with Hashicorp's Vault Vault secret backends β Databases β’ Idea: get access to databases β’ Vault gets con f igured with credentials for a database user that has necessary permissions on the database β’ Vault gets a policy that maps users and roles to users with con f igured permissions in the database β’ when user requests credentials, Vault creates a new database user on the f ly β’ when con f igured (usually the case), all created users have a ttl assigned β when the ttl is reached, Vault deletes the user from the database Quelle / Max Mustermann οΏ½ X
Secret Management with Hashicorp's Vault Vault secret backends β Databases db admin 0 config βββ aws β βββ creds β βββ admin β βββ developer βββ database β βββ creds β βββ clients β βββ contracts βββ pki β βββ issue β βββ example-com βββ secret β βββ team β βββ app1 Vault β β βββ api-keys β β βββ google-analytics β β βββ paypal β βββ app2 β βββ foo βββ ssh β βββ creds β βββ erika β βββ erna βββ transit βββ decrypt β βββ team-1-key βββ encrypt βββ team-1-key Quelle / Max Mustermann οΏ½ 28
Secret Management with Hashicorp's Vault Vault secret backends β Databases db admin vault secrets enable -path=db database 0 config βββ aws β βββ creds vault write db/config/clients \ β βββ admin β βββ developer plugin_name=mysql-database-plugin \ βββ database β βββ creds connection_url=" admin:pw@tcp(db.example.com)/ " \ β βββ clients β βββ contracts allowed_roles=β clients-ro,clients-rw β βββ pki β βββ issue β βββ example-com βββ secret vault write database/roles/ clients-ro \ β βββ team β βββ app1 db_name=clients \ Vault β β βββ api-keys β β βββ google-analytics creation_statements=β\ β β βββ paypal β βββ app2 CREATE USER ' {{name}} '@'%' IDENTIFIED BY \ β βββ foo βββ ssh ' {{password}} '; \ β βββ creds β βββ erika GRANT SELECT ON clients.* TO ' {{name}} '@'%';" \ β βββ erna βββ transit default_ttl="1h" \ βββ decrypt β βββ team-1-key max_ttl="240h" βββ encrypt βββ team-1-key Quelle / Max Mustermann οΏ½ 29
Secret Management with Hashicorp's Vault Vault secret backends β Databases db admin vault secrets enable -path=db database 0 config βββ aws β βββ creds vault write db/config/clients \ β βββ admin β βββ developer plugin_name=mysql-database-plugin \ βββ database β βββ creds connection_url="admin:pw@tcp(db.example.com)/" \ β βββ clients β βββ contracts allowed_roles=βclients-ro, clients-rwβ βββ pki β βββ issue β βββ example-com βββ secret vault write database/ roles / clients-ro \ β βββ team β βββ app1 db_name=clients \ Vault β β βββ api-keys β β βββ google-analytics creation_statements=β\ β β βββ paypal β βββ app2 CREATE USER ' {{name}} '@'%' IDENTIFIED BY \ β βββ foo βββ ssh ' {{password}} '; \ β βββ creds β βββ erika GRANT SELECT ON clients.* TO ' {{name}} '@'%';" \ β βββ erna βββ transit default_ttl="1h" \ βββ decrypt β βββ team-1-key max_ttl=β240h" βββ encrypt βββ team-1-key Quelle / Max Mustermann οΏ½ 30
Secret Management with Hashicorp's Vault Vault secret backends β Databases db admin 0 create user β¦ config 2 βββ aws β βββ creds β βββ admin β βββ developer βββ database β βββ creds β βββ clients β βββ contracts βββ pki β βββ issue con f igured ttl β βββ example-com βββ secret β βββ team 5 delete user β¦ role β βββ app1 Vault β β βββ api-keys β β βββ google-analytics } β β βββ paypal read 1 β βββ app2 β βββ foo db /creds/clients-ro βββ ssh β βββ creds β βββ erika β βββ erna βββ transit βββ decrypt App β βββ team-1-key βββ encrypt βββ team-1-key OK 3 db login / 4 db password Quelle / Max Mustermann οΏ½ 31
Secret Management with Hashicorp's Vault Vault secret backends β Databases Available Plugins: β’ Cassandra β’ HanaDB β’ MongoDB β’ MSSQL β’ MySQL/MariaDB β’ PostgreSQL β’ Oracle Quelle / Max Mustermann οΏ½ 32
Secret Management with Hashicorp's Vault Vault secret backends β Google Cloud οΏ½ X
Secret Management with Hashicorp's Vault Vault secret backends β Google Cloud 0 credentials.json βββ aws de f ine rolesets to generate β βββ creds β βββ admin β βββ developer oauth2 access tokens (preferred) βββ database β βββ creds β¦or service account β βββ clients β βββ contracts or Service Accounts βββ pki β βββ issue β βββ example-com βββ secret β βββ team β βββ app1 Vault β β βββ api-keys β β βββ google-analytics β β βββ paypal β βββ app2 β βββ foo βββ ssh β βββ creds β βββ erika β βββ erna βββ transit βββ decrypt β βββ team-1-key βββ encrypt βββ team-1-key Quelle / Max Mustermann οΏ½ X
Secret Management with Hashicorp's Vault Vault secret backends β Google Cloud create token / 0 2 credentials.json βββ aws service account β βββ creds β βββ admin β βββ developer GCP βββ database β βββ creds β¦or service account β βββ clients Api β βββ contracts βββ pki β βββ issue con f igured β βββ example-com βββ secret β βββ team β βββ app1 roleset Vault β β βββ api-keys β β βββ google-analytics read β β βββ paypal } 1 β βββ app2 β βββ foo gcp /token/dev βββ ssh β βββ creds β βββ erika β βββ erna βββ transit βββ decrypt App β βββ team-1-key βββ encrypt βββ team-1-key 4 oauth2 token/ oauth2 token / 3 service account service account ttl key key Quelle / Max Mustermann οΏ½ X
Secret Management with Hashicorp's Vault Vault secret backends β AWS οΏ½ 33
Secret Management with Hashicorp's Vault Vault secret backends β AWS β’ Idea: get access to AWS resources β’ Vault gets con f igured with an AWS user that has necessary permissions β’ Vault gets a policy that maps users or roles to AWS roles β’ when user requests credentials, Vault creates STS tokens, assume role tokens or dynamic IAM users β’ when con f igured (usually the case), all created secrets have a ttl assigned Quelle / Max Mustermann οΏ½ X
Secret Management with Hashicorp's Vault Vault secret backends β AWS aws_access_key 0 aws_secret_key βββ aws β βββ creds β βββ admin β βββ developer βββ database β βββ creds β βββ clients β βββ contracts βββ pki β βββ issue β βββ example-com βββ secret β βββ team β βββ app1 Vault β β βββ api-keys β β βββ google-analytics β β βββ paypal β βββ app2 β βββ foo βββ ssh β βββ creds β βββ erika β βββ erna βββ transit βββ decrypt β βββ team-1-key βββ encrypt βββ team-1-key Quelle / Max Mustermann οΏ½ 34
Secret Management with Hashicorp's Vault Vault secret backends β AWS aws_access_key create STS / 0 2 aws_secret_key βββ aws IAM user β βββ creds β βββ admin β βββ developer AWS βββ database β βββ creds β βββ clients Api β βββ contracts βββ pki β βββ issue con f igured β βββ example-com βββ secret β βββ team β βββ app1 role Vault β β βββ api-keys β β βββ google-analytics read β β βββ paypal } 1 β βββ app2 β βββ foo aws /creds/dev βββ ssh β βββ creds β βββ erika β βββ erna βββ transit βββ decrypt App β βββ team-1-key βββ encrypt βββ team-1-key 4 TTLβed Token / TTLβed Token / 3 credentials credentials ttl Quelle / Max Mustermann οΏ½ 35
Secret Management with Hashicorp's Vault Vault secret backends β PKI οΏ½ 36
Secret Management with Hashicorp's Vault Vault secret backends β PKI β’ Idea: issue client certi f icates on the f ly β’ Vault gets con f igured a CA Certi f icate and a private key β’ Vault gets a con f iguration about how certi f icates for this CA should be issues (ttl, subject, etc.) β’ when user requests credentials, Vault issues a certi f icate on the f ly β’ when con f igured (usually the case), all created certi f icates have a ttl assigned Quelle / Max Mustermann οΏ½ X
Secret Management with Hashicorp's Vault Vault secret backends β PKI add ca.cert & 0 ca.key βββ aws β βββ creds β βββ admin β βββ developer βββ database β βββ creds β βββ clients β βββ contracts βββ pki β βββ issue β βββ example-com βββ secret β βββ team β βββ app1 Vault β β βββ api-keys β β βββ google-analytics β β βββ paypal β βββ app2 β βββ foo βββ ssh β βββ creds β βββ erika β βββ erna βββ transit βββ decrypt β βββ team-1-key βββ encrypt βββ team-1-key Quelle / Max Mustermann οΏ½ 37
Secret Management with Hashicorp's Vault Vault secret backends β PKI add ca.cert & 0 ca.key βββ aws create client β βββ creds β βββ admin 2 β βββ developer certificate βββ database β βββ creds β βββ clients β βββ contracts βββ pki β βββ issue con f igured β βββ example-com βββ secret β βββ team β βββ app1 role Vault β β βββ api-keys β β βββ google-analytics write β β βββ paypal } 1 β βββ app2 β βββ foo pki /issue/dev βββ ssh β βββ creds β βββ erika β βββ erna βββ transit βββ decrypt App β βββ team-1-key βββ encrypt βββ team-1-key 3 TTLβed client certificate Quelle / Max Mustermann οΏ½ 38
Secret Management with Hashicorp's Vault Vault secret backends β SSH οΏ½ 39
Secret Management with Hashicorp's Vault Vault dynamic secret backends β ssh One-Time SSH Passwords β’ Idea: get ssh access to machines β’ every host in the system has a small Vault-helper process running β’ user fetches a one time password from Vault β’ when authenticating via ssh, the Vault-helper checks, whether the one time password is valid and deletes it Quelle / Max Mustermann οΏ½ X
Secret Management with Hashicorp's Vault Vault secret backends β SSH 1 vault write ssh/creds/dev ip=1.1.2.2 βββ aws β βββ creds β βββ admin β βββ developer username / otp βββ database 2 β βββ creds β βββ clients β βββ contracts βββ pki β βββ issue β βββ example-com βββ secret β βββ team β βββ app1 Vault β β βββ api-keys β β βββ google-analytics β β βββ paypal β βββ app2 β βββ foo βββ ssh β βββ creds β βββ erika β βββ erna βββ transit Host βββ decrypt β βββ team-1-key βββ encrypt βββ team-1-key 1.1.2.2 3 ssh username@1.1.2.2 validate 4 otp grant access 5 Quelle / Max Mustermann οΏ½ 40
Secret Management with Hashicorp's Vault Vault dynamic secret backends β ssh Signed SSH Certi f icates β’ Idea: get ssh access to machines β’ user con f igures Vault-ssh with a CA, a private and a public key β’ the public key gets distributed to all system hosts β’ the user asks Vault to sign one of his public ssh keys with the provided CA and gets a new, signed public key as a response β’ the user can use this new, signed key to login to machines Quelle / Max Mustermann οΏ½ 41
Secret Management with Hashicorp's Vault Vault dynamic secret backends β Transit οΏ½ 42
Secret Management with Hashicorp's Vault Vault dynamic secret backends β Transit β’ Idea: de- and encrypt data without handling private keys β’ User creates a new transit path in Vault β’ Users can encrypt data by writing the data to this transit path (e.g. transit/encrypt/my-keys/foo ) β’ Users with suf f icient permissions can decrypt data by writing to the respective transit path (e.g. transit/decrypt/my-keys/foo ) β’ the private key never leaves Vault β’ the data is not stored on Vault (hence the name transit) Quelle / Max Mustermann οΏ½ X
Secret Management with Hashicorp's Vault Vault secret backends β Transit foo 1 vault write transit/ en crypt/ app /app1 βββ aws β βββ creds β βββ admin β βββ developer 2 βββ database β βββ creds β βββ clients Β―:Γ§Γ β βββ contracts βββ pki # Β² ^? β βββ issue β βββ example-com Γ‘Vˆ βββ secret β βββ team β βββ app1 Vault β β βββ api-keys Β―:Γ§Γ β β βββ google-analytics β β βββ paypal # Β² ^? β βββ app2 3 vault write transit/ de crypt/ app /app1 β βββ foo Γ‘Vˆ βββ ssh β βββ creds β βββ erika β βββ erna βββ transit βββ decrypt App β βββ team-1-key βββ encrypt βββ team-1-key 4 foo Quelle / Max Mustermann οΏ½ 43
Secret Management with Hashicorp's Vault Vault secret backends β’ β’ AWS Tokens β’ β’ Consul βββ aws LDAP β βββ creds β βββ admin β’ β’ Cubbyhole β βββ developer AWS βββ database β βββ creds β’ β’ Databases β βββ clients Kubernetes β βββ contracts βββ pki β’ β βββ issue β’ Identity β βββ example-com Google Cloud βββ secret β βββ team β’ β’ Static secrets (Key /Value) β βββ app1 Username & Password Vault β β βββ api-keys β β βββ google-analytics β’ β’ Nomad β β βββ paypal AppRole β βββ app2 β βββ foo β’ β’ PKI (Certi f icates) βββ ssh β βββ creds GitHub β βββ erika β βββ erna β’ β’ RabbitMQ βββ transit MFA βββ decrypt β βββ team-1-key β’ β’ SSH βββ encrypt Okta βββ team-1-key β’ β’ TOTP RADIUS β’ β’ Transit TLS Certi f icates Quelle / Max Mustermann οΏ½ 44
Secret Management with Hashicorp's Vault Vault β auth backends οΏ½ 45
Secret Management with Hashicorp's Vault Vault auth backends β’ β’ AWS Tokens β’ β’ Consul βββ aws LDAP β βββ creds β βββ admin β’ β’ Cubbyhole β βββ developer AWS βββ database β βββ creds β’ β’ Databases β βββ clients β βββ contracts Kubernetes βββ pki β’ β βββ issue β’ Identity β βββ example-com Google Cloud βββ secret β βββ team β’ β’ Static secrets (Key /Value) β βββ app1 Username & Password Vault β β βββ api-keys β β βββ google-analytics β’ β’ Nomad β β βββ paypal AppRole β βββ app2 β βββ foo β’ β’ PKI (Certi f icates) βββ ssh β βββ creds GitHub β βββ erika β βββ erna β’ β’ RabbitMQ βββ transit MFA βββ decrypt β βββ team-1-key β’ β’ SSH βββ encrypt Okta βββ team-1-key β’ β’ TOTP RADIUS β’ β’ Transit TLS Certi f icates Quelle / Max Mustermann οΏ½ 46
Secret Management with Hashicorp's Vault Vault auth backends β tokens οΏ½ 47
Secret Management with Hashicorp's Vault token auth β’ created by Vault β’ only way to authorize (auth-z) against Vault β’ returned when authenticated (auth-n) successfully β’ comparable to a session-id on a website β’ has permissions / policies assigned to it Quelle / Max Mustermann οΏ½ 48
Secret Management with Hashicorp's Vault token auth $ vault token create -ttl=5m -policy=admin Key Value --- ----- token d9640590-63c8-b3a6-50ac-1403c8180948 token_accessor 5a362982-f34c-3706-143a-26ada278b6cf token_duration 5m token_renewable true token_policies [admin default] Quelle / Max Mustermann οΏ½ 49
Secret Management with Hashicorp's Vault Vault auth backends β userpass οΏ½ X
Secret Management with Hashicorp's Vault userpass auth β’ statically created by users and stored in Vault $ vault auth enable userpass $ vault write auth/userpass/users/kesselborn \ password=foo policies=admin $ vault login -method=userpass username=kesselborn Key Value --- ----- token d9640590-63c8-b3a6-50ac-1403c8180948 . . . token_duration 5m token_policies [admin default] Quelle / Max Mustermann οΏ½ X
Secret Management with Hashicorp's Vault Vault auth backends β userpass β’ setup username / password βββ aws β βββ creds β βββ admin β βββ developer βββ database β βββ creds pass β βββ clients word β βββ contracts βββ pki 1 123 β βββ issue vault write /auth/userpass/users/foo β βββ example-com βββ secret β βββ team β βββ app1 Vault β β βββ api-keys β β βββ google-analytics β β βββ paypal β βββ app2 β βββ foo βββ ssh β βββ creds β βββ erika β βββ erna βββ transit βββ decrypt β βββ team-1-key βββ encrypt βββ team-1-key Quelle / Max Mustermann οΏ½ X
Secret Management with Hashicorp's Vault Vault auth backends β userpass β’ authenticate with a username & password βββ aws β βββ creds β βββ admin β βββ developer βββ database β βββ creds β βββ clients β βββ contracts βββ pki 1 foo / password123 β βββ issue β βββ example-com βββ secret β βββ team β βββ app1 Vault β β βββ api-keys β β βββ google-analytics β β βββ paypal β βββ app2 β βββ foo βββ ssh β βββ creds β βββ erika β βββ erna βββ transit βββ decrypt β βββ team-1-key βββ encrypt token 2 βββ team-1-key policies Quelle / Max Mustermann οΏ½ X
Secret Management with Hashicorp's Vault Vault auth backends β TLS certi f icates οΏ½ X
Secret Management with Hashicorp's Vault Vault auth backends β TLS certi f icates β’ setup TLS certi f icate authentication βββ aws β βββ creds β βββ admin β βββ developer vault write auth/cert/certs/web \ βββ database β βββ creds β¦ β βββ clients β βββ contracts βββ pki certificate=@web-cert.pem 1 β βββ issue β βββ example-com βββ secret β βββ team β βββ app1 Vault β β βββ api-keys β β βββ google-analytics β β βββ paypal β βββ app2 β βββ foo βββ ssh β βββ creds β βββ erika β βββ erna βββ transit βββ decrypt β βββ team-1-key βββ encrypt βββ team-1-key Quelle / Max Mustermann οΏ½ X
Secret Management with Hashicorp's Vault Vault auth backends β TLS certi f icates β’ authenticate with a TLS client certi f icate βββ aws β βββ creds β βββ admin β βββ developer βββ database β βββ creds β βββ clients β βββ contracts βββ pki 1 β βββ issue client certificate β βββ example-com βββ secret β βββ team β βββ app1 Vault β β βββ api-keys β β βββ google-analytics β β βββ paypal β βββ app2 β βββ foo βββ ssh β βββ creds β βββ erika β βββ erna βββ transit βββ decrypt β βββ team-1-key βββ encrypt token 2 βββ team-1-key policies Quelle / Max Mustermann οΏ½ X
Secret Management with Hashicorp's Vault Vault auth backends β external identity providers οΏ½ 50
Secret Management with Hashicorp's Vault Vault auth backends β LDAP / Radius / Okta auth β’ $SERVICE is used as an identity provider (using LDAP here) username/ username/ 1 2 password password βββ aws β βββ creds β βββ admin β βββ developer LDAP βββ database β βββ creds β βββ clients β βββ contracts βββ pki β βββ issue β βββ example-com βββ secret β βββ team β βββ app1 Vault β β βββ api-keys β β βββ google-analytics β β βββ paypal β βββ app2 β βββ foo βββ ssh β βββ creds β βββ erika β βββ erna βββ transit βββ decrypt β βββ team-1-key βββ encrypt user: kesselborn βββ team-1-key token token 4 5 3 groups: admin, employee policies policies Quelle / Max Mustermann οΏ½ 51
Secret Management with Hashicorp's Vault LDAP auth $ vault write auth/ldap/config \ url="ldaps://ldap.example.com" \ userattr="uid" \ userdn="ou=People,dc=innoq,dc=com" \ binddn="cn=vaultuser,dc=example,dc=com" \ bindpass="3cK{hrh7hi/Hj" \ groupdn="ou=Group,dc=example,dc=com" \ starttls=true $ vault write auth/ldap/groups/employee policies=employee $ vault write auth/ldap/users/kesselborn policies=admin Quelle / Max Mustermann οΏ½ X
Secret Management with Hashicorp's Vault Github auth β’ Github is used as an identity provider token token 1 2 βββ aws β βββ creds β βββ admin β βββ developer Github βββ database β βββ creds β βββ clients β βββ contracts βββ pki β βββ issue β βββ example-com βββ secret β βββ team β βββ app1 Vault β β βββ api-keys β β βββ google-analytics β β βββ paypal β βββ app2 β βββ foo βββ ssh β βββ creds β βββ erika β βββ erna βββ transit βββ decrypt β βββ team-1-key βββ encrypt user: kesselborn βββ team-1-key token 4 3 teams: kesselfaktur, innnoq policies Quelle / Max Mustermann οΏ½ 52
Secret Management with Hashicorp's Vault Vault auth backends β Kubernetes auth οΏ½ 53
Secret Management with Hashicorp's Vault Vault auth backends β Kubernetes auth 2 auth against K8s K8s token k8s API 1 βββ aws β βββ creds β βββ admin K8s container β βββ developer βββ database /var β βββ creds API ββ run β βββ clients ββ secrets β βββ contracts ββ kubernetes.io βββ pki ββ serviceaccount β βββ issue ββ token β βββ example-com βββ secret β βββ team β βββ app1 Vault β β βββ api-keys β β βββ google-analytics β β βββ paypal β βββ app2 β βββ foo βββ ssh β βββ creds β βββ erika β βββ erna βββ transit βββ decrypt β βββ team-1-key βββ encrypt βββ team-1-key service_account_name: app1 token token 5 4 3 service_account_namespace: default policies policies Quelle / Max Mustermann οΏ½ 54
Secret Management with Hashicorp's Vault Vault auth backends β Kubernetes auth 2 auth against K8s K8s token k8s API 1 βββ aws β βββ creds β βββ admin K8s container β βββ developer app init βββ database β βββ creds API β βββ clients β βββ contracts βββ pki β βββ issue β βββ example-com Pod βββ secret β βββ team β βββ app1 Vault β β βββ api-keys β β βββ google-analytics β β βββ paypal β βββ app2 β βββ foo token 4 policies βββ ssh β βββ creds β βββ erika β βββ erna βββ transit βββ decrypt β βββ team-1-key βββ encrypt success / βββ team-1-key 3 failure token 5 policies Quelle / Max Mustermann οΏ½ 55
Secret Management with Hashicorp's Vault Vault auth backends β Kubernetes auth $ vault auth enable kubernetes $ vault write auth/kubernetes/config \ kubernetes_host=βhttps://api.k8s.example.com" \ kubernetes_ca_cert=β@ca.crt" $ vault write auth/kubernetes/role/demo \ bound_service_account_names=vault-auth \ bound_service_account_namespaces=default \ policies=default \ ttl=1h Quelle / Max Mustermann οΏ½ X
Secret Management with Hashicorp's Vault Vault auth backends β GCE auth >> οΏ½ X
Secret Management with Hashicorp's Vault Vault auth backends β GCE auth signed 4 verify JWT signature JWT 3 βββ aws using kid value β βββ creds β βββ admin OAuth2 GCE β βββ developer βββ database β βββ creds API Instance against Google β βββ clients β βββ contracts βββ pki public certi f icates β βββ issue β βββ example-com βββ secret β βββ team β βββ app1 signed Vault β β βββ api-keys 2 1 β β βββ google-analytics β β βββ paypal JWT: β βββ app2 β βββ foo JWT { βββ ssh β βββ creds "project_id": ββ¦β, β βββ erika β βββ erna meta "project_number": β¦, βββ transit βββ decrypt "zone": ββ¦β, β βββ team-1-key data βββ encrypt "instance_id": β¦, βββ team-1-key 5 token token 6 server "instance_name": ββ¦β "instance_creation_timestamp": β¦ policies policies } curl -H "Metadata-Flavor: Google" \ 'http://metadata/computeMetadata/v1/instance/service-accounts/default/identity?audience=[AUDIENCE]&format=[FORMAT]'
Secret Management with Hashicorp's Vault Vault auth backends β AWS auth >> οΏ½ 56
Secret Management with Hashicorp's Vault Vault auth backends β AWS auth β’ Vault checks passed in data was encrypted with a AWS private key β’ can be limited to instances which have a speci f ic instance role applied β’ can be limited (and usually is) to allow one authentication per ec2 instance only β’ after authentication, roles and policies are mapped as usual Quelle / Max Mustermann οΏ½ X
Secret Management with Hashicorp's Vault Vault auth backends β AWS auth verify PKCS#7 signature against AWS public keys 4 verify AWS 5 Instance instance Identity Document 3 PKCS#7 βββ aws β βββ creds β βββ admin EC2 EC2 β βββ developer βββ database β βββ creds API Instance β βββ clients β βββ contracts βββ pki β βββ issue β βββ example-com βββ secret β βββ team AWS 6 instance_id: i-a832f734 β βββ app1 Instance Vault β β βββ api-keys 2 1 β β βββ google-analytics Identity ami_id: ami-f083709d β β βββ paypal Document β βββ app2 β βββ foo β¦ βββ ssh PKCS#7 β βββ creds β βββ erika β βββ erna EC2 βββ transit βββ decrypt β βββ team-1-key (optionally) set instance on MetaData 8 βββ encrypt βββ team-1-key blacklist to avoid 7 token token 9 Services double authentication policies policies curl -s http://169.254.169.254/latest/dynamic/instance-identity/pkcs7
Secret Management with Hashicorp's Vault Vault auth backends β AWS auth $ vault write auth/aws/role/dev-role \ auth_type=ec2 \ bound_ami_id=ami-fce3c696 \ policies=prod,dev max_ttl=500h $ vault write auth/aws/role/dev-role-iam \ auth_type=iam \ bound_ iam_instance_profile_arn =β¦ \ policies=prod,dev max_ttl=500h Quelle / Max Mustermann οΏ½ X
Secret Management with Hashicorp's Vault Vault auth backends β AWS auth β’ alternatively: IAM auth method β’ client signs a GetCallerIdentity query using the AWS Signature v4 algorithm and submits 4 pieces of information to the Vault server to recreate a valid signed request β’ https:/ /www.vaultproject.io/docs/auth/aws.html#iam-auth- method Quelle / Max Mustermann οΏ½ 58
Secret Management with Hashicorp's Vault Vault auth backends β AppRole >> οΏ½ 59
Secret Management with Hashicorp's Vault Vault auth backends β AppRole β’ a generic approach to authenticate machines or applications β’ an AppRole can be created for a particular machine, a particular user on that machine, or a service spread across machines β’ for authenticating, two values are needed β’ RoleID: static, can live with an app or on a machine) β’ SecretID: gets created on the f ly before authenticating Quelle / Max Mustermann οΏ½ X
Secret Management with Hashicorp's Vault Vault auth backends β AppRole β’ mainly used for machines or apps to authenticate against Vault request SecretID 1 Some βββ aws β βββ creds β βββ admin process 2 SecretID β βββ developer βββ database (puppet, chef, β βββ creds β βββ clients etc.) β βββ contracts βββ pki β βββ issue β βββ example-com βββ secret β βββ team β βββ app1 RoleID + Vault β β βββ api-keys β β βββ google-analytics 4 β β βββ paypal SecretID β βββ app2 β βββ foo βββ ssh 3 SecretID β βββ creds App β βββ erika β βββ erna βββ transit βββ decrypt β βββ team-1-key βββ encrypt RoleID βββ team-1-key token 5 policies Quelle / Max Mustermann οΏ½ X
Secret Management with Hashicorp's Vault Vault auth backends β AppRole β’ mainly used for machines or apps to authenticate against Vault request SecretID 1 Some βββ aws β βββ creds β βββ admin process 2 wrapped SecretID β βββ developer βββ database (K8s side car, β βββ creds β βββ clients chef, etc.) β βββ contracts βββ pki β βββ issue β βββ example-com βββ secret β βββ team β βββ app1 unwrap Vault β β βββ api-keys 4 β β βββ google-analytics SecretID β β βββ paypal β βββ app2 wrapped β βββ foo βββ ssh 3 β βββ creds SecretID 5 SecretID App β βββ erika β βββ erna βββ transit βββ decrypt 6 β βββ team-1-key RoleID + SecretId βββ encrypt RoleID βββ team-1-key token policies 7 Quelle / Max Mustermann οΏ½ X
Secret Management with Hashicorp's Vault Vault auth backends β’ β’ AWS Tokens β’ β’ Consul βββ aws LDAP β βββ creds β βββ admin β’ β’ Cubbyhole β βββ developer AWS βββ database β βββ creds β’ β’ Databases β βββ clients β βββ contracts Kubernetes βββ pki β’ β βββ issue β’ Identity β βββ example-com Google Cloud βββ secret β βββ team β’ β’ Static secrets (Key /Value) β βββ app1 Username & Password Vault β β βββ api-keys β β βββ google-analytics β’ β’ Nomad β β βββ paypal β βββ app2 AppRole β βββ foo β’ β’ PKI (Certi f icates) βββ ssh β βββ creds GitHub β βββ erika β βββ erna β’ β’ RabbitMQ βββ transit MFA βββ decrypt β βββ team-1-key β’ β’ SSH βββ encrypt Okta βββ team-1-key β’ β’ TOTP RADIUS β’ β’ Transit TLS Certi f icates Quelle / Max Mustermann οΏ½ X
Secret Management with Hashicorp's Vault Use whatever the auth you want οΏ½ 60
Secret Management with Hashicorp's Vault Vault β’ β’ AWS Tokens β’ β’ Consul βββ aws LDAP β βββ creds β βββ admin β’ β’ Cubbyhole β βββ developer AWS βββ database β βββ creds β’ β’ Databases β βββ clients Kubernetes β βββ contracts βββ pki β’ β βββ issue β’ Identity β βββ example-com Google Cloud βββ secret β βββ team β’ β’ Static secrets (Key /Value) β βββ app1 Username & Password Vault β β βββ api-keys β β βββ google-analytics β’ β’ Nomad β β βββ paypal AppRole β βββ app2 β βββ foo β’ β’ PKI -> Kubernetes access βββ ssh β βββ creds GitHub β βββ erika β βββ erna β’ β’ RabbitMQ βββ transit MFA βββ decrypt β βββ team-1-key β’ β’ SSH βββ encrypt Okta βββ team-1-key β’ β’ TOTP RADIUS β’ β’ Transit TLS Certi f icates Quelle / Max Mustermann οΏ½ 61
Secret Management with Hashicorp's Vault Vault β’ β’ AWS Tokens β’ β’ Consul βββ aws LDAP β βββ creds β βββ admin β’ β’ Cubbyhole β βββ developer AWS βββ database β βββ creds β’ β’ Databases β βββ clients β βββ contracts Kubernetes βββ pki β’ β βββ issue β’ Identity β βββ example-com Google Cloud βββ secret β βββ team β’ β’ Static secrets (Key /Value) β βββ app1 Username & Password Vault β β βββ api-keys β β βββ google-analytics β’ β’ Nomad β β βββ paypal AppRole β βββ app2 β βββ foo β’ β’ PKI (Certi f icates) βββ ssh β βββ creds GitHub β βββ erika β βββ erna β’ β’ RabbitMQ βββ transit MFA βββ decrypt β βββ team-1-key β’ β’ SSH βββ encrypt Okta βββ team-1-key β’ β’ TOTP RADIUS β’ β’ Transit TLS Certi f icates Quelle / Max Mustermann οΏ½ 62
Secret Management with Hashicorp's Vault Vault β policies οΏ½ 63
Secret Management with Hashicorp's Vault βββ aws β βββ creds β βββ admin Vault β secret β βββ developer βββ database representation β βββ creds β βββ clients β βββ contracts βββ pki β’ β’ AWS β βββ issue Tokens β’ β βββ example-com β’ Consul βββ aws LDAP β βββ creds βββ secret β βββ admin β’ β’ Cubbyhole β βββ developer AWS βββ database β βββ team β βββ creds β’ β’ Databases β βββ clients β βββ app1 Kubernetes β βββ contracts βββ pki Vault β β βββ api-keys β’ β βββ issue β’ Identity β βββ example-com Google Cloud βββ secret β β βββ google-analytics β βββ team β’ β’ Static secrets (Key /Value) β βββ app1 Username & Password β β βββ paypal Vault β β βββ api-keys β β βββ google-analytics β’ β’ Nomad β β βββ paypal β βββ app2 AppRole β βββ app2 β βββ foo β βββ foo β’ β’ PKI (Certi f icates) βββ ssh β βββ creds GitHub βββ ssh β βββ erika β βββ erna β’ β’ RabbitMQ βββ transit β βββ creds MFA βββ decrypt β βββ team-1-key β’ β’ SSH β βββ erika βββ encrypt Okta βββ team-1-key β βββ erna β’ β’ TOTP RADIUS βββ transit β’ β’ Transit βββ decrypt TLS Certi f icates β βββ team-1-key βββ encrypt βββ team-1-key Quelle / Max Mustermann οΏ½ 64
Secret Management with Hashicorp's Vault βββ aws βββ aws β βββ creds β βββ admin β βββ developer β βββ creds βββ database β βββ creds β βββ admin β βββ clients Vault β secret β βββ contracts βββ pki β βββ developer β βββ issue β βββ example-com βββ database βββ secret β βββ team representation β βββ creds β βββ app1 Vault β β βββ api-keys β β βββ google-analytics β βββ clients-ro β β βββ paypal β βββ app2 β βββ clients-rw β βββ foo βββ ssh β βββ creds βββ pki β βββ erika β βββ erna β βββ issue βββ transit βββ decrypt β βββ broker β βββ team-1-key βββ encrypt βββ team-1-key βββ secret β βββ team β βββ app1 Vault β β βββ api-keys β β βββ google-analytics β β βββ paypal β βββ app2 β βββ foo βββ ssh β βββ creds β βββ developers β βββ admins βββ transit βββ decrypt β βββ team-1-key βββ encrypt βββ team-1-key Quelle / Max Mustermann οΏ½ 65
Secret Management with Hashicorp's Vault βββ aws βββ aws β βββ creds β βββ admin β βββ developer β βββ creds βββ database β βββ creds β βββ admin β βββ clients Vault β policies β βββ contracts βββ pki β βββ developer β βββ issue β βββ example-com βββ database βββ secret β βββ team β’ applied to β f ilesβ or β βββ creds β βββ app1 Vault β β βββ api-keys β β βββ google-analytics β βββ clients-ro β β βββ paypal β βββ app2 β βββ clients-rw β βββ foo βββ ssh βdirectoriesβ β βββ creds βββ pki β βββ erika β βββ erna β βββ issue βββ transit β’ support f ilesystem βββ decrypt β βββ broker β βββ team-1-key βββ encrypt βββ team-1-key βββ secret β βββ team wildcards β βββ app1 Vault β β βββ api-keys β’ control what a user can β β βββ google-analytics β β βββ paypal access β βββ app2 β βββ foo β’ get assigned after βββ ssh β βββ creds β βββ developers authentication β βββ admins βββ transit β’ policies of a token canβt βββ decrypt β βββ team-1-key βββ encrypt be changed βββ team-1-key Quelle / Max Mustermann οΏ½ 66
Secret Management with Hashicorp's Vault βββ aws βββ aws β βββ creds β βββ admin β βββ developer β βββ creds βββ database β βββ creds β βββ admin β βββ clients Vault β policies β βββ contracts βββ pki β βββ developer β βββ issue β βββ example-com βββ database βββ secret β βββ team β βββ creds β βββ app1 Vault β β βββ api-keys β β βββ google-analytics β βββ clients-ro β β βββ paypal β’ create c β βββ app2 β βββ clients-ro β βββ foo βββ ssh β βββ creds βββ pki β βββ erika β βββ erna β βββ issue β’ read βββ transit r βββ decrypt β βββ broker β βββ team-1-key βββ encrypt βββ team-1-key βββ secret β’ update β βββ team u β βββ app1 Vault β β βββ api-keys β’ delete d β β βββ google-analytics β β βββ paypal β βββ app2 β’ list l β βββ foo βββ ssh β βββ creds β’ deny d β βββ developers β βββ admins βββ transit βββ decrypt β βββ team-1-key β’ sudo βββ encrypt s βββ team-1-key Quelle / Max Mustermann οΏ½ 67
Recommend
More recommend