-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: support sops decryption #1180
feat: support sops decryption #1180
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your contribution! This is really neat and thanks for being comprehensive with docs and tests! Will kick off the build and if it passes, will merge.
Looks like the build failed with
This looks like an error in sops? |
Thanks @yorinasub17 Are you able to post the whole build log to a gist and link to it in here? (redact anything "sensitive"). |
Since this is an open source repo, I think you should be able to see the build logs when you loginto circleci with your github account and click through to https://circleci.com/gh/gruntwork-io/terragrunt/4704 If not, here's the logs for the gpg key import step:
And the original logs I pasted is actually the only logs for the test. |
@yorinasub17 I have a strong suspicion I got bitten by the case explained here: getsops/sops#489 (comment) as I had generated a key / sub-key originally. I was able to reproduce the issue locally and get sops to fail decryption, but I did have to kill my GPG agent first. Strange. It's the first time using a gpg key with sops so I wasn't aware of that, typically I'd make use of KMS. I've updated the test GPG key and the encrypted files. 🤞 |
Thanks for digging in! I kicked off a build after I saw your commit, so hopefully this one works! |
That ✅is a beautiful sight 😄 |
Build passed, so will go ahead and merge + release this. Thanks again for your contribution! |
Wow! Thank you @js-timbirkett , this is a huge time-saving feature! |
Awesome. Falling in love with this feature. Thank you so much @js-timbirkett ❤️❤️❤️ |
Released in https://github.com/gruntwork-io/terragrunt/releases/tag/v0.23.18. Thank you @js-timbirkett! |
This PR is an initial attempt at #1179 - it enables users of sops to decrypt YAML or JSON files for use as inputs.
The issue of those initial secrets you need for bootstrapping and getting your infrastructure running is a contentious one. I've had engineers remark: "use vault", "use SSM", "use
kubectl create secret...
" and so on. But there is, a time when you don't have Vault, you don't want to manually manage the secret in SSM or Kubernetes. All you have is you, a secret or 2, Terraform, and an AWS account.sops_decrypt_file
attempts to help solve that problem.I took a fairly simplistic approach and return the contents of the entire file for the user to make use of
jsondecode
oryamledecode
rather than creating a function to return a single secret as once the file contents are decoded, you can access individual items specifically if you need to.I'm not precious over any naming, I haven't written any unit tests (yet) but I do have an integration test which works (after importing the dev / test key) and the docs are updated.
Any feedback would be greatly appreciated.
Thanks! ❤️