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

Kara de la Marck

Kara de la Marck

GitOps, Kubernetes, and Secret Management

GitOps uses Git as the “single source of truth” for declarative infrastructure and enables developers to manage infrastructure with the same Git-based workflows they use to manage a codebase. Having all configuration files version-controlled by Git has many advantages, b
ut best practices for securely managing secrets with GitOps remain contested. Join us in this presentation about GitOps and secret management. Attendees will learn about the pros and cons of various approaches and why the Jenkins X project has chosen to standardize on Kubernetes External Secrets for secret management.

Kara de la Marck

October 07, 2020
Tweet

Other Decks in Programming

Transcript

  1. Kubernetes GitOps: Git @KaraMarck Git is the single source of

    truth for the desired state of the whole system. Declarative specification for each environment, in Git.
  2. Kubernetes @KaraMarck Kubernetes deployments: Automation — automates the process of

    applying changes Convergence — continually, until success Idempotence — repeated convergence actions have same result Flux jx-git-operator
  3. Kubernetes Secret Management What is a secret? • data to

    protect • username/password • SSH keys, API keys • TLS certificates @KaraMarck
  4. Kubernetes Kubernetes Secrets Built-in Kubernetes object • Name of secret

    • Type of secret (optional) • Map of field names to sensitive data (base64 encoded) @KaraMarck
  5. Kubernetes @KaraMarck Git was not built to hold secrets Collaborative

    tool, makes it easy to view and review each other’s code No granular, file-level access controls Distributed git repos
  6. Kubernetes @KaraMarck Comedic Interlude: Determining Guidelines is a Difficult Task

    https://www.youtube.com/watch?v=JKhOFKCOH5M Political Skit from The Great British Bake Off, starring Matt Lucas.
  7. Kubernetes @KaraMarck If you do really want to store secrets

    in Git, use Sealed Secrets Secret is encrypted into a Sealed Secret. One challenge is the encryption key. bitnami-labs/sealed- secrets
  8. Kubernetes Bake Secrets into Container Image @KaraMarck Secret data directly

    copied into container image as part of the build process. Pros: git no longer a security concern. Image can be run anywhere. Cons: Container image sensitive. Secret not flexible; can’t be rotated.
  9. Kubernetes @KaraMarck Rules: #1 Don’t store raw Kubernetes Secrets in

    Git Don’t Bake in a Tent Don’t Bake in a Tent #2 Don’t “bake” sensitive data right into container images
  10. Kubernetes @KaraMarck Rules: #1 Don’t store raw Kubernetes Secrets in

    Git Don’t Bake in a Tent Don’t Bake in a Tent #2 Don’t “bake” sensitive data right into container images
  11. Kubernetes @KaraMarck External Secret Management Systems • HashiCorp Vault •

    Google Cloud Secret Manager • AWS Secrets Manager • Microsoft Azure Key Vault • Alibaba Cloud KMS Secret Manager
  12. Kubernetes @KaraMarck Open Sourced by GoDaddy. Enables secure retrieval of

    secrets stored in external secret management systems and securely adds secrets to your cluster. Extends the Kubernetes API by adding an External Secrets object, which declares how to fetch external secret data, and a controller, which converts all External Secrets to Secrets. Kubernetes External Secrets
  13. Kubernetes Kubernetes External Secrets @KaraMarck Source: https://github.com/godaddy/kubernetes-external-secrets 1.Controller fetches ExternalSecrets

    using the Kubernetes API 2. Controller uses ExternalSecrets to fetch secret data from external providers 3. Controller upsert Secrets 4. Pods can access Secrets normally
  14. Kubernetes @KaraMarck Kubernetes External Secrets A single way to manage

    secrets which supports major secret management systems. jx-secret, command line tool for working with Kubernetes External Secrets.
  15. Kubernetes @KaraMarck 3 Alpha Docs: Intro Blog Post Overview and

    architecture Getting Started Blog Post on Octant Community: Office Hours Slack Discourse Hacktoberfest
  16. Kubernetes @KaraMarck External Secret Management Systems • HashiCorp Vault •

    Google Cloud Secret Manager • AWS Secrets Manager • Microsoft Azure Key Vault • Alibaba Cloud KMS Secret Manager
  17. Kubernetes @KaraMarck Rules: #1 Don’t store raw Kubernetes Secrets in

    Git Don’t Bake in a Tent Don’t Bake in a Tent
  18. Kubernetes @KaraMarck Kara de la Marck Open Source Community Manager,

    Cloudbees Director, codebar GitHub: MarckK LinkedIn: Kara de la Marck Twitter: KaraMarck Thank you!