-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Transit encrypt batch does not honor key_version #10232
Comments
We're running in to the same problem. We have a key with three versions. Regardless of the version, the encryption is always done with the latest key. However, if using the Vault UI, it does the right thing (i.e. it uses the correct key version) |
that is because the ui does not use a batch input. here is what it does:
and this should work too:
|
One of the users of VaultSharp (a .NET Client for Vault) hit the same issue of key_version type casting error, when used inside a batch item. This comment from me has some analysis on the cause of the casting exception in Vault. rajanadar/VaultSharp#184 (comment) The only workaround for clients right now, is to loop through manually and encrypt 1 item at a time (what the vault UI does to not encounter this issue). Batch encrypt won't work if you need a non-latest key version. Any updates, Vault team? FYI @bentdan |
* fix(secret/transit): #10232 Transit encrypt batch does not honor key_version * add changelog for 11628
* fix(secret/transit): #10232 Transit encrypt batch does not honor key_version * add changelog for 11628
Thanks everyone. We've merged the fix for the next major release as well as the next 1.7 point release. |
* fix(secret/transit): #10232 Transit encrypt batch does not honor key_version * add changelog for 11628
* fix(secret/transit): #10232 Transit encrypt batch does not honor key_version * add changelog for 11628 Co-authored-by: rerorero <[email protected]>
* Fix: Transit encrypt batch does not honor key_version (#11628) * fix(secret/transit): #10232 Transit encrypt batch does not honor key_version * add changelog for 11628 * Try a 5s request timeout * Pin aerospike container image to a known working tag. (#11677) Co-authored-by: rerorero <[email protected]> Co-authored-by: Nick Cabatoff <[email protected]>
Describe the bug
I create a transit key for encryption, rotate it, and attempt to encrypt a batch with key_version=1.
I expect to receive a cipher
vault:v1
. instead I get a v2.To Reproduce
Steps to reproduce the behavior:
If I try to move the key_version back into the batch input item:
Then I get:
Expected behavior
Should return a v1 cipher.
Environment:
vault status
): 1.5.4vault version
): 1.3.0Additional context
was working in 1.2.2.
also
key_version
used to be supported in thebatch_input
. now it is one level up, meaning that there could be only one version for the entire batch. is that correct?in the previous instructions, replace payload with:
and execute
curl --header "X-Vault-Token: s.NKjYBQxjieOVuIviBsKqMi6r" --request POST --data @payload.json http://127.0.0.1:8200/v1/transit/encrypt/my-key
.then you get as expected a v1 cipher:
The text was updated successfully, but these errors were encountered: