Skip to content

[WIP] Vault Eventing: Instant Secret Updates for Static and Dynamic roles. - #1295

Draft
Balaji2198 wants to merge 11 commits into
mainfrom
VAULT-42860/optimize-websockets
Draft

[WIP] Vault Eventing: Instant Secret Updates for Static and Dynamic roles.#1295
Balaji2198 wants to merge 11 commits into
mainfrom
VAULT-42860/optimize-websockets

Conversation

@Balaji2198

Copy link
Copy Markdown
Member

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.

@siyer-corp
siyer-corp force-pushed the VAULT-42860/optimize-websockets branch from 21aba44 to 8d23599 Compare July 1, 2026 07:32
siyer-corp and others added 5 commits July 1, 2026 13:06
* Enable instant updates for VDS

* Fix lease based events

* Fix Dynamic Secrets Integration tests. (#1279)

* Add rotation period to instant updates test assertions.

* Update VaultAuth configuration in instant updates test for dynamic secrets.

* Add db-events policy for database subscription capabilities.

* Refactor database policies to conditionally include event handling based on use_events variable.

* Add Instant updates integration tests (#1282)

* Add rotation period to instant updates test assertions.

* Update VaultAuth configuration in instant updates test for dynamic secrets.

* Add db-events policy for database subscription capabilities.

* Add lease event subscriptions and dynamic credential update test for instant updates.

* Refine instant updates test to focus on lease ID changes and remove unnecessary SecretMAC checks.

* Increase retry limit for instant updates dynamic credentials test to 60 seconds.

* Add integration test for instant updates watcher restart on VaultAuth change.

* Refactor instant updates integration tests.

* Refactor instant updates test to create separate VaultAuth instances for each subtest.

* Refactor integration tests for instant updates in VaultDynamicSecret.

* Update instant updates test to extend lease TTL and assertion window.

* Update instant updates tests to handle cluster name based on scale test condition.

* Update policy for DynamicCreds test

* Update db-events policy to include additional capabilities and event types.

* Update policy db-with-events

* Skip instant updates test for Vault versions below 2.0 due to WebSocket event requirements.

* Add X-Vault-Index Header Support for Stale-Read Protection and Event Reconciliation (#1285)

* Add support for X-Vault-Index header in Vault requests to ensure stale-read protection.

- Introduced HeaderVaultIndex for conditional forwarding on Performance Standbys.
- Enhanced event subscription logic to store vault_index for subsequent reconciliations.
- Added tests to verify correct handling of X-Vault-Index in various scenarios.

* Add support for custom headers in MockRecordingVaultClient Write method.

* Add tests for X-Vault-Index header handling in Vault reconciler.

* Add Changelog and update API reference doc.

* Update manifests files for the CRD changes.

* Refactor tests to use vsoconsts for vault index constants in static and dynamic secret reconciler tests.

* Reword TestVaultDynamicSecret_InstantUpdates description.

---------

Co-authored-by: Balaji <balaji.b@hashicorp.com>
…bscribers. (#1305)

* Add Prometheus metrics for active event watchers in Vault controllers.

* Add WebSocket metrics to monitor active connections and subscribers.
@siyer-corp siyer-corp changed the title Vault Eventing instant secret updates for static and dynamic roles. [WIP] Vault Eventing: Instant Secret Updates for Static and Dynamic roles. Jul 21, 2026
harshit-nema and others added 3 commits August 7, 2026 16:48
* Code added for requeue event once even loop exit, registry cleanup and orphaned registry detection

* Unit and integration tests added for requeueEvent, registry cleanup and orphaned registry detection

* Apply gofumpt formatting

* Removing parallel run of VSS registry tests

* Code added to close dead WebSocket before removal in getOrCreateWebSocket

* Code added to replace infinite retry with errorCount threshold in eventLoop

* Code modified to provide threshold for connection retry and recreate shared websocket after reconnect failure threshold is reached

* Requeue event, registry cleanup and orphan entry code added in VDS+VSS along with testcases

* Test added for vaultDynamicSecret in event_watcher_registry_test.go

* Comments updated

* Fixed WebSocket stop-notification ordering, atomicity, and delivery; eliminated subscriber double-delete race; narrowed the Client interface; deduplicated subscriber code; closed orphan detection gaps; and cleaned up tests.
* Perf: Parallelize VDS instant update integration tests.

* refactor: extract helper funcs for VDS instant update tests.

* Add await event watcher started before triggering rotation.

* Perf: Optimize Scale testing Infra for VDS. (#1317)

* perf: Share infra across parallel instant-update subtests.

* perf: Optimize Scale testing Infra for VDS Dynamic.

* Snapshot vds baseline before awaiting watcher start.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants