👮Local and Remote Attestation
SGX offers a secure mechanism for enclaves to establish trust in each other's integrity. Through local attestation, enclaves on the same platform can securely verify their authenticity and validate the genuineness of the underlying hardware. For remote scenarios, enclaves can demonstrate their trustworthiness through remote attestation, which involves verification by third parties outside the platform.
Local Attestation
During local attestation, one enclave can verify the integrity and genuineness of another enclave and the underlying hardware platform.
The process involves the following steps:
Enclave A, hosted by application A, and enclave B, hosted by application B, establish a communication path between them after the untrusted applications have set it up.
Enclave B sends its
MRENCLAVE
identity to enclave A.Enclave A requests the hardware to generate an
EREPORT
structure for enclave B, using the receivedMRENCLAVE
value. Enclave A signs the report with the identity information of enclave B.Enclave A transmits the report to enclave B through the untrusted application. The report is protected with a MAC (Message Authentication Code) generated using a key derived from the
TARGETINFO
, which is theMRENCLAVE
value of enclave B.Enclave B, upon invoking
EGETKEY
, derives the MAC key associated with its own measurement and verifies the report.Enclave B asks the hardware to verify the report it received from enclave A, confirming that enclave A is running on the same platform. Enclave B can reciprocate by creating its own
EREPORT
for enclave A, using theMRENCLAVE
value from the received report.Enclave B transmits its report to enclave A, establishing mutual authentication.
The authenticated report structure contains information about the enclave's measurement and other relevant data, secured with the report key.
Remote Attestation
In scenarios where a third party needs to establish trust with a remotely executed enclave before providing it with secrets, remote attestation is employed. SGX leverages the Quoting Enclave (QE), a component developed and signed by Intel as part of the DCAP attestation framework, to facilitate remote attestation.
The process of remote attestation involves the following steps:
An off-platform challenger sends an attestation request to an application.
The application requests its enclave to produce an attestation.
The enclave performs a local attestation by generating a report, similar to the local attestation process described earlier.
The report is sent from the application's enclave to the Quoting Enclave (QE). The QE locally verifies the received report and transforms it into a remotely verifiable quote by signing it with the Attestation Key.
The quote, representing the remote attestation, is returned to the application.
The application sends the quote to the challenger.
The challenger can use an Attestation Verification Service to verify the quote, identifying and assessing the trustworthiness of the SGX enclave.
The Quoting Enclave ensures a secure and trustworthy environment for the transformation of a report into a quote, preventing any unauthorized modifications or falsifications.
Overall, remote attestation enables remote enclaves to establish trust with external parties, providing assurance of their integrity and security.
Last updated