-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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 engine named key upsert behavior is not consistently documented and highlighted. #10397
Comments
Not to disparage this issue, this indeed may need some thought. But I wanted to point out this is only if the user has "create" on the path. You can assign only "update" to your policies to prevent this from happening. |
I think the current documentation calls this out:
Hey @andersonm-1 do you agree & ok to close? |
Hi @aphorise . I would prefer to have an explicit mention in the Usage section under the "Encrypt some plaintext data using the /encrypt endpoint with a named key" item, something like: |
I hear your preference but the only issue with adding it in the CLI documentation area speficially for tranist is that it would then make it an exception among the other sections which do not detail policy capabilities - those are all done in the API. The Docs tend to give you a quick guide / access via CLI using a prividilged token (like an admin / root token). What's more the policy section is also calling attention to this for all mounts in the concepts:
@andersonm-1 - please consider closing if you agree. PS - there's also been
|
https://www.vaultproject.io/docs/secrets/transit#usage describes key usage flow as:
However, and as documented in https://www.vaultproject.io/api-docs/secret/transit#encrypt-data , when encrypt endpoint is called, "if the user has the create capability for this endpoint in their policies, and the key does not exist, it will be upserted with default values (whether the key requires derivation depends on whether the context parameter is empty or not)."
This behavior is dangerous. If an authorized user is trying to encrypt with an existing key and by mistake sends a name of a non-existent key, then his data is encrypted with a key different from the one he expects. When the user later tries to decrypt, he isn't able to unless he recreates the same mistaken name.
If this is the accepted behavior, then at least it should be very well documented and highlighted.
The text was updated successfully, but these errors were encountered: