-
Notifications
You must be signed in to change notification settings - Fork 488
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
remote.vault: introduce component to retrieve secrets from Vault #3428
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.
I prototyped this a long time ago and finally got around to pushing it now. Leaving comments for patterns that have changed in our documentation structure.
949c053
to
0303314
Compare
The remote.vault component retrieves secrets from Vault.
Add end-to-end tests using testcontainers-go. This required a lot of (unfortunate) go.mod trickery.
This reverts commit d42c71c.
k3d_client "github.com/k3d-io/k3d/v5/pkg/client" | ||
config "github.com/k3d-io/k3d/v5/pkg/config" | ||
k3d_cfgtypes "github.com/k3d-io/k3d/v5/pkg/config/types" | ||
k3d_config "github.com/k3d-io/k3d/v5/pkg/config/v1alpha4" | ||
k3d_log "github.com/k3d-io/k3d/v5/pkg/logger" | ||
k3d_runtime "github.com/k3d-io/k3d/v5/pkg/runtimes" | ||
k3d_docker "github.com/k3d-io/k3d/v5/pkg/runtimes/docker" | ||
k3d_types "github.com/k3d-io/k3d/v5/pkg/types" | ||
k3d_version "github.com/k3d-io/k3d/v5/version" |
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.
These had to be updated to sort out dependency hell 😬
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.
Haven't put it to work versus an actual Vault instance to be honest; but looks good except for some minor points.
} | ||
|
||
// AuthAWS authenticates against Vault with AWS. | ||
type AuthAWS struct { |
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.
Seems that upstream passes some default values, should we follow suit? Also, there's a withNonce method we're not using, not sure if it was left out on purpose.
https://github.com/hashicorp/vault/blob/api/auth/aws/v0.4.0/api/auth/aws/aws.go#L59-L62
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.
I left nonce
out on purpose, I don't think it makes sense to set a static nonce for the lifetime of the component, since the idea of a nonce is that it's used just once.
Co-authored-by: Paschalis Tsilias <[email protected]>
Co-authored-by: Paschalis Tsilias <[email protected]>
Co-authored-by: Paschalis Tsilias <[email protected]>
Co-authored-by: Paschalis Tsilias <[email protected]>
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.
Found some issues with attr naming and questions about naming.
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.
Awesome LGTM
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.
The remote.vault component retrieves secrets from Vault. Co-authored-by: Paschalis Tsilias <[email protected]>
The remote.vault component retrieves secrets from Vault. Co-authored-by: Paschalis Tsilias <[email protected]>
The
remote.vault
component retrieves secrets from Vault. The initial implementation is scoped to only retrieving secrets from the KVv2 store, but it should be flexible enough to support logical database stores in the future.remote.vault
supports a few different authentication methods, all from the Vault API module:Authentication tokens are automatically refreshed in the background if they have a lease or are renewable.
Currently, the entire set of data retrieved from Vault is treated as a secret, and there is no way to mark a key from the data as non-sensitive. In the future, this may be handled by some kind of function to convert a secret into a string, or a configuration block in the component to list a subset of data field names as non-sensitive.
When reviewing, note that the prototype for this one started in the extremely early days of Flow (e.g., pre-v0.28). There may be best practices I'm not following, and didn't catch in my self-review. If you notice anything out of place, please let me know.
Sorry about the size of this one 😞