|
| 1 | +--- |
| 2 | +title: Intel SGX Technology |
| 3 | +description: |
| 4 | + Learn about Intel Software Guard Extensions (SGX) - the first-generation TEE |
| 5 | + technology |
| 6 | +--- |
| 7 | + |
| 8 | +# 🛡️ Intel SGX Technology |
| 9 | + |
| 10 | +**Intel® Software Guard Extensions (Intel® SGX)** is the first-generation TEE |
| 11 | +technology that enables **Trusted Computing** and **Confidential Computing**. On |
| 12 | +the iExec platform, SGX is the **production-ready, widely-supported TEE |
| 13 | +technology** that powers secure, privacy-preserving applications in the |
| 14 | +decentralized cloud. |
| 15 | + |
| 16 | +## What is Intel SGX? |
| 17 | + |
| 18 | +[Intel® SGX](https://software.intel.com/en-us/sgx) creates a special secure |
| 19 | +zone in memory called an "enclave" - think of it as a vault that only the CPU |
| 20 | +can access. Neither the operating system nor any other software can see what's |
| 21 | +happening inside this protected area. Your code and data are completely private |
| 22 | +and secure. |
| 23 | + |
| 24 | +## SGX: The "Application-Level" Security |
| 25 | + |
| 26 | +**Intel SGX** is like having a **small, specialized safe** inside your office |
| 27 | +for specific valuable items. It protects individual applications or parts of |
| 28 | +applications. |
| 29 | + |
| 30 | +### Key Characteristics |
| 31 | + |
| 32 | +- **Scope**: Protects specific parts of your application |
| 33 | +- **Memory**: Limited secure memory (like a small safe) |
| 34 | +- **Code Changes**: Requires modifications to your application |
| 35 | +- **Use Case**: Perfect for focused, lightweight applications |
| 36 | + |
| 37 | +**Analogy**: SGX is like installing a small, specialized safe inside your office |
| 38 | +for specific valuable items. |
| 39 | + |
| 40 | +### Visual Representation |
| 41 | + |
| 42 | +```mermaid |
| 43 | +graph TB |
| 44 | + OS[Operating System<br/>Can see everything] |
| 45 | + App[Regular Application<br/>Visible & Vulnerable] |
| 46 | + Enclave[🔒 SGX Enclave<br/>Protected] |
| 47 | + Data[Sensitive Code & Data<br/>Encrypted] |
| 48 | + OS --> App |
| 49 | + App --> Enclave |
| 50 | + Enclave --> Data |
| 51 | + style Enclave fill:#ffffff,stroke:#0000ff,stroke-width:2px,color:#000000 |
| 52 | + style Data fill:#ffffff,stroke:#00ff00,stroke-width:2px,color:#000000 |
| 53 | +``` |
| 54 | + |
| 55 | +## SGX Technology Details |
| 56 | + |
| 57 | +### How SGX Works |
| 58 | + |
| 59 | +1. **Enclave Creation**: SGX creates a secure memory region (enclave) that only |
| 60 | + the CPU can access |
| 61 | +2. **Code Isolation**: Sensitive code runs inside the enclave, isolated from the |
| 62 | + rest of the system |
| 63 | +3. **Memory Encryption**: All data in the enclave is automatically encrypted |
| 64 | +4. **Integrity Protection**: The enclave can prove it's running the correct, |
| 65 | + unmodified code |
| 66 | + |
| 67 | +### SGX Limitations |
| 68 | + |
| 69 | +With native Intel® SGX technology, the OS is not a part of the Trusted |
| 70 | +Computing Base (TCB), hence system calls and kernel services are not available |
| 71 | +from an Intel® SGX enclave. This can be limiting as the application will not be |
| 72 | +able to use File System and sockets directly from the code running inside the |
| 73 | +enclave. |
| 74 | + |
| 75 | +### iExec's SGX Infrastructure |
| 76 | + |
| 77 | +iExec provides a complete SGX ecosystem that includes: |
| 78 | + |
| 79 | +- **🔐 Secret Management Service (SMS)**: Secure storage for encryption keys and |
| 80 | + secrets |
| 81 | +- **🛡️ SGX Workers**: Computing nodes with SGX hardware support |
| 82 | +- **📋 Task Verification**: Proof of contribution system that verifies SGX |
| 83 | + execution |
| 84 | +- **🔗 Blockchain Integration**: Decentralized coordination and payment |
| 85 | +- **📦 Scone Framework**: High-level development framework for SGX applications |
| 86 | + |
| 87 | +### Why iExec Uses Scone |
| 88 | + |
| 89 | +To build Confidential Computing (TEE) applications with SGX, iExec uses the |
| 90 | +high-level **Scone framework** instead of requiring developers to manipulate the |
| 91 | +Intel® SGX SDK directly. |
| 92 | + |
| 93 | +#### Scone Framework Benefits |
| 94 | + |
| 95 | +At a high-level, Scone protects the confidentiality and integrity of the data |
| 96 | +and the code without needing to modify or recompile the application. The |
| 97 | +[Scone](https://scontain.com/) framework resolves the limitations of native SGX |
| 98 | +and reduces the burden of porting the application to Intel® SGX. |
| 99 | + |
| 100 | +#### How Scone Works |
| 101 | + |
| 102 | +More precisely, Scone provides a C standard library interface to container |
| 103 | +processes. System calls are executed outside of the enclave, but they are |
| 104 | +shielded by transparently encrypting/decrypting application data. Files stored |
| 105 | +outside of the enclave are therefore encrypted, and network communication is |
| 106 | +protected by Transport Layer Security (TLS). |
| 107 | + |
| 108 | +For a deeper understanding, you can have a look to the official |
| 109 | +[Scone documentation](https://sconedocs.github.io/). |
| 110 | + |
| 111 | +### iExec SGX Workflow |
| 112 | + |
| 113 | +```mermaid |
| 114 | +graph TD |
| 115 | + Dev[Developer] |
| 116 | + Build[Build with Scone] |
| 117 | + Deploy[Deploy to iExec] |
| 118 | + Worker[SGX Worker Selected] |
| 119 | + Enclave[SGX Enclave Created] |
| 120 | + Execute[Secure Execution] |
| 121 | + Proof[Proof of Contribution] |
| 122 | + Result[Results] |
| 123 | + Dev --> Build |
| 124 | + Build --> Deploy |
| 125 | + Deploy --> Worker |
| 126 | + Worker --> Enclave |
| 127 | + Enclave --> Execute |
| 128 | + Execute --> Proof |
| 129 | + Proof --> Result |
| 130 | + style Enclave fill:#ffffff,stroke:#0000ff,stroke-width:2px,color:#000000 |
| 131 | + style Execute fill:#ffffff,stroke:#0000ff,stroke-width:2px,color:#000000 |
| 132 | +``` |
| 133 | + |
| 134 | +## What's Next? |
| 135 | + |
| 136 | +**Learn about the next generation**: |
| 137 | + |
| 138 | +- **[Intel TDX Technology](/get-started/protocol/tee/intel-tdx)** - |
| 139 | + Next-generation VM-level TEE technology |
| 140 | +- **[SGX vs TDX Comparison](/get-started/protocol/tee/sgx-vs-tdx)** - Detailed |
| 141 | + comparison of both technologies |
| 142 | + |
| 143 | +**Ready to build with SGX?** Check out the practical guides: |
| 144 | + |
| 145 | +- **[Build & Deploy](/guides/build-iapp/build-&-deploy)** - Create your first |
| 146 | + SGX application |
| 147 | +- **[Advanced SGX Development](/guides/build-iapp/advanced/create-your-first-sgx-app)** - |
| 148 | + Deep dive into SGX development |
0 commit comments