Skip to content

Instantly share code, notes, and snippets.

@wiggitywhitney
Created February 27, 2026 12:18
Show Gist options
  • Select an option

  • Save wiggitywhitney/8521adbd56611e89ef3a5425ce11aede to your computer and use it in GitHub Desktop.

Select an option

Save wiggitywhitney/8521adbd56611e89ef3a5425ce11aede to your computer and use it in GitHub Desktop.

Managing Secrets in Configuration Files with SOPS

Associated Thunder episode: Managing Secrets in Configuration Files with SOPS

Managing Secrets in Configuration Files with SOPS


Before SOPS (Secrets OPerationS)...

  • How to store sensitive data?
  • Declarative infrastructure becoming a thing
  • Problems sharing and storing config files containing secrets
  • Enterprise-grade solutions can be high effort and overkill

Helm plugin for SOPS to put encrypted secrets into Helm charts

What is SOPS?

SOPS is a tool that encrypts and decrypts files. It is a binary that you consume using the CLI.

Kustomize Generator called KSOPS to integrate SOPS — ex: encrypt K8s secret and store it in Git and use with GitOps.


Use Cases

What data do I want to share in a text file?

  • Store a SSH key
  • Checking sensitive data into Git — encrypt/decrypt at runtime
  • Storing and distributing passwords
  • Use SOPS as one interface for many key manager tools
  • Integrate DB passwords
  • Integrate secrets into CI/CD pipeline or GitOps

SOPS Integrations: Single Abstraction Across Multiple Tools

  • GPG Key (GNU Privacy Guard)
  • AGE file encryption — "Actually Good Encryption"
  • AWS KMS (Key Management Service)
  • GCP KMS
  • Azure Key Vault
  • HashiCorp Vault
  • ...and more!!!

SOPS can be used in almost ALL environments — cloud, on-prem, Kubernetes, anywhere!

SOPS is like GLUE to integrate tools and workflows.


How Do I Actually Use the Dang Thing?!

  • You can do everything within the SOPS CLI
  • CLI flags allow you to specify what backend to encrypt
  • Can go deeper and make a .sops.yaml file to configure SOPS without flags — this makes SOPS config shareable and reusable

SOPS Configuration Knobs:

  • Backend integrations — which key(s) to encrypt
  • Where to put encrypted/decrypted information — specifying values vs. encrypting everything
  • "I want to reencrypt this data"

Integration with GitOps:

  • Argo needs a config management plugin and then can use KSOPS, among other things
  • SOPS is natively built into Flux
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment