Open
Conversation
tboerger
approved these changes
Feb 9, 2021
Author
|
Thanks for the quick response and approval, @tboerger |
|
It's up to @bradrydzewski to give another review and merging the change. |
Author
|
Just following up on this; I know you have a lot on your plate @bradrydzewski and this is probably not super high on your list of "to-dos" to keep everything running :) |
Author
|
bumping @bradrydzewski |
lkubb
added a commit
to lkubb/drone-vault
that referenced
this pull request
Feb 14, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The following pull request corrects an issue where pulling secrets from Vault fails due to case-sensitive key referencing. At a high level, this issue means that an attempt by Drone to pull "username" when the key in Vault is "Username" will result in a "secret key not found" error.
Use Case
Lets assume we are attempting to pull a secret in vault which has the key "FOO" and value "BAR".
How To Fix This Issue
This issue can be fixed by performing a case-insensitive key lookup when querying the secret value from the "params" go map. The code changes proposed successfully mitigate this issue.
For testing purposes I have included a new unit test uppercase_secret.json which tests successfully pulling a secret when drone requests the value for key="USERNAME" and Vault includes a record where key="Username".
Additional Considerations
I could not think of any example/reason where a request for "USERNAME" when Vault is storing the key as "Username" would cause unintended consequences or impact. A secret in the form of a key/value pair should be represented with a unique key, therefor IMO "username" and "Username" should not be treated as separate values.