-
Notifications
You must be signed in to change notification settings - Fork 674
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
[BUG] Vault Secret Manager Plugin mishandles response for group_version="db"
#4005
Comments
@bimtauer can you help clarify this? With your recent PR we enabled support for "db" in vault. When injecting the secret we're explicitly choosing not to template rather than using the secret @EternalDeiwos very interested in your input as well. I don't have extensive experience integrating with Vault, want to make sure the is as seamless as possible, but also fully supportive of all use-cases. TL;DR is there an advantage to mounting "db" secrets as a dict (ie. |
This makes sense to me from how Vault works and how one would write a request to fetch credentials — you can’t request twice because they are a single-use secret, vault doesn’t actually store the credentials it generates, just enough to be able to extend the lease or revoke them. That being said, I am pretty sure that It’s not a problem if the secret provides a dict but then there needs to be a way to map the secret values to the input of the intended task or the feature is useless. This could be a fairly large feature that needs to be added to Flyte in order to fix a fairly small and apparently not often encountered bug. You could also refactor the tasks themselves to allow dict inputs, however you would still need the ability to map keys on Flyte’s side because Vault will only provide keys called |
@EternalDeiwos thanks for checking back in here. I appreciate the breakdown of the problem, it provides much clarity. Do you have a suggestion for a fix? IIUC we need a singular secret mount in the task decorator (encompassing both username and password) to support the With some guidance, is this something you might you be willing to contribute? |
@hamersaw I don't think I'll be able to make this contribution; however as for a suggestion, I think the best UX is going to be some way to resolve or map values within a secret to the parameter names expected by the downstream interface (e.g. Inevitably some secrets are going to return a dict and there should be some way to resolve and/or template those such that the Edit: It looks like we will have to move away from using the Vault plugin regardless due to other limitations around supplying different secrets to the same workflow in different domains; i.e. staging secrets to staging workflow, production secrets to production workflow, etc. |
Hello 👋, this issue has been inactive for over 9 months. To help maintain a clean and focused backlog, we'll be marking this issue as stale and will engage on it to decide if it is still applicable. |
Would still like to see this fixed |
Describe the bug
Vault
kv2
works well enough and the service allows deep referencing of specific values in thegroup
parameter past the.../data/...
part of the path. This is not the case forgroup_version="db"
where the resulting credentials cannot be deeply referenced. See documentation.The difficulty is when I specify a secret for a
SQLAlchemyTask
...... the value returned by
current_context().secret.get()
in this context is a dict which looks like:This results in errors being produced because the task is expecting a string value for username and password respectively and not a dict. I suspect this is because the result of the API call to vault is not flat and rather is nested under the
data
property name.Expected behavior
Dynamically generated credentials from Vault Database Engine should be passed to SQLAlchemy in the format it is expecting (i.e. strings not a dict).
Additional context to reproduce
Running the workflow produced this error message (carefully redacted):
Screenshots
No response
Are you sure this issue hasn't been raised already?
Have you read the Code of Conduct?
The text was updated successfully, but these errors were encountered: