The Case for Intra-Unikernel Isolation

The Case for Intra-Unikernel Isolation

The Case for Intra-Unikernel Isolation Pierre Olivier1, Antonio Barbalace2, Binoy Ravindran3 1The University of Manchester, 2The University of Edinburgh, 3Virginia Tech [email protected], [email protected], [email protected] Abstract early results about the use of Intel Memory Protection Keys (MPK) The unikernel is an emerging operating system model offering and the associated challenges. We then look at a promising emerg- lightweightness, security and performance benefits. In this paper ing technology, namely hardware capabilities, and reason about its we argue that a fundamental design principle of unikernels, the fact application to the problem of intra-unikernel isolation. Because of that one instance is viewed as a single unit of trust, is not suitable the peculiarities of each technology, we expect the related isolation for the high security requirements of today’s cloud applications. models to be quite different, in particular regarding isolation granu- We advocate for the introduction of intra-unikernel isolation. We larity. Furthermore, both technologies offer different characteristics observe that some unikernel benefits derive from another funda- in terms of security guarantees, scalability to high number of pro- mental design principle: the presence of a single address space. tection domains, as well as programmability/ease of applicability We investigate bringing intra-unikernel isolation without breaking to existing unikernel codebases. Focusing on these technologies is that principle with the help of hardware technologies in the form motivated by the fact that they allow low-latency security domain of modern (Intel Memory Protection Keys) and future (hardware switches within a single address space. Low-latency switches align capabilities) Instruction Set Architecture extensions. with unikernel design principles and objectives. Finally, it is worth noting that some of the isolation ideas presented here may also 1 Introduction apply to other OS models. In the rest of this paper, we make the case for intra-unikernel The unikernel [18] is a new Operating System (OS) model in which isolation in Section 2. Next, we discuss the use of Intel MPK as an application and its dependency libraries run alongside a thin well as hardware capabilities to implement compartmentalization Library Operating System (LibOS) [7] on top of a hypervisor in a in unikernels in Section 3. VM. Unikernels are a form of lightweight virtualization and provide various benefits including attack surface reduction, low resource usage leading to cost reduction/high consolidation, strong isolation, 2 Advocating for Intra-Unikernel Isolation as well as improved system performance. There are many situations in which the lack of intra-unikernel As a result, unikernel application domains are plentiful, encom- isolation raises serious security concerns. Modern applications are passing cloud- and edge-deployed micro-services/SaaS/ software [2, made of several components/libraries that have various degrees 14, 19, 27], server applications [14, 17, 18, 27, 38], NFV [5, 18–20], of trustworthiness (for example third-party vs. own code) and a IoT [5, 6], HPC [16], efficient VM introspection/malware analy- variable potential for vulnerabilities (for example a formally verified sis [37], and regular desktop applications [24, 29]. In particular, cryptography library vs. a user-facing input parser) [1]. Isolating unikernels have an important role to play in the upcoming explo- components within an application is useful from the security point sion of serverless computing/FaaS [8, 10, 13]. of view, so as to avoid scenarios in which a subverted vulnerable Regarding security, with this OS model one application runs per component leads to the attacker taking over the entire system, VM instance so the isolation between several unikernels (i.e., appli- including other components manipulating sensitive data. To bring cations) running on the same host is considered strong [19], which such intra-application isolation, a Trusted Computing Base (TCB) is ideal from the cloud provider point of view. However, one of the has to be established to enforce an isolation policy. With current fundamental design principles of unikernels is that application and unikernels, the LibOS cannot play that role as it runs at the same LibOS code/data share a single and unprotected address space [18]: level of privileges as the user code. there is no isolation within a unikernel instance, which is viewed as a In order to bring intra-application isolation to unikernel environ- single unit of trust. This is concerning from the tenant standpoint, ments, we envision two models for placing the TCB, depicted on because with all of the current unikernel offers, a component of the Figure 1. A first model, present on the left side of the picture, has application manipulating sensitive data cannot be isolated from less each application component running in a different VM instance, trusted components such as third party or memory-unsafe code. placing the TCB in the hypervisor. This is the model obtained when This lack of internal isolation has been noted as one of the main using for example the KylinX [38] unikernel, implementing support security issues of unikernels [21]. for fork by spawning a unikernel per process. We believe that this In this position paper, we advocate for an evolution of this OS model conflicts with the lightweightness objectives of unikernels: model to support the isolation of software components within a uniker- indeed, the per-instance memory footprint is multiplied by the nel instance. We observe that several performance benefits of uniker- number of application components. Furthermore, this model breaks nels result from the use of a single address space per instance, en- the single address space principle and as a consequence switching abling for example fast context switches or low system call latencies. between security domains is costly (VMEXIT, EPT switch) and im- Thus, we propose to bring intra-unikernel isolation while keeping pacts performance. Thus, we advocate for a second model, pictured a single address space per VM. We investigate the use of modern on the right of Figure 1. In this model, we establish another layer of and future security ISA extensions. More specifically, we report trust on top of the hypervisor, within the unikernel LibOS, which 1 SPMA 2020, April 2020, Heraklion, Greece P. Olivier et al. Unikernel (VM) instances 2 3 7 8 12 13 Virtual address Trusted app. Entire app. space component RW RW W Page table: Untrusted app. RW Page # Key T … component C Core 1 (thread 1) Core 2 (thread 2) LibOS LibOS LibOS LibOS B 2 0 PKRU register: PKRU: … T T 7 1 C C Key 0 1 15 Key 0 1 2 … B B … … Hypervisor Hypervisor Perm. RW RO - Perm. - - RW 12 2 TCB in hypervisor This paper: Figure 2: Intra-address space isolation with Intel MPK. (HV) TCB in LibOS+HV PKRU registers and page table entries are setup in order to Figure 1: Trust models for isolation in unikernel environ- give different access permissions to threads 1 and 2 regard- ments: in-hypervisor (left) and in-LibOS + in-hypervisor ing the virtual pages 2, 7 and 12. (right) Trusted Computing Bases (TCBs). The TCB repre- sents the code we trust to enforce isolation between appli- Each core (or more precisely, hardware thread) has a register named cation components. PKRU specifying the core’s permission for each of the 16 available keys. These permissions are read-only, read-write, and no access. is now responsible for enforcing isolation within the instance. This Each page of the address space can be tagged with a specific key preserves lightweightness and performance with a single instance using four bits of the corresponding page table entry. An example of and address space per application, but requires isolation between MPK operation is described on Figure 2, where three protection keys the application code and the LibOS, i.e., user/kernel separation in are used to give different access permission to various memory areas the guest. to two threads sharing a single address space. Switching between A second security issue resulting from the lack of intra-unikernel protection domains on a core simply corresponds to updating the isolation appears in unikernels LibOSes written with memory-safe PKRU register, which is very fast [30]. Combined with the fact that languages [3, 15, 18, 34]. Although they offer stronger safety guar- it operates within a single address space, this makes MPK a very antees compared to LibOSes written in C/C++ [11, 12, 22], they all compelling technology to provide intra-unikernel isolation. include a certain quantity of untrusted code necessary to perform However, using MPK is not without limitations/challenges. First, the low-level operations an OS has to support. It can be either plain the limited number of memory keys (16) is a problem and although C code [3, 18, 34] or unsafe Rust code [15]. This can negate the it can be virtually increased [23], this will be at the cost of a perfor- security guarantees that come from using a memory safe language mance impact. Second, for performance reasons the PKRU switch – an attacker may exploit a bug in an unsafe kernel component is an unprivileged operation, and isolation schemes must be com- to take over the system. This further motivates the need for intra- plemented by static code analysis to validate all PKRU manipula- unikernel isolation in the form of safe/unsafe kernel components tion [30]. Indirect PKRU tampering through techniques such as separation. Return-Oriented Programming [26] can be mitigated with Address Space Layout Randomization – an issue in some unikernels sup- 3 Leveraging Modern and Future ISA porting only static binaries. Extensions Unikernel Isolation Model. Due to the low number of pro- Unikernels have by design no user/kernel isolation, a deliberate tection keys, with MPK we advocate for a coarse-grained intra- choice made to cut the switching latency and enable cross kernel- unikernel isolation model.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    4 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us