Skip to content

Conversation

stunes-ms
Copy link
Contributor

(Remaining open items: we have not yet settled the exact way to hash the AK public key.)

This is an RFC review request for adding telemetry (in the form of event markers in our logs) around operations of interest for VMGS provisioning and certain vTPM features (AKPub, AKCert, etc.). The goal of this approach is to have structured, easily queryable data that can show that provisioning is successful, and indicate whether Trusted Launch features (OpenHCL-provisioned VMGS, GSP key) are being enabled.

This PR is intended to match a corresponding legacy HCL change as closely as possible, given the differences in their logging implementations. In particular, the operation names (here, added as an op_type property on traces) and other metadata properties should match.

@stunes-ms stunes-ms requested a review from a team as a code owner September 18, 2025 23:18
@Copilot Copilot AI review requested due to automatic review settings September 18, 2025 23:18
@stunes-ms stunes-ms requested a review from a team as a code owner September 18, 2025 23:18
@stunes-ms stunes-ms requested review from tjones60 and removed request for Copilot September 18, 2025 23:18
.map_err(|e| {
tracing::error!(
CVM_ALLOWED,
op_type = "VtpmKeysProvision",
Copy link
Contributor

Choose a reason for hiding this comment

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

It might be better to create enums for op_type and key_type

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll leave this as an open question for right now, and ask other reviewers: if we make these enums, where should they live? especially op_type.

key_type = "AkPub",
bios_guid = self.bios_guid,
pub_key = self.ak_pub_hash,
success = true,
Copy link
Contributor

Choose a reason for hiding this comment

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

do you need to include this field?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think making it explicit is more in-line with the principles for our HCL telemetry -- this way, we can filter explicitly based on 'success' instead of implicitly based on log level. (I don't have a strong opinion about this though.)

@stunes-ms stunes-ms force-pushed the user/mikestunes/telemetry branch from 20afa23 to 44bfa47 Compare September 19, 2025 21:29
@Copilot Copilot AI review requested due to automatic review settings September 19, 2025 21:29
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds comprehensive telemetry logging for VMGS provisioning and TPM operations in OpenHCL. The goal is to provide structured, queryable logs that can track provisioning success and indicate whether Trusted Launch features are being enabled.

Key changes include:

  • Added operation-specific telemetry logs with timing metrics across TPM and VMGS operations
  • Enhanced logging for AK cert provisioning, NV read/write operations, and GSP callbacks
  • Added BIOS GUID tracking to TPM device resources for better telemetry correlation

Reviewed Changes

Copilot reviewed 13 out of 14 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
vm/vmgs/vmgs/src/vmgs_impl.rs Changed log level and added op_type for VMGS provisioning telemetry
vm/devices/tpm_resources/src/lib.rs Added bios_guid field to TpmDeviceHandle for logging purposes
vm/devices/tpm/src/tpm_helper.rs Added comprehensive telemetry for TPM NV read/write operations with timing
vm/devices/tpm/src/lib.rs Added detailed AK cert and key provisioning telemetry with error handling
vm/devices/get/guest_emulation_transport/src/client.rs Added GSP callback operation telemetry
openhcl/underhill_attestation/src/lib.rs Added VMGS decryption telemetry with GSP type tracking
Various config files Updated to pass bios_guid parameter and added dependencies

TpmErrorKind::CreateAkPublic(e)
})?;

// TODO: make sure we're hashing the right thing
Copy link
Preview

Copilot AI Sep 19, 2025

Choose a reason for hiding this comment

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

The TODO comment on line 603 indicates uncertainty about what is being hashed. This should be documented or the TODO resolved to clarify that the AK public key modulus is the intended data for hashing.

Suggested change
// TODO: make sure we're hashing the right thing
// Hash the AK public key modulus to derive its fingerprint.

Copilot uses AI. Check for mistakes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is still an open question; to be discussed soon

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.

2 participants