Skip to content
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

[FEATURE REQUEST] Cache and manage Vault leases #63440

Closed
lkubb opened this issue Jan 9, 2023 · 0 comments · Fixed by #62684
Closed

[FEATURE REQUEST] Cache and manage Vault leases #63440

lkubb opened this issue Jan 9, 2023 · 0 comments · Fixed by #62684
Labels
Feature new functionality including changes to functionality and code refactors, etc. needs-triage Vault

Comments

@lkubb
Copy link
Contributor

lkubb commented Jan 9, 2023

Is your feature request related to a problem? Please describe.
Vault secret backends other than KV typically issue dynamic secrets bound to leases, which are valid for a certain amount of time, for example database credentials or X.509 certificates. If one manages configuration using those secrets, there is currently no easy inbuilt way to

a) avoid requesting a new secret during every template rendering run
b) renew existing leases.

Describe the solution you'd like
Introduce a lease store utility than can be used by secret backend-specific modules to cache leases and manage their renewal. It should consider the currently active token, since leases are bound to it.

Note that this is a feature request for a utility to be used by future modules, not sure if that's a thing. vault.read_secret/vault.write_secret/... essentially just do GET/POST/... requests to the Vault server, but are written with the KV backend in mind, which does not issue leases.

Describe alternatives you've considered
Since this is part of a large Vault integration overhaul, none in detail.

  • Easy: Don't care that superfluous secrets are hanging around and states are not idempotent.
  • Afaik, this should theoretically work with vault.read_secret/vault.write_secret, so there is probably some Jinja that could manage the cache. Both would not be bound to the active token though, so would need to check the validity on the remote server every time or risk failure. Essentially, it would require implementing this feature in Jinja or a custom execution module.
@lkubb lkubb added Feature new functionality including changes to functionality and code refactors, etc. needs-triage labels Jan 9, 2023
@OrangeDog OrangeDog added the Vault label Jan 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature new functionality including changes to functionality and code refactors, etc. needs-triage Vault
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants