Universidade do Minho Escola de Engenharia Departamento de Inform´ atica Hugo Alves Carvalho SafeSpark: A Secure Data Analytics Platform using Cryptographic Techniques and Trusted Hardware July 2019
Universidade do Minho Escola de Engenharia Departamento de Inform´ atica Hugo Alves Carvalho SafeSpark: A Secure Data Analytics Platform using Cryptographic Techniques and Trusted Hardware Master dissertation Master Degree in Informatics Engineering Dissertation supervised by Doctor Jo˜ ao Tiago Medeiros Paulo Professor Rui Carlos Mendes Oliveira July 2019
Despacho RT - 31 /2019 - Anexo 3 Declaração a incluir na Tese de Doutoramento (ou equivalente) ou no trabalho de Mestrado DIREITOS DE AUTOR E CONDIÇÕES DE UTILIZAÇÃO DO TRABALHO POR TERCEIROS Este é um trabalho académico que pode ser utilizado por terceiros desde que respeitadas as regras e boas práticas internacionalmente aceites, no que concerne aos direitos de autor e direitos conexos. Assim, o presente trabalho pode ser utilizado nos termos previstos na licença abaixo indicada. Caso o utilizador necessite de permissão para poder fazer um uso do trabalho em condições não previstas no licenciamento indicado, deverá contactar o autor, através do RepositóriUM da Universidade do Minho. Licença concedida aos utilizadores deste trabalho Atribuição-CompartilhaIgual CC BY-SA https://creativecommons.org/licenses/by-sa/4.0/
ACKNOWLEDGEMENTS I would like to express my acknowledgements to some special people who were very important to me throughout this year and throughout my academic career. Firstly, I want to thank my advisors. To Dr. Jo˜ ao Tiago Paulo, for guiding me with excellence, for all his availability, and for all the knowledge and motivation he has given me throughout this year. To Professor Rui Carlos Oliveira, for his experience and professionalism, and for giving me the opportunity to join the HASLab Distributed Systems Group. To Rog´ erio Pontes for helping me overcome the problems that I faced during this work and for all meetings where we discussed new ideas. To Daniel Cruz for his collaboration in writing the research article resulting from this work. To HASLab Distributed System group, for all the good work environment, all the volleyball games, and all the help they have given me over the last year and a half. To my parents, Natalia and Walter, and also my whole family, for always being present to me, and for the excellent education and comfort they have given me. To my close friends, for always being by my side, and also for all the great adventures we had during this five-year journey. To my girlfriend, Catarina, for all the support and patience she had with me while I was doing this thesis. Finally, I would like to dedicate this work to my grandfather, Alexandre, who unfortunately passed away while I was writing this document. My special thanks to him for all the values that he has given me throughout his life. My sincere thanks to all of you! Hugo Carvalho This work was partially funded by FCT - Fundac¸˜ ao para a Ciˆ encia e a Tecnologia, I.P., (Portuguese Foundation for Science and Technology) within project UID/EEA/50014/2019. ii
Despacho RT - 31 /2019 - Anexo 4 Declaração a incluir na Tese de Doutoramento (ou equivalente) ou no trabalho de Mestrado STATEMENT OF INTEGRITY I hereby declare having conducted this academic work with integrity. I confirm that I have not used plagiarism or any form of undue use of information or falsification of results along the process leading to its elaboration. I further declare that I have fully acknowledged the Code of Ethical Conduct of the University of Minho.
ABSTRACT Nowadays, most companies resort to data analytics frameworks to extract value from the increasing amounts of digital information. These systems give substantial competitive advantages to companies since they allow to support situations such as possible marketing decisions or predict user behaviors. Therefore, organizations tend to leverage the cloud to store and perform analytics over the data. Database services in the cloud present significant advantages as a high level of efficiency and flexibility, and the reduction of costs inherent to the maintenance and management of private infrastructures. The problem is that these services are often a target for malicious attacks, which means that sensitive and private personal information can be compromised. The current secure analytical processing solutions use a limited set of cryptographic techniques or technologies, which makes it impossible to explore different trade-offs of performance, security, and functionality requirements for different applications. Moreover, these systems also do not explore the combination of multiple cryptographic techniques and trusted hardware to protect sensitive data. The work presented here addresses this challenge, by using cryptographic schemes and the Intel SGX technology to protect confidential information, ensuring a practical solution which can be adapted to applications with different requirements. In detail, this dissertation begins by exposing a baseline study about cryptographic schemes and the Intel SGX technology, followed by the state-of-the-art revision about secure data analytics frameworks. A new solution based on the Apache Spark framework, called SafeSpark, is proposed. It provides a modular and extensible architecture and prototype, which allows protecting information and processing analytical queries over encrypted data, using three cryptographic schemes and the SGX technology. We validated the prototype with an experimental evaluation, where we analyze the performance costs of the solution and also its resource usage. For this purpose, we use the TPC-DS benchmark to evaluate the proposed solution, and the results show that it is possible to perform analytical processing on protected data with a performance impact between 1.13x and 4.1x. Keywords: Apache Spark, Cryptographic Schemes, Databases, Intel SGX. iv
RESUMO Atualmente, um grande n´ umero de empresas recorre a ferramentas de an´ alise de dados para extrair valor da quantidade crescente de informac¸ ˜ oes digitais que s˜ ao geradas. Estes sistemas apresentam consider´ aveis vantagens competitivas para as empresas, uma vez que permitem suportar situac¸ ˜ oes como melhores decis˜ oes de marketing, ou at´ e mesmo prever o comportamento dos seus clientes. Neste sentido, estas organizac¸ ˜ oes tendem a recorrer a servic¸os de bases de dados na nuvem para armazenar e processar informac¸˜ ao, uma vez que estas apresentam vantagens significativas como alto n´ ıvel de eficiˆ encia e flexibilidade, bem como a reduc¸˜ ao de custos inerentes a manter e gerir uma infraestrutura privada. No entanto, estes servic¸os s˜ ao frequentemente alvo de ataques maliciosos, o que leva a que informac¸ ˜ oes pessoais privadas possam estar comprometidas. As soluc¸ ˜ oes atuais de processamento anal´ ıtico seguro utilizam um conjunto limitado de t´ ecnicas criptogr´ aficas ou tecnologias, o que impossibilita o balanceamento de diferentes compromissos entre performance, seguranc¸a e funcionalidade para diferentes aplicac¸ ˜ oes. Ainda, estes sistemas n˜ ao permitem explorar a simultˆ anea utilizac¸˜ ao de t´ ecnicas criptogr´ aficas e de hardware confi´ avel para proteger informac¸˜ ao sens´ ıvel. O trabalho apresentado nesta dissertac¸˜ ao tem como objetivo responder a este desafio, utilizando esquemas criptogr´ aficos e a tecnologia Intel SGX para proteger informac¸˜ ao confidencial, garantindo uma soluc¸˜ ao pr´ atica que pode ser adaptada a aplicac¸ ˜ oes com diferentes requisitos. Em detalhe, este documento comec¸a por expor um estudo de base sobre esquemas criptogr´ aficos e sobre a tecnologia SGX, seguido de uma revis˜ ao do estado de arte atual sobre ferramentas de processamento anal´ ıtico seguro. Uma nova soluc¸˜ ao baseada na plataforma Apache Spark, chamada SafeSpark,´ e proposta. Esta providencia uma arquitetura modular e extens´ ıvel, bem como um prot´ otipo, que possibilita proteger informac¸˜ ao e executar interrogac¸˜ oes anal´ ıticas sobre dados cifrados, utilizando trˆ es esquemas criptogr´ aficos e a tecnologia Intel SGX. O prot´ otipo foi validado com uma avaliac¸˜ ao experimental, onde analisamos a penalizac¸˜ ao de desempenho da soluc¸˜ ao, bem como a sua utilizac¸˜ ao de recursos computacionais. Com este prop´ osito, foi utilizada a plataforma de avaliac¸˜ ao TPC-DS para avaliar a soluc¸˜ ao proposta, e os resultados mostram que ´ e poss´ ıvel executar processamento anal´ ıtico sobre dados protegidos, apresentando um impacto no desempenho entre 1.13x e 4.1x. Palavras-Chave: Apache Spark, Bases de Dados, Esquemas Criptogr´ aficos, Intel SGX. v
CONTENTS 1 introduction 1 1.1Problem 2 1.2Objectives and Contributions 2 1.3Dissertation Structure 3 2 background 4 2.1Cryptographic Schemes 4 2.1.1Symmetric-Key Encryption 5 2.1.2Deterministic Encryption 6 2.1.3Order-Preserving Encryption 6 2.1.4Order-Revealing Encryption 7 2.1.5Homomorphic Encryption 7 2.1.6Discussion 8 2.2Trusted Hardware 9 2.2.1Intel SGX 10 2.3Modular Secure Processing Frameworks 11 2.3.1CryptDB 11 2.3.2SafeNoSQL 14 2.4Apache Spark 15 2.4.1Spark SQL 17 3 state of the art 18 3.1VC318 3.2Opaque 20 3.3Monomi 21 3.4Seabed 24 3.5Discussion 26 4 architecture 27 4.1SafeSpark 27 4.1.1Data Storage 28 4.1.2Data Processing 29 4.2Flow of Operations 30 5 implementation 32 5.1CryptoBox 32 5.1.1Standard Encryption (STD) 32 vi
Contents vii 5.1.2Deterministic Encryption (DET) 33 5.1.3Order-Preserving Encryption (OPE) 33 5.1.4Intel SGX 33 5.2SafeMapper 35 5.3SafeSpark Worker 36 5.3.1Data Storage 36 5.3.2Data Processing 37 6 experimental evaluation 39 6.1TPC-DS Benchmark 39 6.2Experimental Setup and Methodology 40 6.3Database Schemas 41 6.3.1Configuration Schema 1- SGX 41 6.3.2Configuration Schema 2- OPE 41 6.3.3Configuration Schema 3- DET 42 6.4Results 43 6.4.1Loading and Storage 43 6.4.2Latency 43 6.4.3Resources Usage 46 6.5Discussion 46 7 conclusion and future work 49 7.1Future Work 50 a safespark configuration schemes 56 b dstats results 62
1.1. Problem 2 users private information. Although there are solutions to protect sensitive information and allow to perform data analytics over encrypted data, these systems use a limited set of technologies or cryptographic techniques, which makes it impossible to balance the performance, security and functionality requirements from different applications. 1.1 problem The existing privacy risks of cloud services make companies hesitant to use them to store and process private and confidential information. Due to this problem, new techniques and technologies have been explored to ensure the confidentiality of the data at rest and during computation. Cryptography is one of the most used techniques to protect data, but its usage presents limitations on the functionalities that are possible to perform and can end up leaking critical information, as with deterministic schemes [18]. On the other hand, new solutions based on trusted hardware have emerged. These technologies, such as Intel Software Guard Extensions (SGX) [1], aim to provide security guarantees through a secure enclave hosted on the hardware of a computer. These can evaluate any function with confidentiality and integrity guarantees, but the security mechanisms implemented in the processor have a performance cost. There are already solutions to protect information and perform analytics over encrypted data. Nevertheless, these systems present a limited and non-extensible set of techniques for ensuring data confidentiality. Furthermore, these systems do not explore combinations between cryptographic techniques and trusted hardware. This fact limits their applicability to particular applications and does not allow a user to explore different trade-offs of performance, security, and functionalities. Typically, the use of techniques that offer better security guarantees, such as SGX, means that application performance is compromised. On the other hand, using techniques that support a more extensive range of operations results in a lower level of security. Thus, there is a need for a system that enables users to combine different techniques and technologies to protect sensitive information so that they can achieve the requirements of their applications. 1.2 objectives and contributions The main objective of this thesis is to develop a solution that processes analytical queries over protected data. In order to achieve this, we intend to leverage the use of both cryptographic techniques and the SGX technology. Therefore, this dissertation presents the following contributions:
1.3. Dissertation Structure 3 •A modular and extensible architecture for analytical processing systems that supports the simultaneous integration of cryptographic techniques and trusted hardware technologies. This contribution is important for enabling users to explore different trade-offs between performance, security, and functionality. •A secure data analytics prototype based on the architecture proposed, extending the Apache Spark framework with new operations to be performed using three cryptographic techniques and the SGX technology. •An evaluation of the prototype using the TPC-DS benchmark, which is an appropriate benchmark for analytical processing scenarios. This contribution allows verifying the usefulness of the developed tool, as well as to show the cost of the solution in terms of performance. As a result of this work, a research paper entitled ”SafeSpark: Plataforma de Processamento Anal´ ıtico Seguro” was published at the ”11oINForum - Simp´ osio de Inform´ atica” (INForum 2019). 1.3 dissertation structure This document is organized as follows: Chapter 2is a background chapter that describes the concepts that support this work. Chapter 3reviews the state of the art about secure data analytics platforms, describing their architectures, their main features, their security guarantees, and their performance levels. Chapter 4exposes the architecture that we propose for secure analytical processing, while its implementation is described in Chapter 5. Chapter 6 discusses the experimental results of the developed prototype, comparing the trade-offs of performance, security, and functionalities for three different experimental scenarios. Lastly, Chapter 7concludes this dissertation and presents possible future research work on the presented topic.
2 BACKGROUND This chapter exposes the concepts and frameworks that are relevant to the context of this dissertation. Section 2.1describes the main cryptographic schemes that are addressed by the various secure computation systems. The section 2.2introduces the Intel SGX technology, which is a trusted hardware solution for secure remote computing. Section 2.3 presents two solutions with modular and extensible architectures for secure computation on databases. Lastly, Section 2.4presents the Apache Spark platform. 2.1 cryptographic schemes The concept of modern cryptography can be described as the scientific study of techniques for securing digital information [19]. There are many cryptographic schemes to ensure the confidentiality of information, allowing to apply several types of operations on them, each one with specific security guarantees. In order to systematically define the security guarantees of each different encryption scheme, we consider as an adversary any malicious entity whose purpose is to break down the confidentiality of the cryptographic system. Besides, three security guarantees will be considered to define cryptographic schemes: •Indistinguishability under Chosen-Plaintext Attack (IND-CPA): a cryptosystem provides guarantees IND-CPA if an adversary can not distinguish between any two sequences of encrypted messages [19]. •Indistinguishability under Distinct Chosen-Plaintext Attacks (IND-DCPA): weaker security guarantees than IND-CPA and often associated with deterministic algorithms [20]. A cryptosystem provides IND-DCPA guaranties if it does not reveal more than the equality between two ciphertexts. •Indistinguishability under Ordered Chosen-Plaintext Attack (IND-OCPA): it is associated to Order-Preserving Encryption (OPE) schemes and it has weaker security guarantees than IND-CPA and IND-DCPA. Thus, a cryptographic scheme is safe if it reveals no more than the equality and order between two cryptograms [21]. However, Boldyreva 4
2.1. Cryptographic Schemes 5 verified that, in order for this security guarantee to be adopted by OPE schemes, it was necessary for the cryptogram to be significantly larger in size than plaintext, which makes its use impractical in realistic scenarios. Thus, the same author proposed another security assurance for OPE schemes - Pseudorandom Order-Preserving Function advantage under Chosen Ciphertext Attack (POPF-CCA) [21]. This has weaker security guaranties than IND-OCPA, where it was later shown that at least half of the plaintext bits may be leaked [22]. Since the purpose of this dissertation is the integration of security mechanisms into an analytical processing tool, it is essential to understand the advantages and disadvantages of each cryptographic scheme and to understand how they can be useful. 2.1.1Symmetric-Key Encryption Symmetric-key algorithms are characterized by using a secret key to encrypt and decrypt information, which is used whenever two parties want to communicate between them. An adversary who intercepts a message on the communication channel between the parties should not obtain any information about its content. The operation can be illustrated by two parts that we will consider as Alice and Bob. When they want to communicate with each other, they first agree on a shared key k. When Bob wants to send a message to Alice, he encrypts the message m, which is initially in plaintext, using an encryption algorithm E and the key k. He gets the ciphertext by calculating c = E (k, m) and then sends it to Alice. Then, since Alice knows the secret key agreed with Bob, she can decrypt cryptogram cby computing m = D (k, c) [23]. These algorithms are divided into two groups: stream ciphers and block ciphers. A stream cipher is a method that encrypts plaintext using a bit stream (keystream), processing one bit at a time. On the other hand, a block cipher encrypts plaintext in which a cryptographic key and a deterministic algorithm are applied to a block of data (usually 64, 128 or 256 bits) instead of one bit at a time. Block ciphers are pseudorandom permutations, which means that the selected permutation to encrypt a message is chosen with a uniform probability from among the set of all permutations of a specific domain. These ciphers are the basis for several of the existing symmetrical schemes that will be used in this work, such as OPE or Deterministic Encryption (DET). The most common algorithms of block ciphers are Advanced Encryption Standard (AES), Data Encryption Standard (DES),International Data Encryption Algorithm (IDEA),Rivest Cipher 5(RC5)and Blowfish. These algorithms can be executed in different modes of operation with the aim of allowing its use in a safe way, in order to achieve the security goals of confidentiality and authenticity. Some examples of operations mode are Electronic Code
2.1. Cryptographic Schemes 6 Book (ECB),Cipher Block Chaining (CBC),Cipher FeedBack (CFB),Output FeedBack (OFB) and Counter Mode (CTR). 2.1.2Deterministic Encryption A deterministic cryptographic scheme ensures that, for a given plaintext and a key k, always produces the same ciphertext, even considering separate runs of the algorithm. Block ciphers used with a constant initialization vector are examples of such algorithms, which means that the vector of bits that serves to give its pseudo-randomness is fixed. n1== n2=>Enc(n1, k) == Enc(n2, k)(1) DET scheme only leaks encrypted values that correspond to the same value in plaintext, thus providing security guarantees IND-DCPA. This type of scheme allows a server to perform equality comparisons over ciphertexts. Namely, for a database system, this scheme is useful for enabling queries such as GROUP BY,COUNT, or DISTINCT to be computed over deterministically encrypted data. 2.1.3Order-Preserving Encryption Unfortunately, the use of the deterministic schemes only supports operations that involve equality comparisons, not allowing to compare the order between encrypted texts. For example, let us consider that we want to protect a column Age using the cryptographic schemes already presented. If a user wants to query the database with a comparison operator like ”How many clients are over 30 years old?”, a solution for the server to get the correct answer would be to decrypt all the encrypted values and make the comparison in plaintext, however, it brings up both security and performance issues. In this context, Agrawal et al. [24] introduced the concept of OPE. The aim of this scheme is to allow any comparison operation to be directly applied to encrypted data, without decrypting the operands. Thus, range queries like MAX,MIN,COUNT,ORDER BY and GROUP BY can be applied directly over encrypted data. n1>n2=>Enc(n1, k)>Enc(n2, k)(2) OPE cryptographic techniques are quite suitable for database integration since they provide a simple and efficient way of creating indexes. However, they are insecure under straightforward attack scenarios [25]. OPE provides security guarantees IND-OCPA, since
2.1. Cryptographic Schemes 7 an OPE scheme reveals the order of the column values between records. If an adversary knows one or more of the column’s plaintext values, it may learn the possible range of other values through inference. For example, let us consider that a user Xhas the salary of 5k, and a user Yhas the salary of 5.2k. If an attacker knows these two values and knows that the salary of a user Zis between Xand Ysalary values, he can get a good estimate of that value. 2.1.4Order-Revealing Encryption Although OPE schemes can be used to efficiently and effectively process queries over encrypted data, these schemes provide limited security guarantees, since they leak significant amounts of information about their plaintexts. Boldyreva et al. [22] showed that for the scheme proposed by herself, a single OPE ciphertext can leak half of the most significant bits of its underlying plain text. Similarly, Naveed et al. [26] described a set of inference attacks on encrypted relational databases using deterministic and order preservation schemes. Due to these limitations of the OPE scheme, Boneh et al. [27] introduced the Order- Revealing Encryption (ORE) scheme that is closely-related to OPE, although this one has revealed greater flexibility. In contrast to an OPE scheme, where the ciphertext has the numeric format, and the ordering of the plaintext is determined by the numerical comparison of the ciphertext, in an ORE scheme the ciphertext is not restricted to any specific format, and instead, there is a publicly computable comparison function that compares two ciphertexts. An ORE scheme is secure if an encrypted text does not reveal anything about the corresponding single text beyond its lexicographical relation to another ciphertext. As the OPE scheme, ORE scheme also provides IND-OCPA security guarantees, since it reveals the order between two cryptograms [28;29]. 2.1.5Homomorphic Encryption The DET,OPE and ORE schemes allow secure processing of sensitive information, but none of these techniques support arithmetic operations over encrypted data. Homomorphic Encryption (HOM) is a form of encryption which allows performing these operations over encrypted data without the untrusted side having to know the private key, i.e., without the untrusted side needing to decrypt the ciphertext to perform the operation. This scheme produces an encrypted result that, when it is decrypted, it will be the same as if the operation had been done in plaintext. These schemes are divided into two categories: Fully-Homomorphic Encryption (FHE) and Partial-Homomorphic Encryption (PHE). FHE implementations support multiple operations such as addition, subtraction, XOR or multiplication over encrypted data [30;31;32]. However, the preservation of security in the
2.1. Cryptographic Schemes 8 calculations has a significant impact on performance, which makes its usage inefficient for big data scenarios [33]. On the other hand, PHE presents a more efficient approach than FHE, which consists of considering this scheme for specific operations as sums or multiplications. Although they support fewer features, these schemes are useful for aggregations and sums over encrypted data. Paillier Encryption One of the most used PHE schemes in privacy-aware databases is Paillier Encryption (PLR). It allows the addition of two encrypted ciphertexts and provides IND-CPA security guarantees [34]. This scheme is used in various secure computation systems such as Monomi or CryptDB [3;9], in order to compute SUM aggregated queries. The electronic vote is a practical situation that this scheme can be used. Consider a ”for” (1) or ”against” (0) vote election, with Mvoters. Each voter must encrypt his or her voter’s number and vote (0or 1) before submitting it. At the end of the voting period, making the product between the votes, we get the value Nthat corresponds to the sum of all the votes. Thus, it is possible to know that there were Nvotes ”for” and N-M votes ”against”, without revealing the identity of the voters [35]. 2.1.6Discussion Table 1shows the different functionalities of each of the cryptographic schemes presented, as well as their security guarantees. Standard Encryption (STD) will be consider as the symmetric scheme which adopts probabilistic algorithms for encrypting messages, such as AES-128 CBC with random Initialization Vector (IV).DET,OPE and PHE correspond to Deterministic Encryption,Order-Preserving Encryption and Partial-Homomorphic Encryption, respectively. As we can conclude, better security guarantees lead to fewer supported features. This is even more significant in the STD scheme, which offers the highest security guarantees but does not support any functionality. On the other hand, schemes that have more functionality, such as the OPE scheme, have weaker security guarantees. These schemes should be explored and used in applications with different requirements, in order to balance their performance, security and functionality commitments.
2.2. Trusted Hardware 9 Equality Order Arithmetic Operations Security Guarantees Examples of SQL Queries STD IND-CPA None DET X IND-DCPA GROUP BY, DISTINCT, COUNT, IN OPE X X IND-OCPA ORDER BY, MAX, MIN PHE X IND-CPA SUM Table 1.: Comparison of Cryptographic Schemes. 2.2 trusted hardware The problem of secure remote computation is to ensure the integrity and confidentiality of the data when an untrusted remote infrastructure performs computations. The FHE cryptographic scheme ensures data confidentiality as it enables cloud processing to be performed on encrypted data. However, it is not efficient in terms of performance for most of the applications [33;36]. To address this problem, new solutions have emerged based on trusted hardware, which allows new compromises between security and efficiency. Trusted hardware is a general term used to indicate any hardware that has been certified to operate according to a particular set of requirements [37]. With this approach, a user trusts their data to a secure container hosted on the hardware of a remote computer and allows it to perform operations over the data (Figure 1). Manufacturer User'sComputer Computation Dispatcher RemoteComputer TrustedHardware SecureContainer PublicLoader PrivateCode PrivateData Setup Verification SetupComputation EncryptedResults User Infrastructure Owner Manages Trusts Software Provider Authors Builds Trusts Trusts Figure 1.: Trusted Computing (image adapted from [1]). There are two main approaches to trusted hardware solutions: a) using secure coprocessors [38;39;40] or b) incorporating security into the processing units of the computer
2.2. Trusted Hardware 10 [1;41;42;43;44;45;46]. One of the primary goals of all trusted hardware solutions is to reduce their Trusted Computing Base (TCB). This factor defines the set of components, such as hardware, firmware, or software components that are considered critical to system security. Our project focuses on the Intel SGX due to its low TCB and the guarantees of security and confidentiality that it offers. Another important aspect is that all next-generation and future Intel processors support the SGX technology. This solution will be explained in the following subsection. 2.2.1Intel SGX In order to solve the trusted computing problem, Intel presents the SGX technology [1]. This is a trusted hardware solution that consists of establishing protected execution environments (enclaves), whose security depends only on the instruction of the processors and a set of private keys only accessible to the hardware. Enclaves have isolated memory addresses with the assurance that no external environment, such as the operating system or hypervisor, can read or write from them. SGX splits an application into two parts: trusted environment and untrusted environment (Figure 2). The application creates the enclaves, which are placed in the trusted memory. When the application calls a trusted function, i.e., a function that runs inside the enclave, the execution of the application is transferred to the enclave, where only the code within the enclave has access to the data to execute the operations. At this point, the trusted Central Process Unit (CPU) controls the access to enclave memory, denying external accesses. Finally, when the function returns its result, the enclave data remains in the trusted memory and the execution of the application proceeds normally. IntelSGXApplication UntrustedCode TrustedCode 1 2 CreateEnclave CallTrusted 5 NormalExecution 3 DataProcessing 4 ReturnEncrypted Result PrivilegedSystemCode OS,VMM,BIOS,SMM Figure 2.: Intel SGX Application (image adapted from [2]).
2.3. Modular Secure Processing Frameworks 11 Thus, SGX enclaves provide fully isolated execution, which means that they restrict the access to a subset of memory that only one enclave can access. Enclaves also provide sealing, which allows encrypting and authenticating the data inside an enclave so that it can be written to persistent memory without any other process having access to its contents. With this, the data can be reread by its enclave whenever needed. SGX relies on software attestation, which can be local attestation when two enclaves authenticate between themselves platform, or remote attestation when an enclave connects with a remote provider. This feature is crucial to ensure that the critical code is running within the enclave with security guarantees. One of the main advantages of SGX against its predecessors is its lower TCB, since it only includes the code that users decide to run inside their enclave. Thus, SGX provides security guarantees for attacks from malicious software running on the same computer. 2.3 modular secure processing frameworks There are various modular frameworks proposals for secure data processing that support different cryptographic schemes, with different assurances of security and performance. CryptDB [3] is a good example of this approach, however, it supports a particular and limited combination of cryptographic techniques. On the other hand, the SafeNoSQL framework presents a modular and extensible architecture, which enables a user to explore different trade-offs between performance, security, and functionality. Our approach in this work is based on this second one. The next subsections explain these two platforms, describing their architectures and their features. 2.3.1CryptDB There are several security issues in relational databases systems hosted on remote servers. For example, an adversary may exploit system vulnerabilities to gain access to servers, a malicious administrator may observe confidential information from its users, and attackers with physical access to servers can obtain all data on disk and in memory. To solve this problem, the CryptDB system [3] introduces a SQL database that computes queries on encrypted data, providing security guarantees for applications that use a Database Management System (DBMS) hosted on an untrusted server. Figure 3shows the architecture proposed by CryptDB. It consists of two parts: CryptDB proxy server and an unmodified DBMS. The first is hosted on the trusted side and intercepts the queries sent by the Application Server, analyzing and rewriting them with operations to be executed on encrypted data in the unmodified DBMS hosted in an untrusted structure.
3 S TAT E O F T H E A RT In this chapter, we discuss the related work about secure data analytics platforms. Section 3.1and Section 3.2present VC3and Opaque, respectively, which are solutions based on the SGX technology. On the other hand, Monomi and Seabed are solutions based in cryptographic schemes, and they are described in the Sections 3.3and 3.4. Each section describes the system’s architecture, its advantages and disadvantages in terms of performance and security, as well as its experimental results. 3.1 vc3 Verifiable Confidential Cloud Computing (VC3)is a framework developed by Microsoft Research which allows their users to run distributed MapReduce computations in the cloud, ensuring the confidentiality and integrity for both code and data, and also ensuring the accuracy of their results [7]. It uses SGX enclaves and runs on Apache Hadoop. VC3keeps the Hadoop, the operating system and the hypervisor out of its TCB. At the very high-level, the concept developed in VC3is based in having all the code and data encrypted except when it is inside the SGX enclaves, where computation is executed over plaintext data (Figure 9). However, in order to make VC3an efficient system for data analytics computation, VC3design faced some challenges: minimize the TCB; guarantee integrity for the whole distributed computation and to protect the code running in the isolated memory regions from attacks due to unsafe memory accesses. First, to minimize the TCB,VC3implements a code partitioning mechanism. Their users write, test, and debug map and reduce functions using C++ development tools. Then, they encrypt them using a non-deterministic cipher, and bind them to a small amount of public code that implements VC3’s key exchange and job execution protocols. All of this is placed inside a dll file and then uploaded to the cloud which initializes SGX enclaves containing the user code and the VC3public code. These enclaves are launched by public and untrusted code on worker nodes, however, to keep the operating system out of TCB,VC3implements an interface between the public code in ddl file and the outside untrusted environments. This interface consists in two functions: readKV() for reading key-value pairs from Hadoop, 18
3.1. VC319 M RAM InInput M M R R CPU EnclaveCode Figure 9.: VC3’s Architecture (image adapted from [7]). and writeKV() from writing key-value pairs to Hadoop. Since the worker node and the enclave share the virtual address space of a process, data is passed from public code inside the enclave to the worker outside the enclave over a shared memory region outside the enclave. So, the VC3’s TCB simply consists in a dll file plus the SGX processor. The SGX processors only guarantee the integrity of memory regions on individual computers. However, in order to build a fully distributed system, it is necessary to use many machines; at some point, the data needs to come out the enclaves for its execution. At this point, the operating system and the hypervisor may compromise system execution doing things such as not scheduling and distributing processes, corrupt, duplicate or drop the data, and not performing disk I/O. So, in order to guarantee the integrity of the whole distributed computation, VC3propose a job execution protocol: the computed nodes output summaries of the work that they did, and the summaries are aggregated at a verified node. This verified node can check the consistency of these summaries and check if the cloud provider interfered with the computations. As a final contribution, VC3also proposes a mechanism which aims to protect the code that is executed inside the enclaves against attacks due to unsafe memory accesses. They provide a compiler that efficiently enforces two region self-integrity invariants for code in an isolated region: region-write-integrity and region-read-write-integrity. The first ensures that writes through pointers can only be written to address-taken variables or heap allocation inside the enclave. The latter, in addition to the integrity guarantees provided by read-write- integrity, also ensures that reads through pointers cannot go outside the enclave. VC3’s experimental results show an overhead of 4.5% with write integrity and 8% with read/write integrity, comparing with unprotected Hadoop.
3.2. Opaque 20 3.2 opaque Opaque is an oblivious and encrypted distributed data analytics platform which aims to provide strong confidentiality guarantees as well as computation integrity and obliviousness using SGX hardware enclaves [8]. It extends Spark SQL with extra SQL operators and rules to run analytic queries securely. To support oblivious queries and provide additional security guarantees, Opaque is implemented on top of Catalyst, requiring minimal extensions on this, but without requiring any modifications in the Spark’s libraries. In terms of its architecture (Figure 10), the only change from Opaque to Spark SQL is the location of the query planner to the client-side to prevent a malicious cloud from compromising query planning and hence job execution. JobDriver Catalyst Opaque's Rules Job Client/TrustedSite Server/UntrustedSite Scheduler Encrypted DAG Encrypted DB SGXEnclave SparkWorker Processing Verifier Spark Workers Figure 10.: Opaque’s Architecture (image adapted from [8]). For the system initialization, Opaque uses remote attestation to assure that the correct code has been loaded into the enclaves. Then, a secure communication channel is established between the client and the enclaves, and this is used to agree on a secret key shared between them. Thus, the enclave can read and operate on data encrypted by the client. When a client wants to execute a query over encrypted data, Opaque first translates the query into a DAG of encrypted operators. The DAG is then given to the scheduler which is located on the untrusted region, and this one assigns tasks to the Spark Workers. When they complete these tasks, the encrypted result is sent to the client. Since a malicious cloud can drop data, and modify data or computation, Opaque implements a self-verify computation, to ensure the data and computation integrity. This approach is based on two facts: if computation does not abort, the execution completed so far is correct; if the computation complete, then the entire query was executed correctly. Opaque presents three execution modes: encryption mode, oblivious mode and oblivious pad mode. In the encryption mode, it provides data encryption and authentication, and it uses the self-encryption integrity protocol described above. However, this mode of execution can leak access patterns. This can occur at the memory-level when an Operating
3.3. Monomi 21 System (OS) can infer information about the encrypted data by controlling an application’s page accesses. This can also occur at the network-level when in the distributed setting tasks produce network traffic that reveals information about the encrypted data. For example, the GROUP BY operation typically produces network traffic with encrypted data. In this operation, each machine iterates its records and assigns each one to a bucket. Then, the records are shuffled into the network so that records within the same bucket are sent to the same machine. In this way, an attacker can see the number of items sent to each machine and, combining this with the public knowledge about the data, he may be able to infer valuable information [8]. To solve this problem, Opaque oblivious mode includes all the security guarantees in the encryption mode and additionally provides oblivious execution in order to hide data access patterns. This strategy encompasses new sensitive SQL operators such as oblivious filter or aggregation-join that have as input at least one sensitive table or intermediate result set of operators involving at least one sensitive table. These sensitive operators are itself based on new Opaque operators that use oblivious primitives such as intra-machine oblivious sorting or inter-machine oblivious sorting. Although this approach hides data accesses, it does not hide the computation executed on the server or the size of the data, so an attacker can know the input and output size for a SQL operator and the query plan generated by the Catalyst, which may leak some statistical information. Also, the oblivious mode is slower in terms of performance. To address this challenge, Opaque provides new query planning techniques, both rule-based and cost-based. Oblivious pad mode improves the oblivious mode by preventing size leakage. The platform was evaluated in three types of workloads: SQL, machine learning, and graph analytics. In order to evaluate Opaque against vanilla Spark SQL, which provides no security guarantees, they used three out of four queries of the Big Data Benchmark [49]. For the machine learning workload, they chose least squares regression on 2D Data, and for the graph analytics they used PageRank. They showed that the encryption mode’s performance is competitive with the baseline, and it ranges from being 52% faster to 3.3x slower. The results where performance was better is mainly due to the definition of query optimization strategies. On the other hand, oblivious mode slows down the baseline by 1.6to 46 times. The Opaque was also compared to GraphSC [50] using PageRank. This evaluation showed that it could improve GraphSC performance by about 2300x. Finally, they showed that their querying optimization techniques result in 2to 5times more efficient queries. 3.3 monomi Monomi is a system that uses cryptographic schemes to encrypt an entire database and run analytical queries over the encrypted data [9]. It is based in CryptDB [3] design, which
3.3. Monomi 22 uses specialized encryption schemes to perform operations like equalities, sorting and aggregation over encrypted data. However, CryptDB is not prepared to run over analytical workloads, since it only runs four out of 22 TPC-H with significant overhead. In order to construct a system that can efficiently and securely execute analytical queries over encrypted data, Monomi faced three main challenges. First, the use of cryptographic schemes that considerably increase the size of the data may limit the execution time of queries processing, since the I/O system limits the execution of queries over large amounts of data. Second, the complexity of analytic queries can make querying over encrypted data inefficient or even impossible. Third, the use of cryptographic techniques can slow down some queries. For example, PLR can be used on the untrusted server-side to compute sums on encrypted data. However, the cost of decrypting a cryptogram provided by this scheme on the trusted client-side can be excessively high. In this way, it can be more efficient to decrypt the data and perform the sum in plaintext on the client-side. To deal with these challenges, Monomi presents a split client/server approach that consists of dividing the execution of complex queries between the server and the client. Thus, the untrusted server executes part of the query, and when the remaining parts of the query cannot be computed on the server or can be more efficiently computed on the client-side, the encrypted data is sent to the client, which decrypts it and performs the remaining parts of the query. To illustrate an example of this model, we will use the example given in the Monomi’s paper. Let us consider that we want to use Monomi to run the query from Figure 11. SELECT SUM(price) AS total FROM orders GROUP BY order_id HAVING total > 100 Figure 11.: Example of a SQL Query on Monomi System. To run computations over encrypted data on an untrusted server, Monomi uses specific encryption schemes to perform only certain computations. In the example provided, Mononi encrypts order id using a deterministic encryption scheme, which allows the server to perform the GROUP BY operation. Monomi also encrypts the column price with PLR, which allows the server to compute the sum of encrypted values. However, since total is encrypted with PLR and it does not support order comparisons, the operation total >100 cannot be executed at the server. Thus, Mononi rewrites the query using PAILIER SUM which is a UDF function that computes the encrypted sum of several PLR ciphertexts - Figure 12. Note that price paillier and order id det are the PLR and DET encrypted columns of the original price and order id columns, respectively. The result of this query is sent to the
3.3. Monomi 23 SELECT PAILLIER_SUM(price_paillier) AS total FROM orders GROUP BY order_id_det Figure 12.: SQL Query generated by Monomi from Figure 11. client, which decrypts it, executes HAVING total >100 and sends the matching results to the application. Monomi’s performance measurement mainly consists of the cost of performing computation over encrypted data on the server. To improve performance, Monomi proposes a set of optimization techniques for executing queries: per-row precomputation,space-efficient encryption, grouped homomorphic addition, and pre-filtering.Monomi also proposes a designer optimizer that aims to choose the best set of cryptographic schemes to maximize the performance of the queries. In the example described above, it uses the PLR scheme for the price since it is very likely that the computations over this column are sums. Based on this designer, Monomi also implements a query planner that aims to find the best client/server execution plan for a given query. All components of the Monomi and its flow of execution can be observed in Figure 13. TrustedSite UntrustedSite UnmodifiedDBMS (Postgres) Cryptographic UDFs EncryptedDB Monomi Designer Database Statistics andSchema Representative QueryWorkload Encrypted PhysicalDesign Unencrypted DB ClientODBCDriver MonomiLibrary MonomiPlanner ClientApplication SQLQuery Results User Transformed queryover encrypted data Encrypted Results Figure 13.: Monomi’s Architecture (image adapted from [9]). Monomi, like SafeNoSQL, presents a modular end flexible system, since it allows the administrator to choose the encryption schemes used in each of the columns, and it uses the cryptographic schemes STD,DET,Format-Preserving Encryption (FPE),OPE,PLR and Searchable Encryption (SE). It presents the security guarantee that it never stores data in plaintext on the untrusted server. However, some of these schemes reveal information needed to process queries, such as equalities in the DET scheme or order comparisons in the OPE scheme.
3.4. Seabed 24 The Monomi prototype was implemented on PostgreSQL, and it can run 19 out the 22 TPC-H, which is a decision support benchmark. The achieved a median value of 1.24x slowdown, with a range of values ranging from 1.03x to 2.33x compared to the same benchmark run on an unprotected database. 3.4 seabed Monomi and CryptDB [9;3] systems have security and performance limitations for schemes as OPE and HOM, which can make their use impractical in secure processing over large datasets. Seabed [10] presents a platform developed on Apache Spark, introducing two new cryptographic schemes to face the security and performance issues of the previous systems: Additively Symmetric Homomorphic Encryption (ASHE) and Splayed ASHE (SPLASHE). The ASHE scheme aims to improve the performance levels of homomorphic encryption schemes, such as PLR, which allow executing arithmetic and aggregation operations directly on the cryptograms. As already indicated above, PLR scheme presents strong security guarantees (IND-CPA). However, its performance is compromised since it consists of an asymmetric scheme that needs large-size cryptograms to preserve the supported operations. The ASHE scheme makes this improvement considering a confidence relation between the entities of the system. For example, in a business data, the data producer and the analyst typically have a trust relationship, and it is sufficient to use symmetric encryption, which has much better performance levels. This scheme is up to three orders of magnitude more efficient than PLR. However, it does not fulfill a typical requirement of the homomorphic schemes, which requires the size of a cryptogram does not increase with the number of operations made on it. On the other hand, the second challenged faced by Seabed was to solve the vulnerability that the deterministic schemes present against attacks by inference. Therefore, the SPLASHE scheme presents two execution modes: Basic SPLASHE and Enhanced SPLASHE. The first operates in the follow way: given a column C, and a number of discrete values dthat it can assume, the database scheme is changed by creating dcolumns that replace the column C, calling the new columns as Cd. When the value of column Con line nis x, the value of column Cx on line nis set to 1. For example, if the column Ccontains two occurrences of x, then the column Cx will contain two values set to 1in the rows where x occurs in C, and the remaining values of Cx are set to 0. If the columns resulting from the use of this mode of operation are encrypted using ASHE, the cryptograms are random to the attacker, thus making the system safe from inference attacks. However, this mode of operation is impractical when the range of values is too large, since it increases the storage consumption by a factor of d. The Enhanced mode of the SPLASHE scheme presents an approach where the new columns are only created for the most frequent values, thereby
3.4. Seabed 25 decreasing the storage space. However, this mode needs to know the queries and the distribution of the data before executing any query. Also, this approach presents issues in managing data in which the distribution changes in real-time. Although the SPLASHE modes improve the security guarantees of the deterministic schemes, they require much more storage space. The use of the Enhanced mode in realistic applications can require ten times more storage space [10]. The architecture of the Seabed system is demonstrated in Figure 14. Like Monomi and CryptDB, it uses a Planner to determine how to encrypt each column of data. For this, it needs the database schema and a workload representative of the queries that the system will process. During the data storage process, these are sent to the Encryption Module to encrypt the data with the correct ciphers. On the other hand, the Query Code Translator is responsible for transforming the queries so these can be executed over encrypted data, on the untrusted side. After performing the query, the server sends the result to the Decryption Module, which is located on the trusted side and is responsible for decrypting the result, sending it then to the user in plaintext. TrustedSite UntrustedSite Spark Workers EncryptedData (HDFS) QueryCode Translator Decryption Module DET OPE ASHE SPLASHE Encryption Module Planner CreatePlan (plaintextschema, samplequeries) UploadData QueryData User Client-SideProxy Server Figure 14.: Seabed’s Architecture (image adapted from [10]). Moreover, as we can observe in the architecture, Seabed also uses DET and OPE schemes in some cases. For example, when a sensitive dimension cannot use SPLASHE because it is used as part of a join, Seabed leverages the use of DET. Another example is when a dimension requires range queries in query filters, in which Seabed uses the OPE scheme. It is also important to note that Seabed follows the client-server approach of Monomi, splitting the execution of queries the server can not compute some operation.
3.5. Discussion 26 3.5 discussion Table 2shows a comparison of the four frameworks presented. As we can see, Opaque and VC3use SGX technology to ensure the confidentiality of data and allow the execution of server-side operations. This approach allows computing any function with confidentiality and integrity guarantees, but these systems are penalized in performance due to the security mechanisms implemented in the processor. On the other hand, Monomi and Seabed uses cryptographic schemes to protect the information, splitting the operations between the trusted client-side and the untrusted server-side. Although cryptographic schemes can be computed on any hardware, their use is limited to the feature set that the schemes allow. Moreover, the use of cryptographic schemes can reveal some information needed to process queries. The main limitation of these systems is that none of them explores different combinations between cryptographic techniques and trusted hardware. Therefore, our goal is to design and implement a modular and extensible system for analytical processing that supports the simultaneous integration of cryptographic techniques and SGX technology. Cryptographic Schemes Trusted Hardware Client Server STD DET OPE PLR ASHE SPLASHE SGX VC3X X Opaque X X Monomi X X X X X X Seabed X X X X X X Table 2.: Comparison of Analytics Frameworks.
4 ARCHITECTURE As already mentioned, the existing secure data analytics solutions do not allow to explore different combinations between cryptographic techniques and trusted hardware, which limits its use to particular applications. This chapter describes the secure processing platform proposed in this work, called SafeSpark, which has a modular and extensible architecture that supports the simultaneous integration of cryptographic techniques and trusted hardware solutions. We propose an architecture based on the Spark SQL module, which currently does not allow analytical processing with privacy guarantees. Therefore, Section 4.1describes the proposed architecture for secure analytical processing, and Section 4.2shows an example of the flow of operations on our platform. 4.1 safespark SafeSpark extends Spark’s original architecture, based on the Spark SQL module, to promote the integration of new secure processing primitives and also allow exploring different combinations of them for applications with specific performance, security, and functionality requirements. We propose a modular and extensible solution for analytical processing, which allows the simultaneous integration of cryptographic techniques and trusted hardware technologies. The system enables users to configure how they want to protect the information. Furthermore, it abstracts the integration of cryptographic techniques and trusted hardware so that they can be integrated into other analytical processing platforms. As shown in Figure 15, the proposed architecture is divided between a trusted site, which is secure and contains the database client who wants to execute queries, and an untrusted side such as a cloud computing service, where data processing and data storage must ensure the confidentiality of sensitive information. Thus, our architecture is based on SafeNoSQL [4], and extends Spark’s with new components: SafeSpark Worker,Handler, CryptoBox and SafeMapper. 27
5.1. CryptoBox 34 main functionalities: a first to encrypt and decrypt the information, and the latter to process information. The encryption component uses an AES Block Cipher in CTR mode. In order to provide randomness to the cryptograms and provide similar security guarantees to those proposed for STD scheme, the cipher uses a counter, which is incremented for each encryption. More specifically, it uses the ippsAESEncryptCTR and ippsAESDecryptCTR primitives of the Intel Integrated Performance Primitives Cryptography Library (IPPCP) [53]. Thus, the implementation of the data encryption and decryption phase follows the proposed interface for the CryptoBox modular structure (Figure 16). In the processing component, it was necessary to implement new primitives to allow the execution of calculations within the secure SGX enclaves. These new primitives were implemented in the C programming language and enable the execution of relational and arithmetic operations for the data types int,double and long. When an operation is performed using SGX, the encrypted values are sent to the enclave, which decrypts them by using a key that is previously agreed with the respective clients. It then performs the intended processing operations over plaintext and encrypts back the result. Finally, the encrypted result is sent to the client. For enclave initialization and destruction, the SGX processing API implements two methods: init enclave() and destroy enclave(). The first one is responsible for creating a new enclave and saving its ID, so that that the same enclave can be used in future requests. The second allows destroying the enclave, thus releasing allocated resources being used by it. Besides, it also implements a method process enclave that enables to compute operations within SGX enclaves. This method receives the two values on which we want to compute, and also their respective sizes, which are necessary since we use the function strincmp for comparing strings. Also, we need to specify with an integer the type of operation that we want to perform within the SGX enclave (e.g., greater, less or sum). Since the other components of the architecture such as SafeMapper or CryptoBox are implemented in Java, we use the Java Native Interface (JNI) to integrate the SGX processing component with the remaining ones. This framework allows Java code running on a Java Virtual Machine (JVM) to call or be called by native applications developed in the C language. In our implementation, we consider the usage of an enclave for each Spark Worker. We also consider the establishment of a secure channel between the clients and the enclaves, which used to exchange encryption keys so that SGX enclaves can decrypt client data. The implementation of this mechanism is not an objective of this dissertation, but future work may follow solutions such as those presented in [54] and [55].
5.2. SafeMapper 35 5.2 safemapper As already mentioned, the SafeMapper module does the mapping between the database schema and the secure configuration file defined by the user. For our prototype, we extend the SafeMapper version implemented in the SafeNoSQL framework to support the SGX technology. A user who wants to encrypt data has to specify in an XML file the technique that he wants to use to protect each data column. He can use STD,DET,OPE and SGX techniques or, for non-sensitive data, leave that specific columns in plaintext. In addition to the parameters defined in the version proposed by SafeNoSQL, which defines the cryptographic technique and the parameters to create each CryptoBox, in SafeSpark an user must specify the initial data type of each data column. This property is required so that query results can be returned to the user in their original data types - phases Ð,Ñ,Òand Óof the SafeSpark architecture (Figure 15). Moreover, in our implementation, an user can also define if he wants to duplicate a specific column, protecting it with different cryptographic techniques. Figure 18 shows the structure of an XML file defined for the SafeSpark prototype, on which we want to encrypt a column called ca city from the customer adress table with both DET and SGX CryptoBoxes. <schema> <table> <name>customer_address</name> <columns> <family> <name>customer_address</name> <qualifier> <name>ca_city</name> <cryptotechnique>DET</cryptotechnique> <misc> <property>Type</property> <type>String</type> </misc> <misc> <property>Duplicate</property> <type>SGX</type> </misc> </qualifier> <!-- Remaining columns of the customer address table --> </family> </columns> </table> <!-- Remaining tables of the database --> </schema> Figure 18.: Example of XML configuration file.
5.3. SafeSpark Worker 36 As we can see, we have to define the name of the table both in the name field of table, and in the name field of qualifier. This happens because we reuse the SafeMapper version used in this SafeNoSQL system, which was built to be used with an HBase database. In our case, since we use relational databases, we consider that a table field has only one qualifier, and each qualifier represents a table from a relational database. It is also important to note that the duplication encryption strategy is useful to support different operations on the same column, and also to optimize results. For example, although the usage of OPE scheme is important to support a wider range of queries, its decrypting time is slower. To improve the query execution time, we can duplicate OPE columns with STD to reduce the decrypt time when the result is sent to the client [4]. 5.3 safespark worker The SafeSpark Worker component is present on both the trusted side to encrypt and decrypt data, and on the untrusted side to perform processing operations. For this, its implementation is divided between the data storage phase and the processing phase. The implementation of both is explained below. 5.3.1Data Storage To support the conversion of plaintext files to encrypted ones, shown in Figure 15 in the data storage phase, we developed a converter using the JAVA programming language. For this, it was decided to use files in Parquet format, since this is the default format of Spark. Parquet is a column-oriented data storage format of the Apache Hadoop ecosystem which provides optimizations that make it very efficient, particularly in analytical processing scenarios. Figure 19 shows the converter API. In the current state, it provides methods that allow to encode and decode data based on the user-defined configuration schema. Also, this provides a method that saves the result to a new parquet file, which is fundamental to load encrypted data into the data sources. The data can be saved to a new file in hexadecimal or byte array format. The parameter avscSchema is a path to an avsc file, which does the mapping between the columns we want to encrypt and datatype we want for each one (byte array, hexadecimal or plaintext). The developed version supports the same encryption techniques as the SafeMapper module. The main advantage of this conversion being developed a new module is the possibility of its usage in other types of systems in addition to SafeSpark, where it is intended to protect data before storing it.
5.3. SafeSpark Worker 37 List<List<Object>> encode() List<List<Object>> decode(List<List<Object>> encrypted) void saveToFile(List<List<Object>> encrypted, String pathFile, String avscSchema) Figure 19.: Parquet Convertor API. 5.3.2Data Processing In the data processing phase on the untrusted side, SafeSpark Worker aims to abstract the use of cryptographic schemes and enable the execution of analytical queries over encrypted data. In order to perform operations within the secure SGX enclaves, we had to implement new operators. To do this, we used the Spark SQL’s UDF and User-Defined Aggregate Function (UDAF) mechanisms, since they allow us to change Spark behaviour without directly changing its source code. These new operators were implemented in the Scala programming language and use CryptoBox SGX enclave process method to support aggregations, arithmetic and relational operations for the data types int,double,long and String. Due to the use of UDF and UDAF, queries are converted to call SGX operators whenever necessary. For example, the SafeSpark Worker translates the query from Figure 17 into a new query invoking SafeSpark operators - Figure 20. As we can see in this example, the native operator avg is converted to a new operator avg sgx, since Salary column was encrypted with SGX CryptoBox and we want to perform the avg operation within SGX enclaves. Besides, the values ”25” and ”30” are encrypted with the OPE CryptoBox in order to support the ordering filter from the WHERE clause. SELECT avg_sgx(Salary) FROM Employees WHERE Age BETWEEN 0FC6AC2E AND 0FC6D497 GROUP BY Category Figure 20.: SQL Query generated by SafeSpark from Figure 17. For decrypting the query results, we extend the Spark SQL DataFrame API, implementing a new operator called collectDecrypt, which decodes the query result before present it to the user. This operator uses the SafeMapper component to verify which Cryptoboxes are needed to decrypt each data column of the query result. Then, it uses those CryptoBoxes to decrypt all the values and sends the decrypted result to the user.
5.3. SafeSpark Worker 38 One of the current limitations of the Apache Spark platform is that it does not yet provide a stable API that enables a user to define their User-Defined Types (UDT). Thus, if a column protected with SGX is present in a GROUP BY or ORDER BY operator, its execution becomes impossible since it is neither possible to invoke UDFs/UDAFs in them, nor to consider these columns as a UDT, which makes it impossible to define operators of equality and order. To solve this problem, in this prototype, we adopted a column duplication strategy using the properties described in SafeMapper (5.2). When a column is encrypted with SGX, and it is necessary to execute one of these operators, we encrypt the same column using the OPE or DET techniques to compute them on the server-side. Table 3shows all operations supported by SafeSpark in the developed prototype. Relational operations refer to operations such as equal to, not equal to, greater than, less than, greater or equal than and less or equal than. From this set, the DET scheme only supports equality computations, whereas the OPE and SGX schemes support both equality and order computations. In addition to these, the SGX operator supports more cases, such as an equality filter when the upper operation is used in strings. Arithmetic operations are only supported by SGX for int, double, and long data types. Finally, the DET and OPE schemes enable the computation of equality and order aggregations, such as GROUP BY, and SGX supports aggregations using arithmetic operations such as SUM or AVG. Relational Operations Arithmetic Operations Agreggations STD - - - DET Equality - GROUP BY, ROLL UP OPE Equality & Order - GROUP BY, ROLL UP, ORDER BY SGX All +, -, /, * SUM, AVG Table 3.: Operations Supported on SafeSpark Platform. The operations presented in the table are explored in the next chapter, where we describe the experimental evaluation of the developed prototype.
6 EXPERIMENTAL EVALUATION In order to validate the proposed solution and to measure the cost of adding security guarantees when executing analytical processing on Apache Spark, we performed an experimental evaluation of the SafeSpark prototype. Therefore, we set up three different experimental scenarios using the TPC-DS Benchmark [56], alternating the schemes used to protect each of the data columns. Throughout this chapter, Section 6.1describes the TPC-DS benchmark and the three secure configuration schemes defined. Section 6.2explains the methodology used to evaluate the solution as well as the experimental hardware configuration used. Later, Section 6.4 shows the results for each of the experimental scenarios, and, finally, Section 6.5presents a discussion of the results obtained, analyzing the different trade-offs between performance, security, and functionality obtained. 6.1 tpc-ds benchmark The TPC-DS benchmark [57] models the decision support functions of a retail product supplier. It considers essential components of any decision support system: data loading, multiple types of queries, and data maintenance. The TPC-DS data model consists of multiple snowflakes schemes interconnected by shared dimensions. This type of scheme is similar to the star schema approach, where there are a large fact table and several small tables (dimensions) connected to it. However, in a snowflake scheme, in addition to the relations between dimension tables and fact tables, dimensions may have relations with other dimensions, which makes the TPC-DS approach more complex and realistic. To explore different user behaviors in a decision support system, the TPC-DS benchmark provides four query classes that represent different types of database activities in this type of systems: •Reporting Queries: this query class simulates ”reports” on a decision support system, including queries evaluated periodically to answer to statistical business questions. 39
6.2. Experimental Setup and Methodology 40 These queries tend to be static, which means that, typically, the user only changes the query parameters for different executions. •Ad-Hoc Queries: this class considers queries that are built to answer questions of an improvised nature. While in the previous class, a database administrator can optimize the schema to get better performance results, in this type of queries, it may be not possible since the result cannot be predetermined. These queries tend to be more complex, and are often used to discover exclusive attributes in a dimension table of a star schema. •Interactive OLAP Queries: similar to the class of Ad-Hoc queries, distinguished by the fact that query sequences may be related among them. This query class models generated queries to find answers to various business questions or exception patterns. •Data Mining Queries: queries in this class tend to process large volumes of data in order to obtain valuable information into previous customer behaviors, allowing getting better business decisions in future situations. Typically, the data mining query class uses join operations and returns a large data result set. In order to observe the impact of our platform in each query category, we selected two queries from each group based on previous work [58;59]. Thus, we chose the queries 27 and 73 for Reporting Class, queries 37 and 82 for Ad-Hoc, queries 24 and 31 for Iterative OLAP, and queries 40 and 46 for Data Mining Class. 6.2 experimental setup and methodology We evaluated the prototype using a distributed cluster composed by five nodes, configured with Cloudera Manager v.6.1.1. For the Client node, with the function of executing the queries and manage the cluster, we used a node equipped with Intel Core i3-4170 CPU 3.70GHz, 15.9GiB (DDR3) RAM, SATA3 119GiB SSD and with a Gigabit network interface. The nodes with data processing function (Workers) are equipped with Intel Core i3-7100 CPU 3.9GHz, 7.8GiB (DDR3), SATA3 119GiB SSD, with Intel SGX support, and with a Gigabit network interface. Our experiments used a 10x scale factor on the TPC-DS benchmark, which corresponds to a total of 12GB of data. During the data storage phase, we used a separate server to encrypt the data. It is equipped with an Intel (R) Xeon (R) CPU E5-2698
[email protected], 31.3GiB (DDR3) and a Gigabit network interface. We used version 2.4of Apache Spark and version 3.0.0of Hadoop Distributed File System (HDFS) for data storage. We performed ten runs for each of the queries with both Spark running on top of encrypted data, in each of the three experimental scenarios (SafeSpark), as well as over plaintext data (Spark Vanilla). For each query, we analyzed the mean and standard deviation of
6.3. Database Schemas 41 the execution time. Besides, we measured the CPU and memory, as well as the impact on disk read/write operations and on the network traffic. Moreover, we also analyzed the data loading times and the impact on the storage space when data is encrypted. 6.3 database schemas With the goal of evaluating the SafeSpark platform in situations with different requirements, we decided to consider three different experimental scenarios. These use the TPC-DS benchmark database, varying the schemes used to protect each of the data columns. The aim is to analyze and compare their different performance, security, and functionality. The following subsections explain the rules used to define each secure database configuration schema. All configuration schemes are presented in detail at the Appendix A. 6.3.1Configuration Schema 1- SGX The first test scenario aims to use the SGX technology in the broadest range of cases. Thus, we use this technology in all possible columns, following by the use of OPE and DET schemes. We will call this configuration scheme SafeSpark-SGX. Therefore, the configuration scheme considers the following rules: 1. We used the SGX technology to protect as many columns as possible since it supports a wide set of operations. So, we considered the use of SGX for all arithmetic operations, as well as for filters of equality and order. 2. We used the OPE scheme only for ORDER BY operations, since this operation is not support by SafeSpark prototype, as explained in subsection 5.3.2. 3. The DET scheme was used only for GROUP BY and ROLL UP operations. 4. For the remaining columns, on which no processing is performed, we used the STD scheme to encrypt them. 6.3.2Configuration Schema 2- OPE While the previous configuration scheme maximizes the use of SGX technology to protect the information, this second scenario - SafeSpark-OPE - aims to maximize the use of cryptographic schemes, starting with the use of OPE scheme, followed by the DET scheme. The defined secure database configuration file follows the following rules: 1. The SGX technology was used only for columns that require operations not supported by DET and OPE schemes, such as arithmetic operations, sums or averages.
6.3. Database Schemas 42 2. We used the OPE scheme to protect columns that are used in operations that need order preservation, such as ORDER BY or BETWEEN. 3. For the remaining columns that were used in equality operations, but which were not yet encrypted with OPE, we use the DET scheme. 4. For remaining columns, on which no processing is performed, we used the STD scheme to encrypt them. 6.3.3Configuration Schema 3- DET As in the previous configuration scheme, this second also maximizes the use of cryptographic schemes. However, this third experimental scenario - SafeSpark-DET - gives priority to the DET schema instead of the OPE schema to encrypt the data. Thus, we want to reduce the number of OPE columns that used in the GROUP BY and ROLL UP operations since a column used in one of these operations must be in the query result and, consequently, needs to be decrypted. Since the previous work [4] has already proved that the time to decrypt with the OPE scheme is much slower than with the DET scheme, we expect to reduce the decryption time when the query results are sent to the user. The configuration scheme considers the following rules: 1. As in Schema 2, the SGX technology was used only for columns that require operations not supported by DET and OPE schemes, such as arithmetic operations, sums or averages. 2. We used the DET scheme for all columns which needs to preserve equality, such as GROUP BY or equality filters. 3. For the remaining columns that requires order comparisons, we used the OPE scheme. In some cases, it was necessary to duplicate some columns already protected by DET. For example, when the same column is used simultaneously in a GROUP BY and ORDER BY operation. 4. For remaining columns, on which no processing is performed, we used the STD scheme to encrypt them. With these three experimental scenarios, we want to evaluate the impact of each encryption technique on the SafeSpark platform, both in the loading and storage phase and in the processing phase.
6.4. Results 43 6.4 results This section presents the most relevant results obtained from the SafeSpark experimental evaluation. Subsection 6.4.1shows the results of the processing and storage phase, subsection 6.4.2presents and justifies the latency of the queries execution and, lastly, subsection 6.4.3analyzes the resources usage. 6.4.1Loading and Storage As mentioned, in this experimental evaluation, we used the TPC-DS benchmark with a 10x scale factor, in which Spark Vanilla loading phase took 4.7minutes. To check the time from this phase for SafeSpark, we consider not only the loading time but also the data encryption time. For the configuration where we maximized the use of the SGX (6.3.1), SafeSpark took 697.1 minutes to encrypt and load the data, and the data size increased by 4.73x. For SafeSpark- OPE (6.3.2), the loading time was 735.1min, and the data size increased by 6.23x. Finally, the loading time for SafeSpark-DET (6.3.3) was 776.3min, and the data increased by 6.39x. The impact shown by SafeSpark during the loading phase may be justified by the use of the OPE scheme to encrypt data, since it has a longer encoding time than the others schemes, especially when the plaintext size is larger [4]. On the other hand, the cryptograms generated by the OPE scheme are much larger than the plaintext, which can explain the impact on the data size for all the configuration schemes. In some cases, the size of the cryptogram increases up to 4x the original plaintext size. 6.4.2Latency Table 4presents the mean and standard deviation obtained from the TPC-DS queries execution. These results generate the graph of the Figure 21, which compares the latency of the SafeSpark executions with the Spark running on plaintext data. The values consider each query execution time, as well as the time to decrypt the result when it is sent to the client. Q. 24 Q. 27 Q. 31 Q. 37 Q. 40 Q. 46 Q. 73 Q. 82 Spark Vanilla (s) 64,722 41,355 63,833 22,986 40,914 40,218 29,334 23,717 ±15,131 ±6,256 ±10,183 ±1,641 ±6,224 ±4,352 ±1,192 ±0,652 SafeSpark-SGX (s) 99,124 84,523 122,322 89,134 97,342 93,29 69,122 97,235 ±5,712 ±2,139 ±4,127 ±3,424 ±4,012 ±2,287 ±2,31 ±4,124 SafeSpark-OPE (s) 74,313 52,56 99,854 60,414 63,132 55,126 38,21 67,827 ±8,568 ±5,913 ±5,137 ±4,237 ±6,003 ±4,811 ±3,104 ±5,9 SafeSpark-DET (s) 72,972 51,278 82,226 55,15 62,181 47,151 37,67 56,584 ±7,093 ±3,755 ±3,247 ±2,706 ±4,153 ±2,179 ±3,468 ±2,257 Table 4.: Average and Standard Deviation of Query Execution Times.
7.1. Future Work 50 7.1 future work As future work, it would be interesting to integrate new cryptographic schemes into the SafeSpark platform, such as ORE [28], to address the performance limitations presented by the OPE scheme. Operations performed with this scheme have a substantial impact on performance, both in data loading and storage and in query processing. With the flexibility of the architecture designed, new techniques can be explored on the platform, allowing for possible improvements of security, performance and functionality. On the other hand, the number of operations supported by SGX technology can also be increased. One solution to this could be to develop our own Spark operators, as does the Opaque platform, avoiding the use of UDF/UDAF, and extending Spark SQL optimization strategies. As we have seen, the approach of using UDF/UDAF has limited the performance of our platform, since Spark does not generate optimized query execution plans in these cases. Another solution would be to use User-Defined Types (UDT) when there is a stable API on the Apache Spark platform. Thus, it would be possible to implement new data types and develop all kinds of operations for them. Furthermore, the system could be evaluated with more massive data sets and new types of queries in order to validate the applicability of the SafeSpark platform to Big Data applications.
BIBLIOGRAPHY [1] V. Costan and S. Devadas, “Intel sgx explained.,” IACR Cryptology ePrint Archive, vol. 2016, no. 086, pp. 1–118,2016. [2] “John M., Benjamin O. intel software guard extensions tutorial series: Part 1, intel sgx foundation.” https://software.intel.com/en-us/articles/ intel-software-guard-extensions-tutorial-part-1-foundation. Accessed: 2019. [3] R. A. Popa, C. Redfield, N. Zeldovich, and H. Balakrishnan, “Cryptdb: protecting confidentiality with encrypted query processing,” in Proceedings of the Twenty-Third ACM Symposium on Operating Systems Principles, pp. 85–100, ACM, 2011. [4] R. Macedo, J. Paulo, R. Pontes, B. Portela, T. Oliveira, M. Matos, and R. Oliveira, “A practical framework for privacy-preserving nosql databases,” in Reliable Distributed Systems (SRDS), 2017 IEEE 36th Symposium on, pp. 11–20, IEEE, 2017. [5] A. Spark, “Apache spark: Lightning-fast cluster computing.” http://spark.apache. org. Accessed: 2019. [6] M. Armbrust, R. S. Xin, C. Lian, Y. Huai, D. Liu, J. K. Bradley, X. Meng, T. Kaftan, M. J. Franklin, A. Ghodsi, et al., “Spark sql: Relational data processing in spark,” in Proceedings of the 2015 ACM SIGMOD International Conference on Management of Data, pp. 1383–1394, ACM, 2015. [7] F. Schuster, M. Costa, C. Fournet, C. Gkantsidis, M. Peinado, G. Mainar-Ruiz, and M. Russinovich, “Vc3: Trustworthy data analytics in the cloud using sgx,” in Security and Privacy (SP), 2015 IEEE Symposium on, pp. 38–54, IEEE, 2015. [8] W. Zheng, A. Dave, J. G. Beekman, R. A. Popa, J. E. Gonzalez, and I. Stoica, “Opaque: An oblivious and encrypted distributed analytics platform.,” in NSDI, pp. 283–298, 2017. [9] S. Tu, M. F. Kaashoek, S. Madden, and N. Zeldovich, “Processing analytical queries over encrypted data,” in Proceedings of the VLDB Endowment, vol. 6, pp. 289–300, VLDB Endowment, 2013. [10] A. Papadimitriou, R. Bhagwan, N. Chandran, R. Ramjee, A. Haeberlen, H. Singh, A. Modi, and S. Badrinarayanan, “Big data analytics over encrypted datasets with 51
Bibliography 52 seabed,” in 12th {USENIX}Symposium on Operating Systems Design and Implementation ({OSDI}16), pp. 587–602,2016. [11] J. Gantz and D. Reinsel, “The digital universe in 2020: Big data, bigger digital shadows, and biggest growth in the far east,” IDC iView: IDC Analyze the future, vol. 2007, no. 2012, pp. 1–16,2012. [12] “The cambridge analytical files.” https://www.theguardian.com/news/series/ cambridge-analytica-files. Acessed: 2019. [13] “Pennic, F. anthem suffers the largest healthcare data breach to date.” https://hitconsultant.net/2015/02/05/ anthem-suffers-the-largest-healthcare-data-breach-to-date/. Accessed: 2019. [14] “Perlroth, N. all 3billion yahoo accounts were affected by 2013 attack.” https://www. nytimes.com/2017/10/03/technology/yahoo-hack-3-billion-users.html. Accessed: 2019. [15] “Isaac, M. and Frenkel, S. facebook security breach exposes accounts of 50 million users.” https://www.nytimes.com/2018/09/28/technology/ facebook-hack-data-breach.html. Accessed: 2019. [16] “Roman, Jeffrey ebay breach: 145 million users notified.” https://www. bankinfosecurity.com/ebay-a-6858. Accessed: 2019. [17] “Eu general data protection regulation.” https://eugdpr.org/. Accessed: 2019. [18] F. B. Durak, T. M. DuBuisson, and D. Cash, “What else is revealed by order-revealing encryption?,” in Proceedings of the 2016 ACM SIGSAC Conference on Computer and Communications Security, pp. 1155–1166, ACM, 2016. [19] Y. Lindell and J. Katz, Introduction to modern cryptography. Chapman and Hall/CRC, 2014. [20] P. Rogaway and T. Shrimpton, “Deterministic authenticated-encryption,” Citeseer, 2007. [21] A. Boldyreva, N. Chenette, Y. Lee, and A. O’neill, “Order-preserving symmetric encryption,” in Annual International Conference on the Theory and Applications of Cryptographic Techniques, pp. 224–241, Springer, 2009. [22] A. Boldyreva, N. Chenette, and A. O’Neill, “Order-preserving encryption revisited: Improved security analysis and alternative solutions,” in Annual Cryptology Conference, pp. 578–595, Springer, 2011.
Bibliography 53 [23] N. Ferguson and B. Schneier, Introduction to cryptography: principles and applications. 2003. [24] R. Agrawal, J. Kiernan, R. Srikant, and Y. Xu, “Order preserving encryption for numeric data,” in Proceedings of the 2004 ACM SIGMOD international conference on Management of data, pp. 563–574, ACM, 2004. [25] T. Ge and S. Zdonik, “Fast, secure encryption for indexing in a column-oriented dbms,” in Data Engineering, 2007. ICDE 2007. IEEE 23rd International Conference on, pp. 676–685, IEEE, 2007. [26] M. Naveed, S. Kamara, and C. V. Wright, “Inference attacks on property-preserving encrypted databases,” in Proceedings of the 22nd ACM SIGSAC Conference on Computer and Communications Security, pp. 644–655, ACM, 2015. [27] D. Boneh, K. Lewi, M. Raykova, A. Sahai, M. Zhandry, and J. Zimmerman, “Semantically secure order-revealing encryption: Multi-input functional encryption without obfuscation,” in Annual International Conference on the Theory and Applications of Cryptographic Techniques, pp. 563–594, Springer, 2015. [28] K. Lewi and D. J. Wu, “Order-revealing encryption: New constructions, applications, and lower bounds,” in Proceedings of the 2016 ACM SIGSAC Conference on Computer and Communications Security, pp. 1167–1178, ACM, 2016. [29] N. Chenette, K. Lewi, S. A. Weis, and D. J. Wu, “Practical order-revealing encryption with limited leakage,” in International Conference on Fast Software Encryption, pp. 474– 493, Springer, 2016. [30] C. Gentry and D. Boneh, A fully homomorphic encryption scheme, vol. 20. Stanford University Stanford, 2009. [31] M. Van Dijk, C. Gentry, S. Halevi, and V. Vaikuntanathan, “Fully homomorphic encryption over the integers,” in Annual International Conference on the Theory and Applications of Cryptographic Techniques, pp. 24–43, Springer, 2010. [32] C. Gentry, “Fully homomorphic encryption using ideal lattices,” in STOC,2009. [33] M. Naehrig, K. Lauter, and V. Vaikuntanathan, “Can homomorphic encryption be practical?,” in Proceedings of the 3rd ACM workshop on Cloud computing security workshop, pp. 113–124, ACM, 2011. [34] P. Paillier, “Public-key cryptosystems based on composite degree residuosity classes,” in International Conference on the Theory and Applications of Cryptographic Techniques, pp. 223–238, Springer, 1999.
Bibliography 54 [35] I. Damg˚ ard, M. Jurik, and J. B. Nielsen, “A generalization of paillier’s public-key system with applications to electronic voting,” International Journal of Information Security, vol. 9, no. 6, pp. 371–385,2010. [36] M. Van Dijk and A. Juels, “On the impossibility of cryptography alone for privacypreserving cloud computing.,” HotSec, vol. 10, pp. 1–8,2010. [37] R. Sion, Trusted Hardware, pp. 3191–3192. Boston, MA: Springer US, 2009. [38] T. W. Arnold, C. Buscaglia, F. Chan, V. Condorelli, J. Dayka, W. Santiago-Fernandez, N. Hadzic, M. D. Hocker, M. Jordan, T. Morris, et al., “Ibm 4765 cryptographic coprocessor,” IBM Journal of Research and Development, vol. 56, no. 1.2, pp. 10–1,2012. [39] “T. C. Group tpm main specification.” https://trustedcomputinggroup.org/ resource/tpm-main-specification/. Accessed: 2019. [40] D. Grawrock, Dynamics of a Trusted Platform: A building block approach. Intel Press, 2009. [41] T. Alves and D. Felton, “Trustzone: Integrated hardware and software security,” 01 2004. [42] D. Lie, C. Thekkath, M. Mitchell, P. Lincoln, D. Boneh, J. Mitchell, and M. Horowitz, “Architectural support for copy and tamper resistant software,” ACM SIGPLAN Notices, vol. 35, no. 11, pp. 168–177,2000. [43] G. E. Suh, D. Clarke, B. Gassend, M. Van Dijk, and S. Devadas, “Aegis: architecture for tamper-evident and tamper-resistant processing,” in ACM International Conference on Supercomputing 25th Anniversary Volume, pp. 357–368, ACM, 2014. [44] D. Evtyushkin, J. Elwell, M. Ozsoy, D. Ponomarev, N. A. Ghazaleh, and R. Riley, “Iso-x: A flexible architecture for hardware-managed isolated execution,” in Proceedings of the 47th Annual IEEE/ACM International Symposium on Microarchitecture, pp. 190–202, IEEE Computer Society, 2014. [45] V. Costan, I. A. Lebedev, and S. Devadas, “Sanctum: Minimal hardware extensions for strong software isolation.,” in USENIX Security Symposium, pp. 857–874,2016. [46] D. Kaplan, J. Powell, and T. Woller, “Amd memory encryption,” White paper,2016. [47] I. H. Akin and B. Sunar, “On the difficulty of securing web applications using cryptdb,” in 2014 IEEE Fourth International Conference on Big Data and Cloud Computing, pp. 745– 752, IEEE, 2014. [48] A. Hadoop, “Apache hadoop.” http://hadoop.apache.org. Accessed: 2019.
Bibliography 55 [49] “AMPlab, University of California, Berkeley, big data benchmark.” https://amplab. cs.berkeley.edu/benchmark/. Accessed: 2019. [50] K. Nayak, X. S. Wang, S. Ioannidis, U. Weinsberg, N. Taft, and E. Shi, “Graphsc: Parallel secure computation made easy,” in 2015 IEEE Symposium on Security and Privacy, pp. 377–394, IEEE, 2015. [51] “Openssl - cryptography and ssl/tls toolkit.” https://www.openssl.org/. Accessed: 2019. [52] L. Fousse, G. Hanrot, V. Lef` evre, P. P´ elissier, and P. Zimmermann, “Mpfr: A multipleprecision binary floating-point library with correct rounding,” ACM Transactions on Mathematical Software (TOMS), vol. 33, no. 2, p. 13,2007. [53] Intel, “Developer reference for intel R integrated performance primitives cryptography 2019.” https://software.intel.com/en-us/ipp-crypto-reference-2019. Accessed: 2019. [54] R. Bahmani, M. Barbosa, F. Brasser, B. Portela, A.-R. Sadeghi, G. Scerri, and B. Warinschi, “Secure multiparty computation from sgx,” in International Conference on Financial Cryptography and Data Security, pp. 477–497, Springer, 2017. [55] R. Pass, E. Shi, and F. Tramer, “Formal abstractions for attested execution secure processors,” in Annual International Conference on the Theory and Applications of Cryptographic Techniques, pp. 260–289, Springer, 2017. [56] M. Poess, B. Smith, L. Kollar, and P. Larson, “Tpc-ds, taking decision support benchmarking to the next level,” in Proceedings of the 2002 ACM SIGMOD international conference on Management of data, pp. 582–587, ACM, 2002. [57] R. O. Nambiar and M. Poess, “The making of tpc-ds,” in Proceedings of the 32nd international conference on Very large data bases, pp. 1049–1058, VLDB Endowment, 2006. [58] O. Kocberber, B. Grot, J. Picorel, B. Falsafi, K. Lim, and P. Ranganathan, “Meet the walkers: Accelerating index traversals for in-memory databases,” in Proceedings of the 46th Annual IEEE/ACM International Symposium on Microarchitecture, pp. 468–479, ACM, 2013. [59] M. Poess, R. O. Nambiar, and D. Walrath, “Why you should run tpc-ds: a workload analysis,” in Proceedings of the 33rd international conference on Very large data bases, pp. 1138–1149, VLDB Endowment, 2007. [60] “Dstat: Versatile resource statistics tool.” http://dag.wiee.rs/home-made/dstat/. Accessed: 2019.
A SAFESPARK CONFIGURATION SCHEMES Table Column CryptoBox(s) Table Column CryptoBox(s) catalog returns cr returned date sk SGX catalog sales cs sold date sk SGX cr returned time sk SGX cs sold time sk SGX cr item sk SGX cs ship date sk SGX cr refunded customer sk SGX cs bill customer sk SGX cr refunded cdemo sk SGX cs bill cdemo sk SGX cr refunded hdemo sk SGX cs bill hdemo sk SGX cr refunded addr sk SGX cs bill addr sk SGX cr returning cdemo sk SGX cs ship customer sk SGX cr returning hdemo sk SGX cs ship cdemo sk SGX cr returning addr sk SGX cs ship hdemo sk SGX cr call center sk SGX cs ship addr sk SGX cr catalog page sk SGX cs call center sk SGX cr ship mode sk SGX cs catalog page sk SGX cr warehouse sk SGX cs ship mode sk SGX cr reason sk SGX cs warehouse sk SGX cr order number SGX cs item sk SGX cr refunded cash SGX cs promo sk SGX default STD cs order number SGX customer address ca address sk DET & SGX cs sales price SGX ca address id SGX Default STD ca city OPE & SGX customer c current cdemo sk SGX ca county OPE & SGX c current hdemo sk SGX ca state SGX c current addr sk SGX ca zip SGX c first shipto date sk SGX ca country SGX c first sales date sk SGX Default STD c first name OPE & SGX customer demographics cd demo sk SGX c last name OPE & SGX cd gender SGX c birth day SGX cd marital status SGX c birth country SGX cd education status SGX Default STD Default STD household demographics hd demo sk SGX date dim d date sk DET & SGX hd income band sk SGX d date id SGX hd buy potential SGX d date SGX hd dep count SGX d month seq SGX hd vehicle count SGX d year OPE & SGX Default STD d dow SGX inventory inv date sk SGX d dom OPE inv item sk DET & SGX d qoy DET inv warehouse sk SGX Default STD inv quantity on hand OPE & SGX item i item sk SGX Default SGX i item id OPE & SGX store returns sr returned date sk SGX i item desc DET & SGX sr return time sk SGX i current price OPE & SGX sr item sk SGX i brand id SGX sr customer sk SGX i class id SGX sr cdemo sk SGX i category id SGX sr hdemo sk SGX i manufact id SGX sr addr sk SGX i manufact SGX sr store sk SGX i size SGX sr reason sk SGX i color DET & SGX sr ticket number SGX i units DET & SGX Default STD i manager id DET & SGX Default STD 56
57 Table Column CryptoBox(s) Table Column CryptoBox(s) store sales ss sold date sk SGX store s store sk SGX ss sold time sk DET s store id SGX ss item sk DET s rec start date SGX ss customer sk DET s rec end date SGX ss cdemo sk SGX s closed date sk SGX ss hdemo sk SGX s store name OPE & SGX ss addr sk DET s market id SGX ss store sk SGX s division id SGX ss promo sk DET s company id SGX ss ticket number OPE s city SGX ss quantity SGX s county SGX ss list price SGX s state OPE & SGX ss sales price SGX s zip SGX ss ext sales price SGX Default STD ss coupon amt SGX warehouse w warehouse sk SGX ss net paid SGX w warehouse id SGX ss net profit SGX w state OPE & SGX Default STD Default STD web sales ws sold date sk SGX web sales ws ship hdemo sk SGX ws sold time sk SGX ws ship addr sk SGX ws ship date sk SGX ws web page sk SGX ws item sk SGX ws web site sk SGX ws bill customer sk SGX ws ship mode sk SGX ws bill cdemo sk SGX ws warehouse sk SGX ws bill hdemo sk SGX ws promo sk SGX ws bill addr sk SGX ws ext sales price SGX ws ship customer sk SGX Default STD ws ship cdemo sk SGX Table 8.: SafeSpark Configuration 1- SGX.
58 Table Column CryptoBox(s) Table Column CryptoBox(s) catalog returns cr returned date sk DET catalog sales cs sold date sk DET cr returned time sk DET cs sold time sk DET cr item sk DET cs ship date sk DET cr refunded customer sk DET cs bill customer sk DET cr refunded cdemo sk DET cs bill cdemo sk DET cr refunded hdemo sk DET cs bill hdemo sk DET cr refunded addr sk DET cs bill addr sk DET cr returning cdemo sk DET cs ship customer sk DET cr returning hdemo sk DET cs ship cdemo sk DET cr returning addr sk DET cs ship hdemo sk DET cr call center sk DET cs ship addr sk DET cr catalog page sk DET cs call center sk DET cr ship mode sk DET cs catalog page sk DET cr warehouse sk DET cs ship mode sk DET cr reason sk DET cs warehouse sk DET cr order number DET cs item sk DET cr refunded cash SGX cs promo sk DET default STD cs order number DET customer address ca address sk DET cs sales price SGX ca address id DET Default STD ca city OPE & STD customer c current cdemo sk SGX ca county OPE & STD c current hdemo sk SGX ca state DET c current addr sk SGX ca zip DET c first shipto date sk SGX ca country SGX c first sales date sk SGX Default STD c first name OPE & SGX customer demographics cd demo sk DET c last name OPE & SGX cd gender DET c birth day SGX cd marital status DET c birth country SGX cd education status DET Default STD Default STD household demographics hd demo sk DET date dim d date sk DET hd income band sk DET d date id DET hd buy potential DET d date SGX hd dep count SGX d month seq SGX hd vehicle count SGX d year OPE & SGX Default STD d dow DET inventory inv date sk DET d dom OPE inv item sk SGX d qoy DET inv warehouse sk DET Default STD inv quantity on hand OPE item i item sk SGX Default SGX i item id DET store returns sr returned date sk DET i item desc OPE & STD sr return time sk DET i current price DET sr item sk DET i brand id OPE & SGX sr customer sk DET i class id DET sr cdemo sk DET i category id DET sr hdemo sk DET i manufact id DET sr addr sk DET i manufact DET sr store sk DET i size DET sr reason sk DET i color DET sr ticket number OPE i units DET Default STD i manager id DET Default DET
59 Table Column CryptoBox(s) Table Column CryptoBox(s) store sales ss sold date sk DET store s store sk DET ss sold time sk DET s store id DET ss item sk DET s rec start date DET ss customer sk DET s rec end date DET ss cdemo sk DET s closed date sk DET ss hdemo sk DET s store name OPE & STD ss addr sk DET s market id DET ss store sk DET s division id DET ss promo sk DET s company id DET ss ticket number OPE s city DET ss quantity SGX s county DET ss list price SGX s state OPE & STD ss sales price SGX s zip DET ss ext sales price SGX Default STD ss coupon amt SGX warehouse w warehouse sk DET ss net paid SGX w warehouse id DET ss net profit SGX w state OPE & SGX Default STD Default STD web sales ws sold date sk DET web sales ws ship hdemo sk DET ws sold time sk DET ws ship addr sk DET ws ship date sk DET ws web page sk DET ws item sk DET ws web site sk DET ws bill customer sk DET ws ship mode sk DET ws bill cdemo sk DET ws warehouse sk DET ws bill hdemo sk DET ws promo sk DET ws bill addr sk DET ws ext sales price SGX ws ship customer sk DET Default STD ws ship cdemo sk DET Table 9.: SafeSpark Configuration 2- OPE.
66 Query 82 Master Worker #1Worker #2Worker #3Worker #4 Vanilla CPU (%) 20,4484 16,3797 17,7438 20,7514 15,228 Memory (GB) 14,8369 6,4895 5,7057 5,9703 5,9389 Disk - Read (KB/s) 1,1435 217,3096 553,4761 1186,0024 667,4984 Disk - Write (KB/s) 84,1208 2726,6377 2783,3906 2791,0412 2149,1888 Network - Recv (MB/s) 230,4729 3624,4889 4635,7599 4409,9697 3276,2103 Network - Send (MB/s) 10,3158 1,0811 1,4955 1,9274 1,2462 SafeSpark SGX CPU (%) 10,7094 15,712 26,1455 21,486 18,113 Memory (GB) 13,1132 7,0507 7,5622 7,1945 7,1049 Disk - Read (KB/s) 0,568 375,1719 511,1284 504,3222 3067,5696 Disk - Write (KB/s) 77,0669 4221,9839 4137,8043 9059,336 2729,8311 Network - Recv (MB/s) 233,4889 5290,9801 7317,4096 6592,4729 5850,4276 Network - Send (MB/s) 3,0294 2,2098 10,3978 7,2737 6,1507 SafeSpark OPE CPU (%) 12,5662 17,11 20,4133 19,3468 23,3073 Memory (GB) 13,812 6,873 6,7592 6,687 6,6337 Disk - Read (KB/s) 1,2343 2068,553 1142,8094 737,8679 966,3688 Disk - Write (KB/s) 91,9354 3114,1468 3807,3392 3457,5307 4661,2379 Network - Recv (MB/s) 129,9346 9217,8526 3135,4188 3193,0004 4376,609 Network - Send (MB/s) 5,3636 5,8188 2,0689 4,6463 2,2049 SafeSpark DET CPU (%) 12,716 19,8927 22,1083 22,2895 18,7453 Memory (GB) 15,744 5,6446 5,6528 7,319 5,564 Disk - Read (KB/s) 5,8093 788,0006 1875,26 941,4218 801,3257 Disk - Write (KB/s) 83,7095 11354,3653 165,2893 160,5975 8961,2302 Network - Recv (MB/s) 181,835 5473,569 6370,1873 6412,8011 6417,7381 Network - Send (MB/s) 19,0677 0,977 1,6622 1,5809 1,5694 Table 18.: Dstat Results - Query 82.