# Enhancing the Privacy of Network Services through Trusted Computing
## 2 Backgrounds and Related Work
### Intel SGX  
TEE is a secure container that runs and protects sensitive code and data inside a CPU. As the operating system becomes larger and more complicated, it is impossible to get rid of a diverse set of vulnerabilities [18; 24]. Typical encryption algorithms and security mechanisms are suitable for data storage and transmission but often fail to preserve the security of data during execution and usage. While applications can create encrypted memory areas for program execution in a user layer, such as Intel SGX [19] and ARM TrustZone [25]. These areas can be seen as enclaves isolated from any other privileged code in a host. The processor only allows code that is measured and loaded in the enclave to access sensitive data. Applications running in enclaves are free from sniffing and corruption when interacting with normal system interfaces. Even if privileged system software, including BIOS and OS, is compromised, the enclave still ensures that the code and data are not tampered with or monitored, which ensures the integrity and confidentiality of the code and data. Intel SGX is one of the most widely used TEEs in practice [26]. Intel has added SGX support to most CPUs after its sixth-generation architecture. TrustZone requires signature verification from hardware manufacturers to run in a secure execution environment, which limits its deployment by software developers [25]. The Intel CPU provides a dedicated execution environment isolated from the normal operating system. Developers can divide the core functions of applications into hardened enclaves to improve the security of their applications while reducing the attack surface [27]. To realize the switching between the two environments, bridge functions will pass ECALL/OCALL instructions to enter and exit the enclave environment [28]. The code of E/OCALL has been generated automatically according to a function declaration file. However, mandatory code separation brings many challenges to the development of SGX applications [29]. Developers often have to refractor existing codes to adapt to SGX-specific development models [30]. SGX supports two types of authentication, local authentication (LA) and remote authentication (RA) [31]. Utilizing the RA feature, an enclave can prove that it has not been compromised and is running on a genuine SGX-enabled hardware platform. The remote authentication protocol involves two intel-controlled services: Quoting Enclave (QE) and an Intel Attestation Service (IAS), which act as authentication providers and verifiers, respectively. As important research progress in the field of trusted computing, Intel SGX offers an efficient solution for anonymous authentication and verification [28; 32; 33]. Besides shielding systems [34; 35], SGX is also used to enhance the security of applications such as machine learning [33; 34; 35; 36; 37], intrusion detection framework [36], serverless [26; 38], and cloud computing. This strong isolation of SGX makes it difficult to share code or data between enclaves. The authors of [27] propose a single-address-space approach, which runs all processes in a single enclave and enables memory-sharing in library OSes. To evaluate network trust and incent collection nodes to share security-related data for intrusion detection, the authors propose [36] an SGX-enabled decentralized intrusion detection framework based on blockchain to avoid forking and honestly perform intrusion detection. The remote authentication in Intel SGX is a key step for relying on parties to build secure connections between a client, which holds the sensitive data and the enclave. To fill this gap between practical developments and formal proof for attestation services in SGX, the authors of [31] adopt a formal approach for the verification of third-party attestation and prove Intel SGX provides the announced confidentiality of secrets and integrity of the evidence. One of the security concerns about SGX is side-channel attacks.