[KeyManager] Implement heartbeat mechanism#752
Open
NilanjanDaw wants to merge 3 commits intogoogle:mainfrom
Open
[KeyManager] Implement heartbeat mechanism#752NilanjanDaw wants to merge 3 commits intogoogle:mainfrom
NilanjanDaw wants to merge 3 commits intogoogle:mainfrom
Conversation
…ECTION_VM support
This commit introduces the foundational infrastructure for the Key
Management Agent (KMA), enabling the KeyManager to run as a standalone
service independent of the main launcher. It establishes the
architectural groundwork for the KEY_PROTECTION_VM security milestone by
supporting distinct service roles (WSD and KPS) and multiple key
protection mechanisms within a unified entrypoint.
Key Changes
- Unified Agent Launcher: Introduced keymanager/cmd/agent, a
standalone entrypoint that replaces the previous WSD-only command.
It supports both WSD (Workload Service Daemon) and KPS
(Key Protection Service) roles via the SERVICE_ROLE environment
variable.
- Multi-Mode Support: Implemented logic to switch between
KEY_PROTECTION_VM_EMULATED and KEY_PROTECTION_VM modes, ensuring
full backward compatibility while preparing for isolated VM
deployments.
- Containerization: Introduces the KMA Dockerfile to build and deploy
the unified /kma binary
- Testing Infrastructure:
- Added unit and integration tests for the agent lifecycle,
including graceful shutdown and socket management.
- Introduced a Cloud Build configuration to automatically
validate the containerized agent and its REST APIs via the UDS
interface.
This commit implements the state synchronization mechanism between the Workload
Service Daemon (WSD) and the Key Protection Service (KPS) using a periodic
heartbeat and token verification system. It also adds a batch deletion
capability to optimize state cleanup.
Key Changes
- Heartbeat Mechanism: Added a periodic gRPC Heartbeat call from WSD to
KPS to detect KPS resets and network failures, with exponential
back-off.
- State Synchronization: Implemented boot token generation in KPS and
verification in WSD to purge stale state on token mismatch.
- Batch Deletion: Added DestroyAllKeys to wskcc and WorkloadService
interface to allow purging all keys at once, optimizing cleanup.
- Proto Definitions: Created api.proto for KPS with Heartbeat definition
and generated Go bindings.
- Testing: Added unit tests for heartbeat in both KPS and WSD, and
verified token mismatch behavior.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This commit implements the state synchronization mechanism between the Workload Service Daemon (WSD) and the Key Protection Service (KPS) using a periodic heartbeat and token verification system. It also adds a batch deletion capability to optimize state cleanup.
Key Changes
This is a stacked PR dependent on #749 and includes changes from referenced PR.