Haven. Shielding applications from an untrusted cloud. Andrew Baumann Marcus Peinado Galen Hunt Microsoft Research



Similar documents
Intel Software Guard Extensions(Intel SGX) Carlos Rozas Intel Labs November 6, 2013

Intel s Virtualization Extensions (VT-x) So you want to build a hypervisor?

COS 318: Operating Systems. Virtual Machine Monitors

Privacy Protection in Virtualized Multi-tenant Cloud: Software and Hardware Approaches

Lecture Embedded System Security Dynamic Root of Trust and Trusted Execution

Introduction to Virtual Machines

Chapter 16: Virtual Machines. Operating System Concepts 9 th Edition

Microkernels, virtualization, exokernels. Tutorial 1 CSC469

Virtualization. Pradipta De

Full and Para Virtualization

Chapter 5 Cloud Resource Virtualization

Windows Server Virtualization & The Windows Hypervisor

Compromise-as-a-Service

Attacking Hypervisors via Firmware and Hardware

Virtual Switching Without a Hypervisor for a More Secure Cloud

KVM: A Hypervisor for All Seasons. Avi Kivity avi@qumranet.com

Enabling Technologies for Distributed Computing

Virtualization Technology. Zhiming Shen

Outline. Outline. Why virtualization? Why not virtualize? Today s data center. Cloud computing. Virtual resource pool

Securing your Virtual Datacenter. Part 1: Preventing, Mitigating Privilege Escalation

Software Execution Protection in the Cloud

Virtualization. Dr. Yingwu Zhu

Virtualization. Jia Rao Assistant Professor in CS

Virtual Machines. Virtualization

Cloud Computing #6 - Virtualization

Chapter 14 Virtual Machines

A Survey on Virtual Machine Security

The Art of Virtualization with Free Software

Enabling Technologies for Distributed and Cloud Computing

Basics in Energy Information (& Communication) Systems Virtualization / Virtual Machines

Virtual Machines. COMP 3361: Operating Systems I Winter

VMware and CPU Virtualization Technology. Jack Lo Sr. Director, R&D

Virtual Machine Security

Attacking Hypervisors via Firmware and Hardware

Virtualization Technologies and Blackboard: The Future of Blackboard Software on Multi-Core Technologies

Sierraware Overview. Simply Secure

Virtualization. Types of Interfaces

Security Considerations in Cloud Deployments Matthew Garrett

Cloud^H^H^H^H^H Virtualization Technology. Andrew Jones May 2011

COM 444 Cloud Computing

The QEMU/KVM Hypervisor

Uses for Virtual Machines. Virtual Machines. There are several uses for virtual machines:

Virtualization for Cloud Computing

Xen and the Art of. Virtualization. Ian Pratt

Guardian: Hypervisor as Security Foothold for Personal Computers

Virtualization Technology

Virtualization System Security

Lecture Overview. INF3510 Information Security Spring Lecture 4 Computer Security. Meaningless transport defences when endpoints are insecure

Data Centers and Cloud Computing

Cloud Computing. Up until now

Scaling in a Hypervisor Environment

COS 318: Operating Systems. Virtual Machine Monitors

Virtualization. Jukka K. Nurminen

NoHype: Virtualized Cloud Infrastructure without the Virtualization

Run-Time Deep Virtual Machine Introspection & Its Applications

9/26/2011. What is Virtualization? What are the different types of virtualization.

Hypervisors. Introduction. Introduction. Introduction. Introduction. Introduction. Credits:

Virtualization. Explain how today s virtualization movement is actually a reinvention

Virtual Private Systems for FreeBSD

Real-time KVM from the ground up

Hardware Based Virtualization Technologies. Elsie Wahlig Platform Software Architect

Virtualization is set to become a key requirement

Xen and XenServer Storage Performance

A Hypervisor IPS based on Hardware assisted Virtualization Technology

Trusted VM Snapshots in Untrusted Cloud Infrastructures

Knut Omang Ifi/Oracle 19 Oct, 2015

Virtualization: What does it mean for SAS? Karl Fisher and Clarke Thacher, SAS Institute Inc., Cary, NC

Using Linux as Hypervisor with KVM

Virtual Machine Monitors. Dr. Marc E. Fiuczynski Research Scholar Princeton University

Virtualization. P. A. Wilsey. The text highlighted in green in these slides contain external hyperlinks. 1 / 16

COS 318: Operating Systems

Virtual Computing and VMWare. Module 4

Cloud Architecture and Virtualisation. Lecture 4 Virtualisation

Virtualization Technologies (ENCS 691K Chapter 3)

Android Virtualization from Sierraware. Simply Secure

Patterns for Secure Boot and Secure Storage in Computer Systems

12. Introduction to Virtual Machines

Introduction to Virtual Machines

How do Users and Processes interact with the Operating System? Services for Processes. OS Structure with Services. Services for the OS Itself

Virtual Ghost: Protecting Applications from Hostile Operating Systems

How to Secure Infrastructure Clouds with Trusted Computing Technologies

UNCLASSIFIED Version 1.0 May 2012

Virtual machines and operating systems

Accelerate OpenStack* Together. * OpenStack is a registered trademark of the OpenStack Foundation

Virtualization. Clothing the Wolf in Wool. Wednesday, April 17, 13

Virtualization Technologies

Trustworthy Computing

PERFORMANCE ANALYSIS OF KERNEL-BASED VIRTUAL MACHINE

Cloud Operating Systems for Servers

Intel Virtualization Technology Overview Yu Ke

StACC: St Andrews Cloud Computing Co laboratory. A Performance Comparison of Clouds. Amazon EC2 and Ubuntu Enterprise Cloud

Clouds Under the Covers. Elgazzar - CISC Fall

CPET 581 Cloud Computing: Technologies and Enterprise IT Strategies. Virtualization of Clusters and Data Centers

RUNNING vtvax FOR WINDOWS

A Virtualized Linux Integrity Subsystem for Trusted Cloud Computing

Virtualization. ! Physical Hardware. ! Software. ! Isolation. ! Software Abstraction. ! Encapsulation. ! Virtualization Layer. !

Virtualization. Introduction to Virtualization Virtual Appliances Benefits to Virtualization Example Virtualization Products

Transcription:

Haven Shielding applications from an untrusted cloud Andrew Baumann Marcus Peinado Galen Hunt Microsoft Research

In the old days Application Operating system 2

In the cloud Application Cloud platform Operating system Trust? 3

Hypervisor vulnerabilities are real November 13: Privilege escalation in Hyper-V October 14: Xen guest may read other VM s data May 15: Venom privilege escalation in Xen, KVM 4

Our goals for Haven Secure, private execution of unmodified applications (bugs and all) in an untrusted cloud on commodity hardware (Intel SGX) 5

Trust Can you trust the cloud? Huge trusted computing base Privileged software Hypervisor, firmware,... Management stack Staff Sysadmins, cleaners, security, Law enforcement Hierarchical security model Observe or modify any data Even if encrypted on disk / net Application Operating system Hypervisor Firmware/bootloader Management tools People 6

Current approaches 7

Hardware Security Modules Dedicated crypto hardware Expensive Limited set of APIs Key storage Crypto operations Protects the crown jewels, not general-purpose 8

Trusted hypervisors Hardware root of trust (e.g., TPM or TrustZone) Small, secure, hypervisor Multiplexes hardware Ensures basic security, such as strong isolation Problem #1: system administrators Problem #2: physical attacks (e.g. memory snooping) Problem #3: tampering with hypervisor 9

Remote attestation For example, using a TPM chip Basic idea: Signed measurement (hash) of privileged software Remote user checks measurement Incorrect attestation compromised software Problem: what is the expected measurement? Cloud provider applies patches and updates Must trust provider for current hash value 10

What do we really want? 11

Raw resources Untrusted I/O Secure colo provides: Power and cooling Network access 12

Shielded execution Protection of specific program from rest of system cf. protection, isolation, sandboxing, etc. New term (older concept) Program unmodified, naïve to threats Confidentiality and integrity of: The program Its intermediate state, control flow, etc. Input and output may be encrypted Host may deny service, cannot alter behaviour 13

Threat model We assume a malicious cloud provider Convenient proxy for real threats All the provider s software is malicious Hypervisor, firmware, management stack, etc. All hardware besides the CPU is untrusted DMA attacks, DRAM snooping, cold boot We do not prevent: Denial-of-service (don t pay!) Side-channel attacks (open problem) 14

Background: Intel SGX 15

Intel SGX Hardware isolation for an enclave New instructions to establish, protect Call gate to enter Remote attestation Secret Data Enclave Application (untrusted) EnclaveEntry: mov fs:[tcs],rbx mov fs:[cssa],eax cmp eax, 0 jne ExceptionEntry mov r10,fs:[resadr] cmp r10,0 je @F jmp r10 @@:mov rcx, r8 mov rdx, r9 mov r8, rbx Operating system (untrusted) 16

Enclave Memory Processor designates physical memory range as EPC memory Specified by BIOS at boot time. EPC RAM is encrypted and integrity protected. Applied by processor as cache lines travel between the LLC and RAM RAM and memory buses are now outside the HW TCB. SGX access controls protect enclave memory inside the processor. Only code running in an enclave can access this enclave s memory. SGX access control Processor Package Memory Encryption engine EPC Cache RAM 17

Building an Enclave virtual address space physical address space Unprotected code or data code or data Untrusted code can tamper with Protected mapping EPC enclave creation code or data But any tampering will be recorded in 1. ECREATE(range) the enclave hash 2. EADD(page) 3. EEXTEND(page) SECS ENCLAVE HASH 4. EINIT(page) 18

Executing an Enclave EENTER: jumps to a fixed enclave address Defined during enclave construction EEXIT: jumps to any address outside the enclave Asynchronous exit due to interrupts, exceptions etc. Save and scrub processor state ERESUME: Resume enclave execution after an asynchronous exit. 19

Other features Sealed storage EGETKEY: Enclave can obtain persistent keys as a function of its enclave hash or author Attestation EPID group signature scheme Implemented in a special Quoting Enclave 20

SGX: what s new? (over prior trusted hardware) Doesn t rely on any trusted software Untrusted OS performs scheduling/multiplexing Paging support (Practically) unlimited number of distrusting enclaves Hardware TCB = CPU package Encrypted and integrity-protected RAM CPU-based attestation High level of physical security 21

Haven Design 22

Design challenge: Iago attacks Application Enclave System calls Operating system 23

Iago attacks malloc() returns pointer to user s stack Scheduler allows two threads to race in a mutex System has 379,283 cores and -42MB of RAM read() fails with EROFS Our approach: Don t try to check them all Admit OS into trusted computing base 24

Mutual distrust Haven Unmodified binaries Picoprocess (protects host from guest) Enclave (protects guest from host) Subset of Windows, enlightened to run in-process Shields LibOS from Iago attacks Includes typical kernel functionality Scheduling, VM, file system Untrusted interface with host Application Shield module Untrusted runtime Windows 8 API Library OS (Drawbridge) Drawbridge ABI Untrusted interface Drawbridge ABI & SGX priv ops Drawbridge host SGX driver Windows kernel 25

Untrusted interface Host/guest mutual distrust Policy/mechanism with a twist Virtual resource policy in guest Virtual address allocation, threads Physical resource policy in host Physical pages, VCPUs ~20 calls, restricted semantics Picoprocess Enclave Application Library OS Shield module Windows 8 API Drawbridge ABI Untrusted interface Untrusted runtime Drawbridge ABI & SGX priv ops Drawbridge host SGX driver Windows kernel 26

Untrusted interface Upcalls: ExceptionDispatch(ExceptionInfo) ThreadEntry() Downcalls: AsyncCancel(AsyncHandle) AsyncPoll(AsyncHandle) Results DebugStringPrint(Message) EventClear(EventHandle) EventSet(EventHandle) ObjectClose(Handle) ObjectsWaitAny(Num, Handles, Timeout) Idx ProcessExit(ExitCode) StreamAttributesQueryByHandle(StreamHandle) Attrs StreamFlush(StreamHandle) StreamGetEvent(StreamHandle, EventId) EventHandle StreamOpen(URI, Options) StreamHandle StreamRead(StreamHandle, Off, Sz, Bf) AsyncHandle StreamWrite(StreamHandle, Off, Sz, Bf) AsyncHandle SystemTimeQuery() Time ThreadCreate(Tcs) ThreadHandle ThreadExit() ThreadInterrupt(ThreadHandle) ThreadYieldExecution() VirtualMemoryCommit(Addr, Size, Prot) VirtualMemoryFree(Addr, Size) VirtualMemoryProtect(Addr, Size, Prot) 27

Shield module Memory allocator, region manager Host commits/protects specific pages No address allocation Private file system Encrypted, integrity-protected VHD Scheduler Don t trust host to schedule threads Exception handler Emulation of some instructions Sanity-check of untrusted inputs Anything wrong panic! 23 KLoC (half in file system) Picoprocess Enclave Application Library OS Shield module Windows 8 API Drawbridge ABI Untrusted interface Untrusted runtime Drawbridge ABI & SGX priv ops Drawbridge host SGX driver Windows kernel 28

SGX limitations 1. Dynamic memory allocation and protection New instructions needed 2. Exception handling SGX doesn t report page faults or GPFs to the enclave 3. Permitted instructions Good news! These are fixed in SGX v2 RDTSC/RDTSCP needed, for practicality and performance 4. Thread-local storage Can t reliably switch FS and GS 29

Performance evaluation Implemented and tested using SGX emulator Thanks, Intel! Problem: no SGX implementation yet Solution: model for SGX performance 1. TLB flush on Enclave crossings 2. Variable spin-delay for critical SGX instructions Enclave crossings Dynamic memory allocation, protection 3. Penalty for access to encrypted memory Slow overall system DRAM clock 30

Performance summary Depends on model parameters, details in paper 35% (Apache) 65% (SQL Server) slowdown vs. VM Assumes 10k+ cycles SGX instructions, 30% slower RAM and you don t have to trust the cloud! 31

SGX wish-list Exception handling overhead is high IRET, ERESUME require enclave exits A single application exception (e.g. stack growth) results in two exceptions and eight enclave crossings Demand loading Fixed in spec (EACCEPTCOPY), but we haven t tested it Shielded VMs Everybody wants this Not trivial: can t trap-and-emulate in hypervisor 32

What s next for Haven? Rollback of persistent storage Requires more hardware, or more communication Untrusted time Network time sync, RDTSC Cloud management Suspend / migrate applications [Lorch et al, NSDI 2015] Encrypted VLANs Side-channel defences Open problem [Xu et al, IEEE Security & Privacy 2015] 33

Conclusion Haven is closer to a true utility computing model Utility provides raw resources Doesn t care what you do with them Hope that SGX will be the first step in widespread hardware support for shielded execution 34

Backup 35

Related work TPM-based systems [Flicker, TrustVisor, Credo, Nexus, MiniBox] Vulnerable to simple physical attacks Typically relies on trusted hypervisor Prohibitively expensive otherwise [Flicker] Protecting user memory from the OS [Overshadow, SP³, CloudVisor, SecureME, InkTag, Virtual Ghost] Relies on trusted hypervisor or compiler [Virtual Ghost] Vulnerable to Iago attacks at syscall interface Homomorphic encryption No hardware in the TCB Suitable for some applications [CryptDB, Cipherbase, MrCrypt] Intolerable overheads for general-purpose computation 36

Background: Drawbridge Secure isolation of existing Windows applications Picoprocess for confinement Secure isolation container Low overhead (vs. a VM) Library OS for compatibility Enlightened Windows Strong app compatibility Application advapi32 kernel32 http ntoskrnl.dll Platform adaptation layer LSASS RPCSS SCM win32k RDP server ntdll user32 gdi32 ksecdd afd Win32 API Drawbridge ABI (45 calls) rdpvdd Windows kernel D. E. Porter, S. Boyd-Wickizer, J. Howell, R. Olinsky, G. C. Hunt, Rethinking the library OS from the top down, Proc. ASPLOS 11 Drawbridge driver 37

Provisioning App user Sensitive code/data (encrypted VHD) Trust decision Request Boots LibOS & runs app Cloud host Bare enclave Config Shield module Config Shield module Shield module 38

tpse Performance: SQL Server 160 140 120 100 80 60 40 20 0 Native Hyper-V Drawbridge Haven (Host FS) Haven (VHD) Haven (Enc. VHD) 39

Throughput (req/s) Performance: Apache/MediaWiki 70 60 50 40 30 20 10 0 Native Hyper-V Drawbridge Haven (Host FS) Haven (VHD) Haven (Enc. VHD) 40

tpse Sensitivity to SGX cost: SQL Server 100 90 80 70 60 50 40 30 20 10 0 Memory allocation Enclave crossing 0 10 20 30 40 50 Simulated delay (kcycles) 41

Throughput (req/s) Sensitivity to SGX cost: Apache 50 40 30 20 10 0 Memory allocation Enclave crossing 0 10 20 30 40 50 Simulated delay (kcycles) 42

Sensitivity to memory slowdown Hard to simulate: not many options Scaled down overall DRAM bandwidth and latencies by 33% SQL Server TPC-E throughput reduced by 21% Apache / MediaWiki throughput reduced by 7% Over-estimate: some accesses would be outside the enclave 43