ccnp.measurement package

Submodules

ccnp.measurement.measurement_sdk module

This module provides the functions to talk to measurement-server and fetch measurements

class ccnp.measurement.measurement_sdk.MeasurementType

Bases: object

TYPE_TDX_RTMR = 2
TYPE_TEE_REPORT = 0
TYPE_TPM_PCR = 1
classmethod is_valid_type(value)

Class method to check if value is a valid eventlog type

classmethod measurement_type_dict()

Class method to construct the event log typedict

class ccnp.measurement.measurement_sdk.MeasurementUtility(target='unix:/run/ccnp/uds/measurement.sock')

Bases: object

Common utility for measurement related actions

cleanup_channel()

Clean up channel used for grpc

classmethod get_container_measurement() str

Get measurements from container perspective

get_measurement()

Get measurement

Parameters:
  • request (GetMeasurementRequest) – request data

  • stub (MeasurementStub) – the stub to call server

Returns:

base64 encoded string of measurement

Return type:

string

classmethod get_platform_measurement(measurement_type=0, report_data=None, register_index=None) str

Get measurements from platform perspective. Currently, support measurement fetching on TEE reports, Intel TDX RTMR and TPM.

Parameters:

measurement_type (EventlogType) – type of measurement to fetch

Returns:

base64 encoded measurement string

Return type:

string

setup_measurement_request(measurement_type=0, measurement_category=0, report_data=None, register_index=0)

Function to generate a get_measurement request

Module contents