-
Notifications
You must be signed in to change notification settings - Fork 879
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
added encrypted-regex option #509
Conversation
Thanks for the detailed comment explaining your use case and what you've tried. My only concern with this is that it complicates the CLI and code a bit. I'd like to see the feedback of @ajvb as well Julien also had this concern but I don't think it applies here as it's entirely a new flag. |
…fix, ecnrypted-suffix, and encrypted-regex
Thanks for your consideration. I can see the case for multiple instances of encrypted-suffix (or even something more explicit like encrypted-key). I implemented encrypted-regex because it was the shortest path to getting the functionality I need. Supporting multiple flag instances and []string would require much more significant refactoring of the existing code. |
Caught an issue with config_test.go. I didn't realize that "go test" didn't run all the tests -- had to run ./test.sh to get all tests running, which exposed my mistake. |
@ajvb: based on the number of people who've been active on related issues, I'd say this feature is useful enough to be added to sops. Let me know if you have any concerns, otherwise I'll merge it. |
Co-Authored-By: Adrian Utrilla <adrianutrilla@gmail.com>
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.
Looks like merging this broke some tests |
It actually didn't, that seems unrelated because when reverting this, they still fail. |
Our team would like to use sops to protect kubernetes secrets in YAML files.
Here's what we want to do:
sops decrypt
and pipe straight tokubectl apply
.Here's what we've tried:
None of these were satisfactory. So I added a new option:
encrypted-regex
, which lets you encrypt only those values whose keys match the given regular expression. With this option, you can do this:This will encrypt our data and stringData values, but nothing else.
I know there was an objection to PR 385 (#385) last year on the grounds that the behavior should be moved into the library. I am hoping that you won't view this PR the same way. I'm not sure I have the resources for a deep dive into the sops codebase. But this small change I'm making brings (IMHO) tremendous value to the product wrt kubernetes secrets files.