Skip to content

Conversation

@Freax13
Copy link

@Freax13 Freax13 commented Oct 4, 2024

This PR lays the groundwork for validating extensions inside the PCK certificate beyond what's needed to verify that a quote is valid. This PR adds an optional validation option to check the SGX type. This can be used to differentiate platforms with logical and cryptographic integrity. In the future, we could validate other fields e.g. "SMT Enabled".

@Freax13 Freax13 changed the title Feature/sgx type support optionally validating SGXType Oct 4, 2024
@jrjatin jrjatin requested a review from kongoshuu October 9, 2024 17:41
}

// SGXType represents the type of the platform for which the PCK certificate was created
type SGXType int
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm not quite familiar with the "SGXType" concept. Is it something Intel defined? Can you provide a link to it?

Copy link
Author

Choose a reason for hiding this comment

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

Yes, this is a concept by Intel. The values are defined in Intel® SGX PCK Certificate and Certificate Revocation List Profile Specification 1.5, 1.3.5 Intel® SGX PCK Certificate, SGX Type:

image

The difference between SGXTypeScalable and SGXTypeScalableWithIntegrity is explained in the Intel® Trust Domain Extensions white paper, 02. Intel TDX – Technical Explanation:

The SEAM-memory range [...] can operate in one of two available modes for memory integrity protection (to enable various memory configurations). Memory integrity may be enforced by either (the default) cryptographic-integrity protection scheme or a logical-integrity protection scheme. The cryptographic-integrity scheme uses a SHA-3-based, message-authentication code (MAC) (28-bit) that helps prevent host/system software accesses as well as detects state-tamper from software (e.g., rowhammer) and some hardware attacks. The logical-integrity protection scheme is designed to prevent host/system software accesses only.

and Intel® Trust Domain Extensions white paper, 02. Intel TDX – Technical Explanation, E. REMOTE ATTESTATION:

Platform configuration differences such as whether cryptographic vs. logical-integrity mode is enabled are reflected via the Provisioning Certificates.

I wasn't able to find any docs that directly state that the SGX type is the field recording this platform configuration difference, but I was able to confirm this experimentally by generating two quotes, one on a platform with logical integrity and one on a platform with cryptographic integrity, and comparing the values.

This field allows us to to differentiate between Scalable (TDX with
logical integrity) and Scalable with Integrity (TDX with cryptographic
integrity).
This patch lays the groundwork for validating extensions inside the PCK
certificate beyond what's needed to verify that a quote is valid. This
patch adds an optional validation option to check the SGX type. This
can be used to differentiate platforms with logical and cryptographic
integrity. In the future, we could validate other fields e.g. "SMT
Enabled".
@burgerdev
Copy link
Contributor

@kongoshuu: this PR seems to have stalled, unfortunately. Do you have any further feedback? What do you think about getting this merged?

return fmt.Errorf("could not get PCK certificate extensions: %v", err)
}
if opts.SgxType != nil && *opts.SgxType != exts.SGXType {
return fmt.Errorf("PCK extension SGXType is %d. Expect %d", *opts.SgxType, exts.SGXType)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
return fmt.Errorf("PCK extension SGXType is %d. Expect %d", *opts.SgxType, exts.SGXType)
return fmt.Errorf("PCK extension SGXType is %d. Expect %d", exts.SGXType, *opts.SgxType)

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