Moving Helm values.yaml into Git — is git-crypt a good way to handle secrets?

Hey all, looking for a sanity check on our approach.

Stack: AWS + Kubernetes. We deploy with plain helm install (no GitOps tool like Argo/Flux).

Current setup: Our Helm values.yaml has hardcoded secrets (env vars) in it. Right now this file lives on our Jenkins server, not in any repo.

The plan: We want to move values.yaml into our Git repo so we can version it properly. The obvious problem — we can’t commit hardcoded secrets in plain text.

Our idea: Use git-crypt to encrypt the file at rest in the repo, so secrets are scrambled on the remote and only unlock for people with the key.

Questions:

  • Any real-world gotchas we should know before committing to it?
  • Since we’re already on AWS, would you skip file encryption entirely and go with something like External Secrets Operator + AWS Secrets Manager? Or is that overkill for a small team? Also curious where SOPS (with AWS KMS) or Sealed Secrets fit in.

For context: we’re a small-ish team and just want a clean, low-friction way to keep secrets versioned without leaking them.

Appreciate any input :folded_hands:


Related discussions:

What's the best practice for user authentication?
ssl cert for *.mysite.com doesn't work without www.
ECS | Fargate | EFS
Trying to solve a difficult problem: What is the best way to ingest AWS Logs into elasticsearch? ETL Pipeline?
Kubernetes in production @ ShopGun
What is the difference between the Encrypted Data Key, the Data Encryption Key, and the Customer Data Key? (Not CMK)
Recommendations for keeping a public DNS secure in AWS.
Linux Kernel TCP SACK Denial of Service Issues (AWS-2019-005)
Any Boto3/API calls to get all permissions/policies assigned to a user?
Following the Juli 2020 ruling of the EU court that the EU/US Privacy shield is invalid: Will we be able to use AWS for customer projects in the near future?
docker container - simplest way to host?
I've run AWS Access Analyzer Policy Validation on all 837 AWS Managed Policies
Happy 10th Birthday – AWS Identity and Access Management
IPS/IDS in AWS
Standard Python Library for getting k8s tokens from AWS EKS
Announcing AWS CloudTrail Lake, a managed audit and security lake
AWS closed account w/ MFA causing problems with amazon.com account
Anyone use AWS SSO as their main identity provider?
MFA in AWS is just broken, hope they fix it soon
Amazon EKS now supports Kubernetes 1.22
Best Practices for AWS SSO Configuration
Inspector classic v new Inspector. Worth it?
what is the difference between the following two policies and why would you prefer one of the following
Your AWS security checklist
Authenticating to AWS the right way
Using AWS Shield Advanced protection groups to improve DDoS detection and mitigation
Does AWS have a service like Google Cloud Run?
We analyzed the AWS security posture of 600+ organizations and thousands of accounts (Datadog)
New – AWS CloudTrail Lake Supports Ingesting Activity Events From Non-AWS Sources | Amazon Web Services
AWS Notification Email: Update to AWS & GitHub OIDC (No Customer Action)
What were your reasons for migrating(or not) from ECS to EKS, or the other way around?
Open source solutions for automating AWS resource permissions falling short?
Recommend me companies doing AWS account security reviews please
Automated lockdown procedure (planning for an attack)
List of domain names to avoid phishing
How to assign a static IP address to my AWS Cloudshell?
AWS authentication from Non-EKS k8s cluster
AWS Trust Center: New Centralized Security Information
Built a fun MERN Chat App on EKS!
Anyone moved workloads to AWS Graviton? Did it really cut costs?
Securing OrganizationAccountAccessRole role
AWS Certificate Manager updates default certificate validity to comply with new guidelines
AWS career path
Question on a course - k8s and/or containerization
Passed my SAA, but seek advice
Interesting AWS news and articles from last week
After SAA-C03, should I get a different cert? (unemployed with 5YOE)
Help deciding on certifications
EKS skillbuilder courses
[Code: AWSSEP26 ] 23 Best Selling AWS Courses & Practice Exams : Python with AWS, Solutions Architect Professional, Associate, Cloud Practitioner, Developer Associate, CloudOps, Networking Masterclass, Business, Identity Management, Cloud Computing, Kubernetes at Udemy by Neal
Purchase my own ssl cert or use AWS ssl cert for my own domain?
Cloud FinOps Directory with 40 Providers
AWS cross account propagation
Simple script to detect AWS stale Security Groups.
DVC29 - Elastic Container Service for Kubernetes (EKS) on AWS
Look up Security Group names by id

For run time secrets you can use AWS secrets manager and for build time secrets you can use GitHub Secrets.

Why would you store secrets in values files anyway?

There are several ways you can go about it.

  1. The already mentioned AWS Secrets Manager + External Secrets Operator. It’s a good starting point, but you’re not getting “versioned secrets” you asked for. Plus, this combination comes at a price — secret manager charges for every stores secret.

  2. The same External Secrets Operator + AWS Parameter Store — a better combo, because Parameter Store is not prices the same way Secrets Manager is. Plus, it’s sort of easier to use its parameters versioning.

  3. SOPS.

SOPS

GitHub Secrets

They said they’re using Jenkins, so using GitHub secrets might be possible but I doubt they would want to use GitHub specifically just for secrets management.

This question is the right answer.

The main issue is who will be allowed to decrypt the secrets? All the dev laptops/workstations with the decrypted secrets will be a security issue. What you can do is use existing secrets in your charts and manage them with a separate workflow

Oh my gosh you are right - I read Jenkins and automatically assumed they were migrating away from it :joy:

Secrets manager key advantages: auto rotation with custom rotation logic, and being able to share them cross account. If you don’t need those, param store 100%

This was the exact reason I added the second item — people often buy Secrets Manager because of, well, the “secrets” part of the name.

However, if we talk about externally managed secrets, e.g. those you cannot rotate yourself, the added benefit of auto-rotation in Secret Manager does not cut it for you. You would most definitely rely on another method to obtain a secret from the issuer, such as logging into a management console or obtaining it from your license procurement department. In this case, an encrypted parameter in Parameter Store is your pick…

If you’re able to programatically rotate the secret — sure, use Secrets Manager. The downside is $0.40/secret/month + $0,05/10K API calls.

I’ve seen folks bundle multiple secrets into a JSON document and store it in the Secrets Manager to save costs, while they never rotated any parts of it automatically; it was always a fully manual process, often very error-prone.

I absolutely love my some SOPS plus there’s a Terraform provider.

The downside of SSM params is how they handle encryption and large JSON blobs. I’ve found it’s easier to to use Secrets Manager as a configuration store whenever possible though that really isn’t possible for K8s.

If they want infrastructure-as-code, you’re just moving the problem.

We also use both AWS and GitHub Secrets, but we don’t want ClicksOps and we require version control, (readily available) auditability, and four-eyes principles, so everything is still in Terraform, including the secrets. And for that we use git-crypt.

I use Flux with sops. You can configure flux to use an encrypted secrets with sops to apply templated values to helm release values.

Why are there secrets in your values file

Every sane chart I’ve seen just takes a secretRef or something where you point it at an actual K8s secret. And you can handle that with ESO or whatever.

Secrets Manager as a configuration store? For applications? If yes, why not use AppConfig?…

Honestly I’ll have to check it out. Thanks for the tip.

Sealed Secrets are IMO better for this

Use parameter store it’s all you need from secret manager for a fraction of the price

Stay far away from git-crypt. It encrypts the entire file into a binary blob, which turns any merge conflict on values.yaml into unresolvable hell. We lost 6 hours to a corrupted git-crypt merge conflict last year when two devs touched the same staging release. Plus, one missed .gitattributes config and you leak plaintext into git history permanently.

Use SOPS with AWS KMS instead. It encrypts only the values, keeping YAML keys readable for normal diffs.