|
| 1 | +# Overview |
| 2 | + |
| 3 | +**Confidential Computing** (or **Trusted Execution Environments -** **'TEE'**) |
| 4 | +ensures computation confidentiality through mechanisms of memory encryption at |
| 5 | +the hardware level. Applications being executed and data being processed are |
| 6 | +safeguarded against even the most privileged access levels (OS, Hypervisor...). |
| 7 | +Only authorized code can run inside this protected area and manipulate its data. |
| 8 | + |
| 9 | +In some cases, ensuring that code runs correctly without any third party |
| 10 | +altering the execution, is even more important than hiding the computation's |
| 11 | +data. This concept is called **Trusted Computing.** |
| 12 | + |
| 13 | +These guarantees are critical for a decentralized cloud where code is being |
| 14 | +executed on a remote machine, that is not controlled by the requester. They are |
| 15 | +also required to prevent leakage while monetizing data sets. |
| 16 | + |
| 17 | +## Intel® Software Guard Extension (Intel® SGX) |
| 18 | + |
| 19 | +[Intel® SGX](https://software.intel.com/en-us/sgx) is a technology that enables |
| 20 | +**Trusted Computing** and **Confidential Computing**. At its core, it relies on |
| 21 | +the creation of a special zone in the memory called an “enclave”. This enclave |
| 22 | +can be considered as a vault, to which only the CPU can have access. Neither |
| 23 | +privileged access-levels such as root, nor the operating system itself is |
| 24 | +capable of inspecting the content of this region. The code, as well as the data |
| 25 | +inside the protected zone, is totally unreadable and unalterable from the |
| 26 | +outside. This guarantees non-disclosure of data as well as tamper-proof |
| 27 | +execution of the code. |
| 28 | + |
| 29 | +An application's code can be separated into "trusted" and "untrusted" parts |
| 30 | +where sensitive data is manipulated inside the protected area. |
| 31 | + |
| 32 | +## Confidential Computing with iExec |
| 33 | + |
| 34 | +Here is a general overview of how a TEE application runs on iExec: |
| 35 | + |
| 36 | +```mermaid |
| 37 | +graph TD |
| 38 | + Req[Requester] --> |1 . Buy task| Chain |
| 39 | + Chain[Blockchain] --> |2 . Notify task to compute| Worker[Worker/Workerpool] |
| 40 | + Worker --> |3 . Launch TEE application| App[TEE application pre-starting] |
| 41 | + App --> |4 . Send report containing integrity information of the enclave| SMS{SMS Is integrity and authenticity <br> of the requesting enclave valid?} |
| 42 | + SMS --> |No| AppFailed[TEE application run aborted] |
| 43 | + SMS --> |Yes| AppStarted[TEE application started] |
| 44 | +
|
| 45 | + style AppFailed color:red |
| 46 | + style AppStarted color:green |
| 47 | +``` |
| 48 | + |
| 49 | +To build such Confidential Computing (TEE) application, a developer would need |
| 50 | +to use the Intel® SGX SDK. With iExec, you don't need to manipulate it. Instead |
| 51 | +iExec supports the high-level Scone framework. |
| 52 | + |
| 53 | +At a high-level, Scone protects the confidentiality and integrity of the data |
| 54 | +and the code without needing to modify or recompile the application. With native |
| 55 | +Intel® SGX technology, the OS is not a part of the Trusted Computing Base (TCB) |
| 56 | +hence system calls and kernel services are not available from an Intel® SGX |
| 57 | +enclave. This can be limiting as the application will not be able to use File |
| 58 | +System and sockets directly from the code running inside the enclave. The |
| 59 | +[Scone](https://scontain.com/) framework resolves this and reduces the burden of |
| 60 | +porting the application to Intel® SGX. |
| 61 | + |
| 62 | +More precisely, Scone provides a C standard library interface to container |
| 63 | +processes. System calls are executed outside of the enclave, but they are |
| 64 | +shielded by transparently encrypting/decrypting application data. Files stored |
| 65 | +outside of the enclave are therefore encrypted, and network communication is |
| 66 | +protected by Transport Layer Security (TLS). |
| 67 | + |
| 68 | +For a deeper understanding, you can have a look to the official |
| 69 | +[Scone documentation](https://sconedocs.github.io/). |
| 70 | + |
| 71 | +## Let's build |
| 72 | + |
| 73 | +::: warning |
| 74 | + |
| 75 | +Following steps will show you how to build a Confidential Computing application. |
| 76 | +The environment you are about to use is a "develop" environment: |
| 77 | + |
| 78 | +- which can be reset at any time |
| 79 | +- where configurations and secrets might be inspected (debug enclaves) |
| 80 | + |
| 81 | +When your developer discovery journey is complete, please reach the |
| 82 | +[production section](/guides/build-iapp/build-&-deploy#go-to-production). |
| 83 | + |
| 84 | +::: |
0 commit comments