Interview Prep/DevSecOps/Tool Internals and Comparisons

How does SOPS work?

IntermediateConceptTool Internals and Comparisons
Answer

SOPS encrypts the values in YAML, JSON, ENV or INI files while leaving keys readable, so diffs and reviews still make sense. Each file gets a data key that encrypts the values; the data key is wrapped by one or more master keys: AWS KMS, GCP KMS, Azure Key Vault, age or PGP.

# .sops.yaml
creation_rules:
  - path_regex: secrets/prod/.*\.yaml
    kms: arn:aws:kms:ap-south-1:111122223333:alias/sops-prod
  - path_regex: secrets/dev/.*\.yaml
    age: age1qyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqszqgpqyqs7k7zq
sops --encrypt --in-place secrets/prod/app.yaml
sops secrets/prod/app.yaml   # decrypts into $EDITOR

Flux decrypts SOPS natively; Argo CD needs a plugin. Access control equals KMS key access.

All DevSecOps questions

More on Tool Internals and Comparisons