Skip to content

Conversation

gladjohn
Copy link
Contributor

@gladjohn gladjohn commented Oct 2, 2025

Document the key management logic and responsibilities in MSI v2, including key selection priorities and flow.

Document the key management logic and responsibilities in MSI v2, including key selection priorities and flow.
@gladjohn gladjohn requested a review from a team as a code owner October 2, 2025 19:34

## Key Responsibilities

- Generate and hold the RSA private key.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what does "hold" mean?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 ... and to generalize the concept, we should have some Windows / Linux notes .. I assume on Windows "hold" means "write to it a keystore" and on Linux means "write it to memory"

- Generate and hold the RSA private key.
- Ensure the key is protected to the maximum capability of the platform.
- Provide the key for signing (CSR, PoP requests, mTLS handshakes).
- Never allow export if backed by hardware/KeyGuard.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: KeyGuard/TPM

- Requires Virtualization-Based Security (VBS).
- Keys are isolated in a secure enclave.
- Strongest guarantee that the private key cannot be exfiltrated.
- Used for Proof-of-Possession (PoP).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you only put this here and not the other key types? Every Key type listed here can be used in PoP.

### Hardware / TPM / KSP (fallback)

- Keys are backed by TPM or the Platform Crypto Provider.
- Non-exportable, tied to the device.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

KeyGuard is also not exportable, can you add this to the KeyGuard section too?

- Strongest guarantee that the private key cannot be exfiltrated.
- Used for Proof-of-Possession (PoP).

### Hardware / TPM / KSP (fallback)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you write out the TPM acronym here?

KeyProvider-->>KeyProvider: Acquire semaphore
alt KeyGuard available
KeyProvider-->>MSAL: KeyGuard key (preferred)
else Hardware/TPM available
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add "KeyGuard not available"

else Hardware/TPM available
KeyProvider-->>MSAL: Hardware key
else
KeyProvider-->>MSAL: In-memory RSA key
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add "KeyGuard and TPM not available"

Co-authored-by: Bogdan Gavril <bogavril@microsoft.com>
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