Software Development Community Question

How to handle secrets securely in a public GitOps repository without leaking credentials?

Posted on 2024-05-05 • In Software Development • By Christopher Evans

The biggest hurdle for our GitOps adoption is secret management. Since Git is our "Source of Truth," we can't just commit plain-text API keys or DB passwords. We’ve looked at Sealed Secrets, but it feels a bit clunky for a fast-moving team. What are the modern best practices for integrating HashiCorp Vault or AWS Secrets Manager with a pull-based GitOps workflow in 2024? We need a way to keep secrets encrypted in Git but decrypted in the cluster.

3 Answers 18,936 Views

All answers to this question 3 Answers

Patricia Wilson Answered on 2024-05-08
Answered

The industry is moving heavily toward the External Secrets Operator (ESO). Instead of trying to encrypt secrets inside Git (like Sealed Secrets or SOPS), ESO allows you to keep your secrets in a dedicated provider like HashiCorp Vault or AWS Secrets Manager. In your Git repo, you only store a "SecretStore" and an "ExternalSecret" manifest. The ESO controller running in your cluster then fetches the actual values from Vault and injects them as standard Kubernetes Secrets. This keeps your Git history clean of sensitive data and aligns perfectly with the "declarative everything" principle of GitOps.

Robert Martinez Answered on 2024-05-10
Answered

Have you considered using Mozilla SOPS with a KMS key? It allows you to keep the files encrypted in Git but still readable by the GitOps controller.

William Taylor Commented on 2024-05-12
Commented

We tried SOPS, but managing the GPG keys across a large team became a nightmare. We really need a solution that integrates with our existing IAM roles in AWS so we don't have to manage another layer of identity. Does the External Secrets Operator you mentioned support IAM roles for service accounts (IRSA) to make the authentication process seamless?

We just use the Vaul Answered on 2024-05-14
Answered

We just use the Vault Agent sidecar pattern. It’s not strictly "GitOps" in the sense that the secret isn't in Git, but it's very secure for dynamic secrets.

Christopher Evans Commented on 2024-05-15
Commented

While the sidecar works, it adds a lot of overhead. I think Patricia’s suggestion of ESO is the most "GitOps-friendly" way to bridge the gap between Git and Vault.

Write a Comment

Your email address will not be published. Required fields are marked (*)

Join the LearnersEra Community

Ask questions, share knowledge and learn from professionals across technology, project management and certification topics.

Change Country and Nearest City

Select your country and nearest city to see courses available in your region.