Skip to content
This repository has been archived by the owner on Nov 23, 2024. It is now read-only.

helm secrets install ... deploys encrypted values #95

Closed
alexmbird opened this issue Jan 23, 2019 · 2 comments
Closed

helm secrets install ... deploys encrypted values #95

alexmbird opened this issue Jan 23, 2019 · 2 comments

Comments

@alexmbird
Copy link

I have helm-secrets setup to encrypt secrets with sops. My .sops.yaml looks like this:

creation_rules:
  - path_regex: xyz-secrets.yaml$
    kms: arn:aws:kms:us-east-1:01234:key/abcd-01234-...

  # Catchall to raise an error for unmatched secrets
  - pgp: "nonexistent-key-will-fail-for-unmatched"

I've successfully created and encrypted xyz-secrets.yaml. I'm able to helm secrets [edit|view] it and the contents look as I would expect them to.

When I try to helm secrets install or helm secrets upgrade my chart it completes successfully and the resources in k8s are created. However the values deployed to the cluster have not been decrypted and all begin with ENC[AES256_GCM,data.

In case it helps here are the versions I'm running:

$ helm plugin list
NAME   	VERSION	DESCRIPTION
secrets	2.0.0  	This plugin provides secrets values encryption for Helm charts secure storing
$ sops --version
sops 3.2.0 (latest)

And here's the exact command (under the fish shell) I deployed with:

$ env AWS_PROFILE=myprofile \
         helm secrets install                        \
           --name=my-release-name               \
           --namespace=prod                          \
           -f helm_values/xyz-values.yaml        \
           -f helm_values/xyz-secrets.yaml       \
           del-shared-config

It looks like helm-secrets is failing to detect that xyz-secrets.yaml should be decrypted. Am I using it incorrectly or have I discovered a bug in KMS support?

@alexmbird
Copy link
Author

I've gotten to the bottom of this. In case anyone else encounters the same - the problem was that I named my secrets file xyz-secrets.yaml and by convention helm-secrets only treats files named precisely secrets[.something].yaml as containing secrets. Values from others, even those containing a valid sops: section, will be deployed verbatim. Confusingly sops will happily encrypt/decrypt these files, so the problem only becomes apparent at chart deploy time.

@schollii
Copy link

schollii commented Jul 23, 2019

Yes this is a real annoyance. I created ticket #128 for this. Seems like the fix should be really easy to allow additionally secrets-something which is more intuitive for describing the secrets file.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants