-
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
K/V v2: add suport for lease_duration using ttl key #6274
Comments
duplicate of #6184 |
@briankassouf, I don't think this is a duplicate of #6184. At present, if one runs vault kv patch ttl=60s, you wind up with a value My goal is to populate @asaintsever, do you concur? |
@seh yes totally, for KV v2, a "ttl" secret value should end up in |
lease_duration is used in consul-template (https://github.com/hashicorp/consul-template/blob/master/dependency/vault_common.go#L126-L167) to wait next update. When enable secret and put data as following:
When I get from kv-v1, lease_duration is same value with
But I get from kv-v2, inspite of ttl field exists, lease_duration is 0.
https://github.com/hashicorp/vault/blob/master/sdk/logical/translate_response.go#L14-L46 K/V v1 inputs's Secret field inserted in following code: K/V v2 inputs's Secret field does'nt inserted. If K/V v1 and K/V v2 should be have lease_duration from ttl field, I ready to send a patch. |
Should this issue be reopened? @seh felt that this was not a duplicate of #6184, and I tend to agree, because that issue is about destroying the secret after the TTL, whereas this request is about providing equivalent support as v1 for the lease duration. @takaishi provided some ideas about how to address this, and was willing to put a PR together. Without support for this feature, I am reluctant to adopt kv-v2 because it doesn't give me the ability to auto-renew my secrets automatically (for example, when I want to use the vault agent injector sidecar). |
This has become a major issue for us as well. Is the |
Hello. Can this issue be re-opened, please? It was incorrectly closed by @briankassouf as a duplicate of #6184. |
Vault's KV2 engine does not return the `lease_duration` TTL value that is provided by the original KV1 engine. When this value is 0 or missing it effectively disables the caching support of the `VaultSecretProvider`. This commit adds support for configuring an optional default TTL to apply when the `lease_duration` value is 0. To maintain backwards compatibility the default value remains 0. Fixes lensesio#4 Ref: hashicorp/vault#6274
Requesting that this issue be re-opened also. That, or the documentation at https://www.vaultproject.io/docs/secrets/kv/kv-v1#ttls be updated to reflect v2 behaviour. Thanks. |
Hi folks - we hear you! I'll re-open this and engage the engineers in another discussion about it. Thanks for your patience! |
Hi, everyone! The Vault team has discussed this internally in order to identify a path forward. The The concept of deletion has been addressed via the We will keep this issue open and be sure to keep everyone updated with our status. We appreciate all of your feedback! |
How will this be made available through the API? Lease duration is made available on the data structure returned. How will API clients be able to access this value to determine how long to wait when polling secrets? |
How would TTL be expressed when creating/updating a secret? |
Any update on this limitation? I find myself reminded of this roughly every 70 days when letsencrypt certs roll over, are reloaded into vault, and then not updated by consumers. |
To handle K/V v2 lease I am using
|
That's a good shout. Unfortunately I'm running into this problem inside Nomad where that key isn't exposed. I've opened hashicorp/nomad#17423 to see if I can gain access to that key inside the nomad environment. |
Is your feature request related to a problem? Please describe.
Using K/V v2, which is enabled by default with Vault server in dev mode, adding a
ttl
key has no effect onlease_duration
attribute (remains 0). With K/V v1,ttl
key allows to set lease duration which is very handy. It seems that with K/V v2 we cannot benefit from this feature.Describe the solution you'd like
Same special handling of
ttl
key as we currently have in K/V v1 (see https://www.vaultproject.io/docs/secrets/kv/kv-v1.html#ttls)Describe alternatives you've considered
N/A
Explain any additional use-cases
Cannot use the versioned version of K/V (i.e. v2) if we want to set a ttl and have consul template refresh its template based on
lease_duration
value (and not vault token ttl). Stuck on K/V v1 for the moment.Additional context
N/A
The text was updated successfully, but these errors were encountered: