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

VaultDynamicSecrets do not revoke lease when associated kubernetes secret is deleted #935

Open
dcaputo-harmoni opened this issue Sep 27, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@dcaputo-harmoni
Copy link

Describe the bug
When the kubernetes secret associated with a VaultDynamicSecret is deleted, the VSO requests a new lease and recreates the secret with the newly leased credentials. But the VSO does not revoke the previous lease before doing so, resulting in orphaned leases. Since the kubernetes secret is the only place that these credentials are used, it is effectively a proxy for the lease - and deleting it should revoke the lease. Or at a minimum, there should be an option to revoke the lease on secret deletion.

To Reproduce
Steps to reproduce the behavior:

  1. Deploy a VaultDynamicSecret
  2. Delete the associated kubernetes secret
  3. A new lease will be obtained and a new kubernetes secret will be created
  4. The previous lease will remain in place
@dcaputo-harmoni dcaputo-harmoni added the bug Something isn't working label Sep 27, 2024
@dcaputo-harmoni
Copy link
Author

One further thought on this - it could behave just like the revoke: true flag within the VaultDynamicSecret spec, however the trigger would also encompass deletion of the underlying kubernetes secret. It could be encompassed within the revoke setting (where setting to true triggers a revoke on either the VDS deletion or secret deletion), it could be a separate boolean setting such as revokeOnSecretDeletion, or make revoke a string or array setting that allows specifying which triggers would revoke - VDS, secret or both.

@benashz benashz added enhancement New feature or request and removed bug Something isn't working labels Sep 27, 2024
@benashz
Copy link
Collaborator

benashz commented Sep 27, 2024

Thanks @dcaputo-harmoni, that's a good call out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants