What is a safe approach to storing environment-specific config and secrets in Git?
IntermediateProductionSecurity: secrets, signing, access and supply chain
Answer
Keep config in Git, keep secrets out. For secrets that must be versioned (GitOps), encrypt them with SOPS (age or KMS keys) or use Sealed Secrets, or reference an external secrets manager through External Secrets Operator. Reviewers see changes to the key names but not the values.
sops --encrypt --age age1... secrets.yaml > secrets.enc.yaml
More on Security: secrets, signing, access and supply chain
What are the first things you do when a secret is committed to a repo?BeginnerHow do you prevent secrets from entering the repo in the first place?IntermediateWalk through purging a leaked secret from a 5 GB repo with 200 contributors.AdvancedWhy use OIDC federation for cloud credentials from GitHub Actions instead of stored keys?IntermediateWhat is your policy on signed commits and how do you enforce it?IntermediateWhat do signed commits not protect against, and what supply chain controls complement them?Advanced