SGX Security Background. Masab Ahmad Department of Electrical and Computer Engineering University of Connecticut

Similar documents
SGX Enclave Life Cycle Tracking TLB Flushes Security Guarantees

Crypto Background & Concepts SGX Software Attestation

Sanctum: Minimal HW Extensions for Strong SW Isolation

RISCV with Sanctum Enclaves. Victor Costan, Ilia Lebedev, Srini Devadas

Refresher: Applied Cryptography

CIS 4360 Secure Computer Systems SGX

6.857 L17. Secure Processors. Srini Devadas

Ascend: Architecture for Secure Computation on Encrypted Data Oblivious RAM (ORAM)

INFLUENTIAL OPERATING SYSTEM RESEARCH: SECURITY MECHANISMS AND HOW TO USE THEM CARSTEN WEINHOLD

Influential OS Research Security. Michael Raitza

Cache Side Channel Attacks on Intel SGX

Ming Ming Wong Jawad Haj-Yahya Anupam Chattopadhyay

Certifying Program Execution with Secure Processors. Benjie Chen Robert Morris Laboratory for Computer Science Massachusetts Institute of Technology

Recovering cryptographic keys with the cold boot attack

Public-key Cryptography: Theory and Practice

Defending against VM Rollback Attack

Racing in Hyperspace: Closing Hyper-Threading Side Channels on SGX with Contrived Data Races. CS 563 Young Li 10/31/18

Spring 2010: CS419 Computer Security

Framework for Prevention of Insider attacks in Cloud Infrastructure through Hardware Security

Information Security Theory vs. Reality

Trusted Computing and O/S Security

Connecting Securely to the Cloud

Trusted Computing and O/S Security. Aggelos Kiayias Justin Neumann

CIS 4360 Secure Computer Systems Applied Cryptography

Computer Architecture Background

Intel Software Guard Extensions

Terra: A Virtual Machine-Based Platform for Trusted Computing by Garfinkel et al. (Some slides taken from Jason Franklin s 712 lecture, Fall 2006)

Atmel Trusted Platform Module June, 2014

Trusted Execution Environments (TEE) and the Open Trust Protocol (OTrP) Hannes Tschofenig and Mingliang Pei 16 th July IETF 99 th, Prague

Lecture 2 Applied Cryptography (Part 2)

BUILDING SECURE (CLOUD) APPLICATIONS USING INTEL S SGX

CS 416: Operating Systems Design April 22, 2015

Operating Systems. Week 13 Recitation: Exam 3 Preview Review of Exam 3, Spring Paul Krzyzanowski. Rutgers University.

Rowhammer.js: Root privileges for web apps?

IMPLEMENTING MICROSOFT CREDENTIAL GUARD FOR ISO 27001, PCI, AND FEDRAMP

OS Security IV: Virtualization and Trusted Computing

Department of Computer Science Institute for System Architecture, Operating Systems Group TRUSTED COMPUTING CARSTEN WEINHOLD

Computer Security. 08r. Pre-exam 2 Last-minute Review Cryptography. Paul Krzyzanowski. Rutgers University. Spring 2018

Past, Present, and Future Justin Johnson Senior Principal Firmware Engineer

Cryptography CS 555. Topic 16: Key Management and The Need for Public Key Cryptography. CS555 Spring 2012/Topic 16 1

CIS 4360 Secure Computer Systems Secured System Boot

Key Threats Melissa (1999), Love Letter (2000) Mainly leveraging social engineering. Key Threats Internet was just growing Mail was on the verge

Department of Computer Science Institute for System Architecture, Operating Systems Group TRUSTED COMPUTING CARSTEN WEINHOLD

CS Computer Networks 1: Authentication

Authenticated Storage Using Small Trusted Hardware Hsin-Jung Yang, Victor Costan, Nickolai Zeldovich, and Srini Devadas

Cristina Nita-Rotaru. CS355: Cryptography. Lecture 17: X509. PGP. Authentication protocols. Key establishment.

Demonstration Lecture: Cyber Security (MIT Department) Trusted cloud hardware and advanced cryptographic solutions. Andrei Costin

Intel Software Guard Extensions (Intel SGX) Memory Encryption Engine (MEE) Shay Gueron

Computer Security Fall 2006 Joseph/Tygar MT 2 Solutions

Lecture 9a: Secure Sockets Layer (SSL) March, 2004

EXTERNALLY VERIFIABLE CODE EXECUTION

CSC/ECE 774 Advanced Network Security

Side Channels and Runtime Encryption Solutions with Intel SGX

Lecture 5: Protocols - Authentication and Key Exchange* CS 392/6813: Computer Security Fall Nitesh Saxena

Information Security CS 526

Pass, No Record: An Android Password Manager

CS 161 Computer Security

TERRA. Boneh. A virtual machine-based platform for trusted computing. Presented by: David Rager November 10, 2004

Cryptography and Network Security. Prof. D. Mukhopadhyay. Department of Computer Science and Engineering. Indian Institute of Technology, Kharagpur

Chapter 9: Key Management

Applied Cryptography Protocol Building Blocks

From bottom to top: Exploiting hardware side channels in web browsers

Data Security and Privacy. Topic 14: Authentication and Key Establishment

Cryptography (Overview)

Distributed Systems Exam 3 Review. Paul Krzyzanowski. Rutgers University. Fall 2016

Issues. Separation of. Distributed system security. Security services. Security policies. Security mechanism

Cryptographic Concepts

Flicker: An Execution Infrastructure for TCB Minimization

Password. authentication through passwords

Recovering cryptographic keys with the cold boot attack


Distributed Systems. 26. Cryptographic Systems: An Introduction. Paul Krzyzanowski. Rutgers University. Fall 2015

Location Privacy based on Trusted Computing and Secure Logging

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

Cryptographic Checksums

Efficient Memory Integrity Verification and Encryption for Secure Processors

CS /29/17. Paul Krzyzanowski 1. Fall 2016: Question 2. Distributed Systems. Fall 2016: Question 2 (cont.) Fall 2016: Question 3

Breaking Kernel Address Space Layout Randomization (KASLR) with Intel TSX. Yeongjin Jang, Sangho Lee, and Taesoo Kim Georgia Institute of Technology

Distributed OS Hermann Härtig Authenticated Booting, Remote Attestation, Sealed Memory aka Trusted Computing

Test 2 Review. 1. (10 points) Timestamps and nonces are both used in security protocols to prevent replay attacks.

Operating System Security

Software Solutions to Micro-architectural Side Channels. Yinqian Zhang Assistant Professor Computer Science & Engineering The Ohio State University

Lecture Secure, Trusted and Trustworthy Computing Trusted Platform Module

Garantía y Seguridad en Sistemas y Redes

Group Key Establishment Protocols

Leveraging Intel SGX to Create a Nondisclosure Cryptographic library

Sample excerpt. Virtual Private Networks. Contents

Introduction to Security and User Authentication

Kurose & Ross, Chapters (5 th ed.)

Scalable Architectural Support for Trusted Software

Lecture Embedded System Security Trusted Platform Module

Overview. SSL Cryptography Overview CHAPTER 1

Overview. Wait, which firmware? Threats Update methods request_firmware() hooking Regression testing Future work

Binding keys to programs using Intel SGX remote attestation

Lecture 9. Authentication & Key Distribution

Encryption Algorithms Authentication Protocols Message Integrity Protocols Key Distribution Firewalls

typedef void (*type_fp)(void); int a(char *s) { type_fp hf = (type_fp)(&happy_function); char buf[16]; strncpy(buf, s, 18); (*hf)(); return 0; }

Computer Security. 10. Exam 2 Review. Paul Krzyzanowski. Rutgers University. Spring 2017

Trusted Platform Modules Automotive applications and differentiation from HSM

Provisioning secure Identity for Microcontroller based IoT Devices

Transcription:

SGX Security Background Masab Ahmad masab.ahmad@uconn.edu Department of Electrical and Computer Engineering University of Connecticut 1

Security Background Outline Cryptographic Primitives Cryptographic Constructs Software Attestation Physical Attacks Privileged Software Attacks Software Attacks on Peripherals Address Translation Attacks Cache Timing Attacks 2

Security Background Outline Cryptographic Primitives Cryptographic Constructs Software Attestation Physical Attacks Privileged Software Attacks Software Attacks on Peripherals Address Translation Attacks Cache Timing Attacks 3

Cryptographic Primitives Cryptographic Keys Privacy No one should see/infer my data Encryption Integrity No one should tamper with my data MAC/Signatures Freshness I should get the same data as I viewed earlier Integrity Checking 4

Cryptographic Keys Generate keys to verify communication between two parties Maintain secret 5 Intel SGX Explained. Victor Costan and Srinivas Devadas, MIT 2016

Cryptographic Keys https://www.cybrary.it/ 0p3n/symmetricencryption/ 6

Privacy Message authentication signatures Used to verify that data came from the correct party MAC : Message authentication code Data encrypted to ensure attackers cannot view it 7

Privacy https://www.cybrary.it/ 0p3n/macs/

Data Integrity Use hashing mechanisms to verify data integrity Keep a hash in a trusted zone Compute hashes and then compare for security purposes 9

Hash Tree Root hash kept in trusted zone Tree leaves Data http://bitcoin.stackexchange.com/questions/10479/what-is-the-merkle-root 10

Data Freshness Cryptographically secure pseudo-random number generator (CSPRNG) Verify Sender Data access Timestamps Verify Timestamps Nonce compared with timestamps to verify freshness A Nonce is an arbitrary number that is used once 11

Security Background Outline Cryptographic Primitives Cryptographic Constructs Software Attestation Physical Attacks Privileged Software Attacks Software Attacks on Peripherals Address Translation Attacks Cache Timing Attacks 12

Cryptographic Constructs Certificate Authorities Key Agreement Protocols https://technet.microsoft.com/en-us/library/cc962035.aspx 13

Certificate Authorities (CA) A digital certificate certifies the ownership of a public key by the named subject of the certificate The CA is a trusted third party Certificate Parameters allow verification and security Uses Symmetric Keys (AES) for Verification 14

Key Agreement Protocols Diffie Hellman Key Exchange Alice and Bob want to agree on keys to verify their communication Users communicate and create keys dynamically Computationally hard for an eavesdropper to infer keys 15

Security Background Outline Cryptographic Primitives Cryptographic Constructs Software Attestation Physical Attacks Privileged Software Attacks Software Attacks on Peripherals Address Translation Attacks Cache Timing Attacks 16

Software Attestation Overview Authenticated Key Agreements Software Management 17 http://4.bp.blogspot.com/- mmuu09gj0cm/uy0xpyg9lxi/aaaaaaaaabe/p_8kwu egsrg/s1600/qatar+attestation.jpg

Authenticated Key Agreements and Software Management Attestation Keys Given by a hardware manufacturer 1 Chain of Trust Built by sharing and verifying certificates 2 Certificates signed to verify their origin Software verified using these keys. E.g. Apple is a verifier of software 4 Secure Container verifies 3 Data Transfer Verifies the attestation chain internally 18

Security Background Outline Cryptographic Primitives Cryptographic Constructs Software Attestation Physical Attacks Privileged Software Attacks Software Attacks on Peripherals Address Translation Attacks Cache Timing Attacks 19

Physical Attacks Port Attacks A reboot of the system via a port causes vulnerabilities of a system to surface Bus Tapping Attacks Monitoring Attacks, Active Attacks, Replay Attacks Chip Attacks Physically look/attack into the chip 20 http://www.martybucella.com/

Port Attacks Attacker scans/sends communication ports after a system restart/bootup Leaves BIOS insecure and leaves firewalls open Private data can be readily available in such contexts New processors filter data from the bus before committing anything to the state of the system 21

Bus Tapping Attacks An attacker taps a bus and snoops in on information Can potentially insert information as well, causing un-required behavior Intel Corporation. Intel R 64 and IA-32 Architectures Software Developer s Manual. Number 253669-033US. December 2009. Attacks on the DRAM address sequences currently unsuccessful 22

Chip Attacks Reduce temperature of the chip Causes chips to go in hibernation mode with vulnerabilities Security modules turned off Chip access compromised Potential DRAM writes possible Other possible attacks include tampering with hardware fuses and wires J. A. Halderman, S. D. Schoen, N. Heninger, W. Clarkson, W. Paul, J. A. Calandrino, A. J. Feldman, J. Appelbaum, and E. W. Felten, Lest we remember: Cold boot attacks on encryption keys, in Proceedings of the 17th USENIX Security Symposium, San Jose, CA, 2008, pp. 45 60. 23

Security Background Outline Cryptographic Primitives Cryptographic Constructs Software Attestation Physical Attacks Privileged Software Attacks Software Attacks on Peripherals Address Translation Attacks Cache Timing Attacks 24

Generations of Processor Security by Intel Intel Trusted Platform Module (TPM) 2009 - Enabled basic security paradigms Password Security, Disk Encryption, and Integrity Checking Intel Trusted Execution Technology (TXT) 2011 - Platform attestation and its operating system Chain of trust Intel Software Guard Extensions (SGX) 2016 - Firmware Trusted More to come in subsequent slides 25

Privileged Software Attacks System Management Interrupts (SMIs) and Modules (SMMs) Handled by a SM module that has high privileges Handles keyboard presses and mouse taps Exploited Multiple times Compromised Intel TXT Heavily emphasized in Intel SGX Hypervisor control needed Isolation OS also isolated from lower levels 26

Security Background Outline Cryptographic Primitives Cryptographic Constructs Software Attestation Physical Attacks Privileged Software Attacks Software Attacks on Peripherals Address Translation Attacks Cache Timing Attacks 27

PCI Express Attacks Software Attacks on Peripherals DRAM Attacks The Performance Monitoring Side Channels Attacks on Boot Firmware and Intel ME Accounting for Software Attacks on Peripherals 28

PCI Express Attacks PCI bus allows a device to do a direct memory access (DMA) to/from the DRAM Attacker changes critical data GPUs exposed this way Intel TXT additionally compromised this way Single Computing Node New added checks in the DMA arbiter Multi-Node Supercomputer connected over PCI buses 29 http://www.ibm.com/smarterplanet/us/en/ibmwatson/

DRAM Attacks Huge Class of attacks RowHammer Attack Bit flips on DRAM refresh OR current leaks in memory can allow privileged access Attacker then reads page table bits if leaked Modification of page tables possible Bits leaked to adjacent cells Isolation of page tables required in hardware Hash checks 30

The Performance Monitoring Side Channels An attacker can gain access to performance counters Read Model specific registers (MSRs) Power analysis attacks Other Side channel attacks Isolation of performance counters required The victim thread must not be able to access the counters 31 F. Liu, Y. Yarom, Q. Ge, G. Heiser, and R. B. Lee. Last- Level Cache Side-Channel Attacks are Practical. In Proceedings of the 36th IEEE Symposium on Security and Privacy (S&P 15), 2015.

Attacks on Boot Firmware and Intel ME An attacker can use the highly privileged system management mode (SMM) to read/write device firmware Such a mode can read/write anywhere and can access any peripheral for debugging purposes Intel management engine (ME) reads contents from the same flash as the above firmware, and has high privileges Security measures removed to ensure speedy machine start ups Isolation of firmware required 32

33

Accounting for Software Attacks on Peripherals Using the ME and SMMs, an attacker can attack device peripherals E.g. attack a wifi modem and transmit malicious stuff as a bot However Intel s ME and SMM features are largely undocumented 34

Security Background Outline Cryptographic Primitives Cryptographic Constructs Software Attestation Physical Attacks Privileged Software Attacks Software Attacks on Peripherals Address Translation Attacks Cache Timing Attacks 35

Address Translation Attacks Passive Attacks Straightforward Active Attacks Active Attacks using Page Swapping Active Attacks based on TLBs 36

Passive Attacks Address translation used for page swapping An untrusted page table manager can swap pages using page faults and leak information Successful practical attacks on SGX! Image inferred even though it was isolated by SGX Intel s response (by Matt Hoekstra and Frank McKeen) puts blame on software developers https://software.intel.com/enus/blogs/2015/05/19/look-both-ways-andwatch-out-for-side-channels 37

Straightforward Active Attacks An attacker modifies page tables physically or via a vulnerability in a memory manager An isolated application then makes a secure access to memory, only to jump and execute to a wrong and malicious location 38

Straightforward Active Attacks Page Tables Swapped! 39

Active Attacks based on TLBs Use a similar attack methodology for a TLB (Translation Look-aside Buffer) Maps virtual to physical address and vice versa Assumes that the TLB is not subject to security checks 40

Security Background Outline Cryptographic Primitives Cryptographic Constructs Software Attestation Physical Attacks Privileged Software Attacks Software Attacks on Peripherals Address Translation Attacks Cache Timing Attacks 41

Practical Considerations Cache Timing Attacks Theory Known Cache Timing Attacks Defending against Cache Timing Attacks 42 http://www.intel.com/

Practical Considerations The attacker needs access to performance counters or some instructions to gain timing knowledge Shared cache required Out-of-Order cores can cause noisy channels Memory prefetching causes further noise or an even easier channel 43

Theory 1 1. Attacker accesses memory such that it fills all the ways with the victims interesting memory locations 2. Then the victim accesses cache locations 3. Some location are evicted from the shared cache in this process 4. Remaining cache lines are important! E. Tromer, D. A. Osvik, and A. Shamir, Efficient cache attacks in AES, and countermeasures, J. Cryptology, no. 2, pp. 37 71, Jan 2010. Attack on AES : AES key leaked via bit leakage 44

Theory 2 1.The Attacker accesses memory such that it fills all the ways with the victims interesting memory locations 2. Then the victim accesses cache locations 3. Some locations miss the cache to go off-chip, the attacker times the accesses to determine this 4. The Attacker knows which cache lines came from the DRAM F. Liu, Y. Yarom, Q. Ge, G. Heiser, and R. B. Lee. Last-Level Cache Side-Channel Attacks are Practical. In Proceedings of the 36th IEEE Symposium on Security and Privacy (S&P 15), 2015. 45

Defending against Cache Timing Attacks Isolation Static cache partitioning Page separation Isolation page tables Use integrity + freshness checks on every access The use of Oblivious algorithms Add noise to data accesses by adding dummy accesses The attacker cannot distinguish between private and dummy accesses anymore More in store by Chenglu 46