January 19, 2021•117 words
Install dependencies (not comprehensive, contains only non-obvious):
$ pip3 install google-api-python-client
$ git clone https://github.com/oscarlab/graphene.git
Check the FSGSBASE support, which can be validated from AT_HW_CAP2:
$ LD_SHOW_AUXV=1 /bin/true | grep AT_HWCAP2 AT_HWCAP2: 0x2
Go to the cloned directory, and build Graphene:
$ cd graphene $ ISGX_DRIVER_PATH= make SGX=1 DEBUG=1
Create a signing key for enclaves:
$ openssl genrsa -3 -out enclave-key.pem 3072 $ export SGX_SIGNER_KEY=$PWD/enclave-key.pem
There is an example, which runs bash inside an enclave. Let's give that a shot!
First, build it:
$ cd Examples/bash $ make SGX=1 DEBUG=1
Then, you can run it:
$ SGX=1 ./pal_loader ./bash -c "ls"