Getting SGX Measurements of the running enclave during its runtime #1855
-
Hey Gramine team, I believe the answer is looking at /dev/attestation/report but is there any kind of library (exposing a function) to use in runtime that could easily fetch and parse the MRENCLAVE and MRSIGNER of the enclave itself running that code? Been reading about the SGX Report which seems to contain exactly what we need. On the low-level interface section documentation: Thank you in advance! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Yes, you must read There is no function, but you can take a look at how Gramine implements the corresponding C functions and do the same/copy-paste them in your C library:
Note that before reading the SGX report you should technically write two files:
The former may be just all zeros. The latter may be the output of Another example: https://github.com/gramineproject/gramine/blob/master/CI-Examples/python/scripts/sgx-report.py |
Beta Was this translation helpful? Give feedback.
Yes, you must read
/dev/attestation/report
binary file.There is no function, but you can take a look at how Gramine implements the corresponding C functions and do the same/copy-paste them in your C library:
gramine/pal/src/host/linux-sgx/enclave_framework.c
Line 323 in a7f46aa
gramine/pal/src/host/linux-sgx/enclave_api.S
Line 9 in a7f46aa
gramine/pal/src/host/linux-sgx/enclave_framework.c
Line 333 in a7f46aa
gramine/pal/src/host/linux-sgx/enclave_framework.c
Line 305 in a7f46aa