-
Notifications
You must be signed in to change notification settings - Fork 133
Generalize VaultStaticSecret eventing to support future dynamic secrets #1146
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
base: feature/vso-event-notifications-dynamic-secrets
Are you sure you want to change the base?
Generalize VaultStaticSecret eventing to support future dynamic secrets #1146
Conversation
3c8ce0f to
0068246
Compare
…-updates-database-secrets' into VAULT-40343/instant-updates-database-secrets
…-updates-database-secrets' into VAULT-40343/instant-updates-database-secrets
tvoran
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From the example logs it looks like this is responding to credential generation and rotate-root. I think for dynamic secrets, this should really only care about lease revocation? Like if the lease for the dynamic credentials was revoked on the Vault side.
The credentials were generated by VSO, and IIRC it would've already re-queued the VDS object based on the ttl of the lease, so I don't think VSO should respond to that event. And I'm not following why VSO would want to react to the root credentials being rotated, since those are what Vault uses to connect to the database, and not a secret VSO would have access to.
Co-authored-by: Theron Voran <[email protected]>
…-updates-database-secrets' into VAULT-40343/instant-updates-database-secrets
make generate manifests revert test file since tests are being added in another PR update controller changes update event path code clean up make genereate manifests Update Secret Struct Name update secret type to VaultStaticSecretConfig changes for global event listener updates Remove unused stubVaultClient event methods Add joinVaultPath helper to build Vault paths Trim leading/trailing slashes and skip empty segments when joining update tests make fmt
e1dccc6 to
cb21eea
Compare
abstract the Vault websocket client and connection.
…AULT-40343/instant-updates-database-secrets
…-updates-database-secrets' into VAULT-40343/instant-updates-database-secrets
The original code I had here was a simple skeleton that would log out all of the events that occur on a secret. The actual instant updates on dynamic secrets were included in #1159. However, I believe I found a better way to re-use the code from the |
Description
With the introduction of Vault event notifications, VSO can now stream events from Vault in real time, enabling near-immediate updates to static secrets when they are modified or deleted. We plan to extend this capability to dynamic secrets as well.
Because the core event-streaming logic in VSO is largely shared between VaultStaticSecret and VaultDynamicSecret, this PR refactors and generalizes portions of the existing static-secret eventing implementation. These changes lay the groundwork for supporting real-time updates for dynamic secrets without altering current behavior. The PR that introduces instant updates for dynamic secrets is located here. Testing has been done on static secrets to ensure behavior remains consistent.
Setup KIND cluster with a kv secret and event notifications enabled
VaultConnection CRD
VaultAuth CRD
VaultStaticSecret CRD
Manual Testing
Get the Secret Stored in k8s To Confirm The Original Value of the Secret
Perform an update to the password kv store in Vault and ensured that the password changed in k8s
Perform a rollback to confirm that the secret reverts to the original on a near-instant basis
Perform deletion of the username field and confirm that it has been removed from k8s on a near-instant basis
PCI review checklist
I have documented a clear reason for, and description of, the change I am making.
If applicable, I've documented a plan to revert these changes if they require more than reverting the pull request.
If applicable, I've documented the impact of any changes to security controls.
Examples of changes to security controls include using new access control methods, adding or removing logging pipelines, etc.