Trusted Computing Architecture Using presentation material from Dan

  • Slides: 66
Download presentation
Trusted Computing Architecture Using presentation material from Dan Boneh, Stanford and Eran Tromer 1

Trusted Computing Architecture Using presentation material from Dan Boneh, Stanford and Eran Tromer 1

Isolation: summary • Many sandboxing techniques: Physical air gap, Virtual air gap (VMMs), System

Isolation: summary • Many sandboxing techniques: Physical air gap, Virtual air gap (VMMs), System call interposition, Software Fault isolation Application specific (e. g. Javascript in browser) • Often complete isolation is inappropriate – Apps need to communicate through regulated interfaces • Hard aspects of sandboxing: – Specifying policy: what can apps do and not do – Preventing covert channels 2

Isolation from OS/VMM harder • Blue pill: originating from BIOS – Below OS/Hypervisor •

Isolation from OS/VMM harder • Blue pill: originating from BIOS – Below OS/Hypervisor • Hard to protect if compromise from below – e. g. , if we use permissions or SFI, the OS can simply change them – Need to root isolation outside the OS • But, need to be able to let the OS do its job • Conflation of resource management and security role of the OS 3

Background TCG consortium. Founded in 1999 as TCPA. Main players (promoters): (>200 members) AMD,

Background TCG consortium. Founded in 1999 as TCPA. Main players (promoters): (>200 members) AMD, HP, IBM, Infineon, Intel, Lenovo, Microsoft, Sun Goals: n Hardware protected (encrypted) storage: w Only “authorized” software can decrypt data w e. g. : protecting key for decrypting file system n n n 4 Secure boot: method to “authorize” software Attestation: Prove to remote server what software is running on my machine.

Secure boot History of BIOS/EFI malware: n n n CIH (1998): CIH virus corrupts

Secure boot History of BIOS/EFI malware: n n n CIH (1998): CIH virus corrupts system BIOS Heasman (2007): w System Management Mode (SMM) “rootkit” via EFI Sacco, Ortega (2009): infect BIOS LZH decompressor w Core. BOOT: generic BIOS flashing tool Main point: BIOS runs before any defenses (e. g. antivirus) Proposed defense: lock system configuration (BIOS + OS) Today: TCG approach 5

TCG: changes to PC Extra hardware: TPM n Trusted Platform Module (TPM) chip w

TCG: changes to PC Extra hardware: TPM n Trusted Platform Module (TPM) chip w Single 33 Mh. Z clock. w Vendors: Atmel, Infineon, National, STMicro, … w Cost: <$0. 3 n Integrated into other chips w Ethernet controller (Broadcom) w CPU’s chipset (Intel) Software changes: n BIOS, EFI (UEFI) n OS and Apps 6

TPMs in the real world TPMs widely available on laptops, desktops and some servers

TPMs in the real world TPMs widely available on laptops, desktops and some servers Software using TPMs: 7 n File/disk encryption: Bit. Locker, IBM, HP, Softex n Attestation for enterprise login: Cognizance, Wave n Client-side single sign on: IBM, Utimaco, Wave

TPM Basics n What the TPM does n How to use it 8

TPM Basics n What the TPM does n How to use it 8

Components on TPM chip Non Volatile Storage LPC bus (> 1280 bytes) PCR Registers

Components on TPM chip Non Volatile Storage LPC bus (> 1280 bytes) PCR Registers ( 16 registers) I/O API calls Crypto Engine: RSA, SHA-1, HMAC, RNG RSA: 1024, 2048 bit modulus SHA-1: Outputs 20 byte digest 9 Other Junk

Non-volatile storage 1. Endorsement Key (EK) (2048 -bit RSA) n Created at manufacturing time.

Non-volatile storage 1. Endorsement Key (EK) (2048 -bit RSA) n Created at manufacturing time. Cannot be changed. n Used for “attestation” (described later) 2. Storage Root Key (SRK) (2048 -bit RSA) n Used for implementing encrypted storage n Created after running TPM_Take. Ownership( Owner. Password, … ) n Can be cleared later with TPM_Force. Clear from BIOS 3. Owner. Password (160 bits) and persistent flags Private EK, SRK, and Owner. Pwd never leave the TPM 10

PCR: the heart of the matter PCR: Platform Configuration Registers n n Lots of

PCR: the heart of the matter PCR: Platform Configuration Registers n n Lots of PCR registers on chip (at least 16) Register contents: 20 -byte SHA-1 digest (+junk) Updating PCR #n : n TPM_Extend(n, D): n TPM_Pcr. Read(n): returns value(PCR(n)) PCR[n] SHA-1 ( PCR[n] || D ) PCRs initialized to default value (e. g. 0) at boot time n 11 TPM can be told to restore PCR values in NVRAM via TPM_Save. State and TPM_Startup(ST_STATE) for system suspend/resume

Using PCRs: the TCG boot process BIOS boot block executes n Calls TPM_Startup (ST_CLEAR)

Using PCRs: the TCG boot process BIOS boot block executes n Calls TPM_Startup (ST_CLEAR) to initialize PCRs to 0 n Calls PCR_Extend( n, <BIOS code> ) n Then loads and runs BIOS post boot code BIOS executes: n Calls PCR_Extend( n, <MBR code> ) n Then runs MBR (master boot record), e. g. GRUB. MBR executes: n Calls PCR_Extend( n, <OS loader code, config> ) n Then runs OS loader … and so on 12

In a diagram Hardware BIOS boot block BIOS MBR Root of trust in integrity

In a diagram Hardware BIOS boot block BIOS MBR Root of trust in integrity measurement TPM OS loader OS Application measuring Extend PCR Root of trust in integrity reporting • After boot, PCRs contain hash chain of booted software • Collision resistance of SHA-1 ensures commitment 13

Example: Trusted GRUB (IBM’ 05) What PCR # to use and what to measure

Example: Trusted GRUB (IBM’ 05) What PCR # to use and what to measure specified in GRUB config file 14

Using PCR values after boot Application 1: encrypted (a. k. a sealed) storage. Step

Using PCR values after boot Application 1: encrypted (a. k. a sealed) storage. Step 1: TPM_Take. Ownership( Owner. Password, … ) n Creates 2048 -bit RSA Storage Root Key (SRK) on TPM n Cannot run TPM_Take. Ownership again without Owner. Pwd: w Ownership Enabled Flag False n Done once by IT department or laptop owner. (optional) Step 2: TPM_Create. Wrap. Key / TPM_Load. Key n Create more RSA keys on TPM protected by SRK n Each key identified by 32 -bit keyhandle 15

Protected Storage Main Step: Encrypt data using RSA key on TPM_Seal (some) Arguments: w

Protected Storage Main Step: Encrypt data using RSA key on TPM_Seal (some) Arguments: w keyhandle: which TPM key to encrypt with w Key. Auth: Password for using key `keyhandle’ w Pcr. Values: PCRs to embed in encrypted blob w data block: at most 256 bytes (2048 bits) n n 16 Used to encrypt symmetric key (e. g. AES) Returns encrypted blob. Main point: blob can only be decrypted with TPM_Unseal when PCR-reg-vals = PCR-vals in blob. n TPM_Unseal will fail othrewise

Protected Storage Embedding PCR values in blob ensures that only certain apps on certain

Protected Storage Embedding PCR values in blob ensures that only certain apps on certain platform configuration can decrypt data. n e. g. : Messing with MBR or OS kernel will change PCR values. 17

Sealed storage: applications Lock software on machine: n OS and apps sealed with MBR’s

Sealed storage: applications Lock software on machine: n OS and apps sealed with MBR’s PCR. n Any changes to MBR (to load other OS) will prevent locked software from loading. n Prevents tampering and reverse engineering Web server: seal server’s SSL private key n Goal: only unmodified Apache can access SSL key n Problem: updates to Apache or Apache config General problem with software upgrades/patches: Upgrade process must re-seal all blobs with new PCRs 18

Security? 19 Resetting TPM after boot n Attacker can disable TPM until after boot,

Security? 19 Resetting TPM after boot n Attacker can disable TPM until after boot, then extend PCRs arbitrarily (one-byte change to boot block) [Kauer 07] n Software attack: send TPM_Init on LPC bus allows calling TPM_Startup again (to reset PCRs) n Simple hardware attack: use a wire to connect TPM reset pin to ground n Once PCRs are reset, they can be extended to reflect a fake configuration. Rollback attack on encrypted blobs n e. g. undo security patches without being noticed. n Can be mitigated using Data Integrity Regs (DIR) w Need Owner. Password to write DIR

Attestation Goal: prove to remote party what software is running on my machine. Good

Attestation Goal: prove to remote party what software is running on my machine. Good applications: n Bank allows money transfer only if customer’s machine runs “up-to-date” OS patches. n Enterprise allows laptop to connect to its network only if laptop runs “authorized” software n Quake players can join a Quake network only if their Quake client is unmodified. DRM: n Music. Store sells content for authorized players only. 20

Attestation: how it works Recall: EK private key on TPM. n Cert for EK

Attestation: how it works Recall: EK private key on TPM. n Cert for EK public-key issued by TPM vendor. Step 1: Create Attestation Identity Key (AIK) n Involves interaction with a trusted remote issuer to verify EK n Generated: AIK private+public keys, and a certificate signed by issuer 21

Attestation: how it works Step 2: n sign PCR values Call TPM_Quote (after boot)

Attestation: how it works Step 2: n sign PCR values Call TPM_Quote (after boot) (some) Arguments: w keyhandle: which AIK key to sign with w Key. Auth: Password for using key `keyhandle’ w PCR List: Which PCRs to sign. w Challenge: 20 -byte challenge from remote server n Prevents replay of old signatures. w Userdata: additional data to include in sig. n 22 Returns signed data and signature.

Using attestation (to establish an SSL tunnel) Attestation Request (20 -byte challenge) App •

Using attestation (to establish an SSL tunnel) Attestation Request (20 -byte challenge) App • Generate pub/priv key pair • TPM_Quote(AIK, Pcr. List, chal, pub-key) • Send pub-key and certs (SSL) Key Exchange using Cert OS Communicate with app using SSL tunnel Validate: 1. Certs 2. PCR vals 3. Challenge TPM PC • Attestation must include key-exchange • App must be isolated from rest of system 23 Remote Server

Better root of trust: “late launch” Late launch: securely load OS/VMM, even on a

Better root of trust: “late launch” Late launch: securely load OS/VMM, even on a potentially-compromised machine DRTM – Dynamic Root of Trust Measurement New CPU instruction: Intel TXT: SENTER AMD: SKINIT Atomically does: n Reset CPU. Reset PCR 17 to 0. n Load given Secure Loader (SL) code into I-cache n Extend PCR 17 with SL n Jump to SL BIOS boot loader is no longer root of trust Avoids TPM_Init attack: TPM_Init sets PCR 17 to -1 24

Trusting the CPU? Trust the vendor? System Management Mode (SMM) n Special execution mode

Trusting the CPU? Trust the vendor? System Management Mode (SMM) n Special execution mode with protected memory, “below” OS and hypervisor n Survives TXT launch, so compromised BIOS could load a malicious SMM that circumvents TXT. Intel Management Engine (ME) n n 25 A microcontroller embedded in the processor, “next to” the OS and hypervisor Independent of OS security policy. Applications: originally, remote administration. Nowadays: EPID (chip -specific keys), Boot Guard (checks signature on boot code), Protected Audio and Video Path, SGX (secure enclaves) Trustworthy? w ME includes its own, potentially vulnerable, custom OS and apps. w No public documentation of implementation and logic. w Could be used as an ideal rootkit / trojan horse.

Security? 26 Resetting TPM after boot n Attacker can disable TPM until after boot,

Security? 26 Resetting TPM after boot n Attacker can disable TPM until after boot, then extend PCRs arbitrarily (one-byte change to boot block) [Kauer 07] n Software attack: send TPM_Init on LPC bus allows calling TPM_Startup again (to reset PCRs) n Simple hardware attack: use a wire to connect TPM reset pin to ground n Once PCRs are reset, they can be extended to reflect a fake configuration. Rollback attack on encrypted blobs n undo security patches Large trusted base n Long, complex and potentially vulnerable chain of trust: OEM’s drivers, vendor’s peripherals, OS’s vendors.

Protecting code on an untrusted platform Can we run sensitive code on a potentially-compromised

Protecting code on an untrusted platform Can we run sensitive code on a potentially-compromised platform, without rebooting/replacing it? n Many ways to read and corrupt code! Secure “enclave” using CPU hardware n Possible with SENTER/SKINIT but cumbersome (Flicker project) n Intel Software Guard Extensions (SGX) (discussed later) ARM Trust. Zone Cryptography n Fully-homomorphic encryption n Succinct zero-knowledge proofs (SNARKs) and Proof. Carrying Data n 27

SGX Using presentation material from Intel. 28

SGX Using presentation material from Intel. 28

Some slides are courtesy of intel© 29

Some slides are courtesy of intel© 29

Why SGX? Software security on commercial CPUs is pursued for many years • SW

Why SGX? Software security on commercial CPUs is pursued for many years • SW solutions have limited potential. • Closed HW systems have limited functionality. • Traditional TPMs have large TCB – commonly measure all platform. TXT overcame some of these by introducing a Dynamic Root of Trust: ü Dedicated TCB “mini OS”. ü Run only sensitive logic in trusted OS. ü Thus, needs to measure only mini OS and sensitive logic app. But TXT still: • Halts main OS, restarts mini-OS and clears CPU. • Doesn’t support continuous run of trusted and untrusted apps. • Cumbersome to develop for. • Large TCB - lots of potentially vulnerable SW. Numerous vulnerabilities - Most Hazardous: Compromised BIOS can load a malicious SMM that survives TXT launch. 30

Why SGX? SGX introduces the ENCALVE: • A protected TEE (Trusted Execution Environment) container.

Why SGX? SGX introduces the ENCALVE: • A protected TEE (Trusted Execution Environment) container. • Shrinks TCB (Trusted Computing Base) to HW and sensitive app logic. • Extends HW TCB on to enclaves in ring-3. • Runs TEE under untrusted OS or VMM. • Supports continuous run of: o Trusted and untrusted apps. o Multiple enclaves. o Multi-threaded enclave. While maintaining application Integrity and confidentiality. 31

How? • Dedicated HW • 18 new ISA instructions • Internal FW data structures

How? • Dedicated HW • 18 new ISA instructions • Internal FW data structures • Tailored cryptographic functions • Suitable protocols 32

The Enclave – A trusted execution environment embedded in a process • Is part

The Enclave – A trusted execution environment embedded in a process • Is part of the application & has full access to its memory. • Measured and verified by HW on load. • Operation visible only within CPU borders. • Manageable by the OS, e. g: - CPU time slots Paging and memory policy • Secrets are provisioned or acquired only after enclave initialization. 33

Security Perimeter MEE • Security perimeter is the CPU package boundary. • Data and

Security Perimeter MEE • Security perimeter is the CPU package boundary. • Data and code unencrypted inside CPU package. • Data and code outside CPU is encrypted and integrity checked. • Single chip TCB avoids inter-chip HW attacks that threaten TPMs. • If the single TCB is the CPU, then we gain the opportunity for richer semantics by understanding platform state & app code. * MME – Memory Management Engine, elaborated shortly. 34

Execution Flow 1. Enclavize sensitive App parts defines a partition to trusted and untrusted.

Execution Flow 1. Enclavize sensitive App parts defines a partition to trusted and untrusted. 2. App runs & creates enclave in trusted memory. 3. Trusted function transitions flow to the enclave. 4. Enclave sees all process data, but external access to enclave is denied. 5. Trusted function returns. 6. App continues normal execution. 35

Motivation – Some Usage Examples: • Cloud - Assure customers about the security standard

Motivation – Some Usage Examples: • Cloud - Assure customers about the security standard of the “cloud enclave”. Confidential, also from vendors with physical access. • HSM - Implement HSM’s functionality and security such that existing software that supports HSMs can be adapted to using SGX instead. • DRM – On-line content provider that provides content only to authorized players hosting a trusted player enclave. • TOR - A node that could prove to users that it is not backdoored by its own admin and does not keep a log of how connections were routed. 36

Enclave Life Cycle Virtual Address Space Physical Address Space 37

Enclave Life Cycle Virtual Address Space Physical Address Space 37

Enclave Life Cycle Virtual Address Space Physical Address Space BIOS setup System Memory E

Enclave Life Cycle Virtual Address Space Physical Address Space BIOS setup System Memory E nclave P age C ache EPC M Invalid Invalid BIOS reserves memory address range for SGX use. 38

Enclave Life Cycle Virtual Address Space Physical Address Space Enclave creation Plaintext Code/Data System

Enclave Life Cycle Virtual Address Space Physical Address Space Enclave creation Plaintext Code/Data System Memory Code/Data Enclave ECREATE (Range) MSe. Et a. C d. S a t a E nclave P age C ache EPC SECS, Range Invalid MValid, Invalid ECREATE - Stores enclave attributes (mode of operation, debug, etc. ) in metadata. 39

Enclave Life Cycle Virtual Address Space Physical Address Space Enclave creation Plaintext Code/Data System

Enclave Life Cycle Virtual Address Space Physical Address Space Enclave creation Plaintext Code/Data System Memory Code/Data Enclave E CREATE ( Range ) EADD (Copy Page ) MSe. Et a. C d. S a t a Plaintext Coe/Data Copy page EPC Valid, SECS, Range Invalid M Invalid Valid, REG, LA, SECS Invalid EADD – Commits new pages to enclave & updates security metadata. 40

Enclave Life Cycle Virtual Address Space Physical Address Space Enclave creation Plaintext Code/Data System

Enclave Life Cycle Virtual Address Space Physical Address Space Enclave creation Plaintext Code/Data System Memory Code/Data Enclave E CREATE ( Range ) EADD (Copy Page ) MSe. Et a. C d. S a t a Plaintext Coe/Data EPC Valid, SECS, Range Invalid M Invalid Valid, REG, LA, SECS Invalid EADD – Commits code, data or SGX control structure page types. 41

Enclave Life Cycle Physical Address Space Virtual Address Space Enclave creation Plaintext Code/Data System

Enclave Life Cycle Physical Address Space Virtual Address Space Enclave creation Plaintext Code/Data System Memory Code/Data Enclave Update PTE MSe. Et a. C d. S a t a E CREATE ( Range ) EADD (Copy Page ) Plaintext Coe/Data EPC Valid, SECS, Range Invalid M Invalid Valid, REG, LA, SECS Invalid 42

Enclave Life Cycle Physical Address Space Virtual Address Space Enclave creation Plaintext Code/Data System

Enclave Life Cycle Physical Address Space Virtual Address Space Enclave creation Plaintext Code/Data System Memory Code/Data Enclave Code/Data Update PTE Metadata E CREATE ( Range ) EADD (Copy Page ) Plaintext Code/Data EPC SECS, Range Invalid MValid, Invalid Valid, REG, LA, S E C S Invalid 43

Enclave Life Cycle Physical Address Space Virtual Address Space Enclave creation Plaintext Code/Data System

Enclave Life Cycle Physical Address Space Virtual Address Space Enclave creation Plaintext Code/Data System Memory Code/Data Enclave Code/Data Update PTE Metadata E CREATE ( Range ) EADD (Copy Page ) EEXTEND Plaintext Code/Data EPC SECS, Range Invalid MValid, Invalid Valid, REG, LA, S E C S Invalid EEXTEND - Measures the enclave with SHA 256. (detailed shortly) 44

Enclave Life Cycle Virtual Address Space Physical Address Space Enclave initialization System Memory Code/Data

Enclave Life Cycle Virtual Address Space Physical Address Space Enclave initialization System Memory Code/Data Enclave Code/Data S ata MSe. Et Ca d E CREATE ( Range ) EADD (Copy Page ) EEXTEND EINIT Plaintext Code/Data EPC SECS, Range Invalid MValid, Invalid Valid, REG, LA, S E C S Invalid EINIT - Finalizes measurements, validates them & enables enclave’s entry use. 45

Enclave Life Cycle Virtual Address Space Physical Address Space Enclave active System Memory Code/Data

Enclave Life Cycle Virtual Address Space Physical Address Space Enclave active System Memory Code/Data Enclave Code/Data S ata MSe. Et Ca d E CREATE ( Range ) EADD (Copy Page ) EEXTEND EINIT EENTER Plaintext Code/Data EPC SECS, Range Invalid MValid, Invalid Valid, REG, LA, S E C S Invalid EENTER - Verifies enclave entry & sets CPU operation mode to “enclave mode”. 46

Enclave Life Cycle Virtual Address Space Physical Address Space Enclave active System Memory Code/Data

Enclave Life Cycle Virtual Address Space Physical Address Space Enclave active System Memory Code/Data Enclave Code/Data S ata MSe. Et Ca d E CREATE ( Range ) EADD (Copy Page ) EEXTEND EINIT EENTER Plaintext Code/Data EPC SECS, Range Invalid MValid, Invalid Valid, REG, LA, S E C S Invalid Enclave flow is executed using the secured address range, obscured from all other SW. 47

Enclave Life Cycle Virtual Address Space Physical Address Space Enclave active System Memory Code/Data

Enclave Life Cycle Virtual Address Space Physical Address Space Enclave active System Memory Code/Data Enclave Code/Data S ata MSe. Et Ca d E CREATE ( Range ) EADD (Copy Page ) EEXTEND EINIT EENTER EEXIT Plaintext Code/Data EPC SECS, Range Invalid MValid, Invalid Valid, REG, LA, S E C S Invalid EEXIT – Clears CPU cache & Jumps out of enclave back to OS instruction address. 48

Enclave Life Cycle Virtual Address Space Physical Address Space Enclave destruction System Memory Enclave

Enclave Life Cycle Virtual Address Space Physical Address Space Enclave destruction System Memory Enclave SECS E CREATE ( Range ) EADD (Copy Page ) EEXTEND EINIT EENTER EEXIT EREMOVE E nclave P age C ache EPC Invalid M Invalid EREMOVE – Clears enclave’s trusted virtual address range reserved by ECREATE. 49

Enclave Life Cycle Virtual Address Space Physical Address Space BIOS setup System Memory E

Enclave Life Cycle Virtual Address Space Physical Address Space BIOS setup System Memory E nclave P age C ache EPC M Invalid Invalid 50

Enclave Measurement When building an enclave, Intel® SGX generates a cryptographic log of all

Enclave Measurement When building an enclave, Intel® SGX generates a cryptographic log of all the build activities • • Content: Code, Data, Stack, Heap Location of each page within the enclave Security flags being used Order in which it was built MRENCLAVE (“Enclave Identity”) is a 256 -bit digest of the log • Represents the enclave’s software TCB Data Chunk 1 Meta. Data SHA-256 MRENCLAVE Data Chunk 2 Meta. Data SHA-256 MRENCLAVE 1 Data Chunk n Meta. Data SHA-256 MRENCLAVE 2 MRENCLAVE n 55

Memory Encryption Engine (MEE) • Resides within the CPU as a Memory Controller extension.

Memory Encryption Engine (MEE) • Resides within the CPU as a Memory Controller extension. • Encrypts, decrypts page swaps and integrity checks them thus, providing data confidentiality and integrity. • TRNG generates at boot time separate keys for encryption and integrity. • Keys are held in MEE registers, accessible only to HW. • Does not hide the fact that data is written to the DRAM , when it is written, and to which physical address. • Defends system memory from cold boot attacks. • Uses version and counter controls to prevent page replay attack. Problem – A lot of metadata stored in CPU… 57

SGX Anti replay attack under HW limitations Uses version and counter controls to prevent

SGX Anti replay attack under HW limitations Uses version and counter controls to prevent page replay attack. • Keeping this metadata for every evicted page is not scalable in SRAM terms. • How can we “compress” this? • Can be implemented as a merkle-tree. 58

Halfway recap • • • Enclave properties as a TEE SGX Security Perimeter lifecycle

Halfway recap • • • Enclave properties as a TEE SGX Security Perimeter lifecycle and execution flow Enclave Measurement Memory Encryption Engine • Sealing • Attestation • Provisioning • Overview summery • SGX usages • Q&A and open discussion 59

Sealing • Definition: Cryptographically protecting data when it is stored outside enclave. • Sealing

Sealing • Definition: Cryptographically protecting data when it is stored outside enclave. • Sealing enables enclave to pass data between consecutive runs. • Future enclave instantiation can acquire former provisioned sensitive data. (Enclave shouldn’t ship with sensitive data, but be provisioned with it after instantiation. ) • Newer SVN (security version number) enclave can read older SVN data using a Key Recovery Transformation. 60

Sealing Actors Sealing Authority – Developer SIGSTRUCT - Enclave certificate. Enclave ISV that Signs

Sealing Actors Sealing Authority – Developer SIGSTRUCT - Enclave certificate. Enclave ISV that Signs the enclave certificate with its RSA-3072 Private key. • Sealing Authority Public key (Used by HW to verify Certificate). • Enclave identity aka MRENCLAVE (Used by HW to verify enclave Integrity). • ISV SVN • Other enclave attributes. Sealing Authority signature MRSIGNER - Sealing Identity. • Created on enclave initialization. • Accessible only by the TCB. • Used to seal enclave data. Includes: • sealing authority Public Key hash. • Product ID. • SVN – Security Version Number. 61

EGETKEY Instruction Key name, Policy, Enclave SVN • Called by an enclave to retrieve

EGETKEY Instruction Key name, Policy, Enclave SVN • Called by an enclave to retrieve desired key. • Key derivation : Intel SGX SVNs Device Key EGETKEY Instruction Owner Epoch Key Derivation Seal Key, Report Key, etc. • Derived key is enclave and platform specific. 62

Sealing Process Key name, Policy, Enclave SVN 1. Enclave calls EGETKEY: Policy options are

Sealing Process Key name, Policy, Enclave SVN 1. Enclave calls EGETKEY: Policy options are Enclave or Sealing Identity. 2. Sets sealing key SVN with key recovery transformation. EGETKEY Instruction Enclave and platform specific key 3. Seals data with yielded key and ISV chosen encryption scheme. 4. Writes sealed data to untrusted storage. Data sealed under: 1. Processor key 2. CPU FW SVN 3. Owner. Epoch 4. Policy choice 63

Attestation SGX support local and remote HW based attestation capabilities. • Local Attestation Allows

Attestation SGX support local and remote HW based attestation capabilities. • Local Attestation Allows one enclave to attest its TCB to another enclave on the same platform. • Remote Attestation Allows an enclave to attest its TCB to another 3 -rd party entity outside of the platform. 64

Local Attestation Security instructions involved: Verifier MRENCLAVE, … EREPORT Instruction REPORT (Attestation assertion structure)

Local Attestation Security instructions involved: Verifier MRENCLAVE, … EREPORT Instruction REPORT (Attestation assertion structure) • • “Report” MRENCLAVE, Key name, … EGETKEY Instruction Enclave and platform specific key Claimer MRENCLAVE Claimer MRSIGNER Various addresser attributes Developer additional information kg CMAC tag using verifier key (To be Verified by "neighbored" enclave) 65

Local Attestation Protocol flow: Challenge (B’s MRENCALVE) Response (REPORT) Claimer Invokes EREPORT 1. Invokes

Local Attestation Protocol flow: Challenge (B’s MRENCALVE) Response (REPORT) Claimer Invokes EREPORT 1. Invokes EGETKEY 2. Verifies the REPORT : • HW (REPORT key) • SW (response details) * Optional REPORT* Verifier 1. Invokes EGETKEY 2. Verifies the REPORT: • HW (REPORT key) • SW (response details) 3. Invokes EREPORT 66

Remote Attestation • SGX uses a Quoting Enclave (QE) to convert LOCAL attestations to

Remote Attestation • SGX uses a Quoting Enclave (QE) to convert LOCAL attestations to REMOTELY verifiable assertion. • QE locally verifies REPORT produced by Application Enclave and signs it as a QUOTE. • QE uses an asymmetric attestation key that reflects the platforms trustworthiness. • App sends Quote to the Relying Party to verify. Platform Local attestation Remote attestation 67

Remote Attestation Protocol flow: Challenge QOUTE Verifier Claimer Secrets REPORT 8 REPORT QOUTE 1.

Remote Attestation Protocol flow: Challenge QOUTE Verifier Claimer Secrets REPORT 8 REPORT QOUTE 1. Verify report 2. Create Quote Service / Server run by intel Verify Quote 68

Provisioning the Attestation Key • To save expensive secure fuse space, a unique private

Provisioning the Attestation Key • To save expensive secure fuse space, a unique private key is generated on manufacturing and an unusable shorten form of it is fused on HW. • Group public key and other predefined parameters are sent to the device for it to extract and safely store the functional private key in a secure NVM. • Integrity is checked using hardcoded Intel EPID Authority public key. 69

Summary • Enclave runs in ring-3 privilege level deriving trust directly from hardware. •

Summary • Enclave runs in ring-3 privilege level deriving trust directly from hardware. • Developers may focus on securing a smaller TCB. • Application can support multiple enclaves. • Resources are run & managed by OS, yet protected in face of a compromised OS/VMM. • Provides integrity and confidentiality, also in face of HW DMA attacks. 70

Questions & Open Discussion Questions ? What are the limitations of SGX? Pinpoint the

Questions & Open Discussion Questions ? What are the limitations of SGX? Pinpoint the root of trust assumptions. Techniques that can be implemented to try and breach enclave security. • Are they any drawbacks when utilizing SGX? • Innovative usages of SGX capabilities. • • 71