Skip to content
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

Support parseutil.ParsePath for sensitive values in wrapper configs #272

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

sgmiller
Copy link
Collaborator

@sgmiller sgmiller commented Jan 10, 2025

Quite a few operators have asked for the ability to pull sensitive values into seal/managed key configs from separate files, feeling env vars or direct config isn't secure. ParsePath gives them the option to get values from a separate file while being non-invasive to existing configs.

@sgmiller sgmiller requested a review from a team January 10, 2025 20:58
@sgmiller
Copy link
Collaborator Author

Will subsequently update the go.mod deps to a tagged version of go-kms-wrapping/v2

@sgmiller sgmiller marked this pull request as draft January 10, 2025 21:01
@sgmiller sgmiller marked this pull request as ready for review January 10, 2025 21:31

func ParsePaths(fields ...*string) error {
for i := 0; i < len(fields); i++ {
if newVal, err := parseutil.ParsePath(*fields[i]); err != nil {
Copy link
Contributor

@stevendpclark stevendpclark Jan 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this trap errors.Is(err, ErrNotAUrl) and not return it leaving whatever the field value was previously?

I'm just wondering if we considered with these little tidbits but all three are me trying to poke holes and I don't feel strongly about them.

  1. If we were given any values that started or ended with spaces they will no longer work as ParsePath will trim them.
  2. It's a little unfortunate that with env:// values we don't get an error back saying it didn't exist which may be hard for operators to diagnose connection issues in the future, but we do for file based schemas
  3. Obviously if the values being passed in had values beginning with file:// or env:// that were for some reason meant to be passed to the underlying wrapper there is no way out now.

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

Successfully merging this pull request may close these issues.

2 participants