Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Hands-on with Vault on Kubernetes

Hands-on with Vault on Kubernetes

This is the preamble for a hands-on workshop on Vault, a single binary secrets management system, to build a secrets management system for a production Kubernetes environment from scratch.

Initially presented at OSCON 2019.

Rosemary Wang

July 16, 2019
Tweet

More Decks by Rosemary Wang

Other Decks in Technology

Transcript

  1. ▪ Explain why Vault on Kubernetes ▪ Deploy a Vault

    cluster on Kubernetes. – Set up for high availability – Demonstrate (some) production hardening approaches ▪ Retrieve secrets from Vault for an application. – Dynamic retrieval – Native Kubernetes integrations Objectives 3
  2. Orchestrates, organizes, and manages containers. ▪ Resource Definitions extend the

    Kubernetes API ▪ Definitions specified in JSON or YAML ▪ Consists of master and node architecture What is Kubernetes? 5
  3. Pods are grouping of containers, volumes, and networking. Deployment maintains

    the desired number of application pods. StatefulSet provides sticky identity for pods that require some preservation of state. DaemonSet deploys a pod per node. Useful Constructs 7
  4. Encoded but stored in plaintext, with little access control or

    management. Need a secrets manager. Options include: ▪ Public Cloud Key Management Service ▪ HashiCorp Vault Kubernetes Secrets 8
  5. Manages secrets & protect sensitive data. ▪ Secure, store, and

    control access ▪ For tokens, passwords, certificates, and encryption keys ▪ Has a UI, CLI, and HTTP API What is Vault? 10
  6. 11

  7. ▪ Alternative to plaintext secrets ▪ Distributed ▪ Declarative policies

    for access control ▪ Eases Vault cluster lifecycle management ▪ Manages secrets lifecycle (rotation, revocation) ▪ Can be sidecar for application (lower latency) Why on Kubernetes? 12
  8. ▪ Secret is anything used for authentication and authorization –

    Tokens – Passwords – Certificates ▪ Sensitive is anything that is confidential – SSN, Credit Card, Email, PII, etc Secret 15
  9. When starting, Vault is sealed. ▪ This keeps data encrypted

    with a master key. ▪ It’s split into shards using Shamir’s Secret Sharing algorithm. Seal 16
  10. To retrieve secrets, we need to unseal Vault. ▪ This

    means reconstructing the master key. ▪ Needs enough shards in order to properly unseal. Unseal 17
  11. We mitigate the attack surface with ephemerality. ▪ Data has

    Time to Live (TTL), listed in a lease. ▪ After TTL has expired… – Lessee must renew – OR Vault automatically revokes by invalidating secret Lease, Renew, & Revoke 18
  12. Authenticates an identity. ▪ Can have dynamic tokens created from

    auth methods. ▪ One or more policies can be attached to tokens. ▪ There is a root token, the one token to rule them all. USE WITH CAUTION. Tokens 19
  13. Declaratively grants or forbids access to paths and operations. Policies

    path "secret/*" { capabilities = ["create", "read", "update", "delete", "list"] } 20
  14. Material is mostly cloud provider agnostic. ▪ Need easy way

    to get (larger) Kubernetes clusters ▪ Variations in workstations = tough for workshops ▪ Auto-unseal requires key management service Credit to Seth Vargo’s workshop for Vault on GKE. Why are we using GCP? 22
  15. Patterns in this workshop can be extended or dismissed. The

    material in this workshop requires additional work for complete production hardening (like process for revoking the root token.) Disclaimer 23
  16. Go to https://console.cloud.google.com ▪ Google Cloud Platform account? ▪ Project

    with Owner access? ▪ Google Cloud Shell? Pre-Flight Checklist 24
  17. 27

  18. © 2018 HashiCorp Thank you! Mishra (@build1point0) & Rosemary (@joatmon08)

    https://github.com/hashicorp/hands-on-with-vault-on-kubernetes 28