2019-03-01 B. Smeets LiTH course
SYSTEM SECURITY III: TRUSTED COMPUTING
TDDD17 Informationssäkerhet Ben Smeets Ericsson Research Security / Lund University
1
SYSTEM SECURITY III: TRUSTED COMPUTING TDDD17 Informationsskerhet - - PowerPoint PPT Presentation
SYSTEM SECURITY III: TRUSTED COMPUTING TDDD17 Informationsskerhet Ben Smeets Ericsson Research Security / Lund University 1 2019-03-01 B. Smeets LiTH course Goal of this lecture Understand trusted computing and its purpose Threats
2019-03-01 B. Smeets LiTH course
TDDD17 Informationssäkerhet Ben Smeets Ericsson Research Security / Lund University
1
computing in devices, servers, and cloud infrastructure
systems
systems and VMs with access control and the use of memory protection
2019-03-01 B. Smeets LiTH course
2
2019-03-01 B. Smeets LiTH course
3
2019-03-01 B. Smeets LiTH course
unsupervised, and physically exposed
4
2019-03-01 B. Smeets LiTH course
5
(we ignore here the questions related to the trustworthiness related to the semantics of data exchanged and processed) SERVICE USER(S)
2019-03-01 B. Smeets LiTH course
6
data (and thus also keys)?
setting up a secure TLS connection?
information, on a remote systems?
2019-03-01 B. Smeets LiTH course
7
can provide answers to our three problem questions.
well-established agreed precise definition of its properties.
2019-03-01 B. Smeets LiTH course
8
Secure multi-party computation and homomorphic encryption
For example CryptDB from MIT.
(in cryptDB information on stored data still may leak during processing, but the idea is very nice, and it works pretty efficient) css.csail.mit.edu/cryptdb/
2019-03-01 B. Smeets LiTH course
Unfortunately secure multi-party computation and Homomorphic encryption is still not practical except for some special (use) cases.
9
See http://css.csail.mit.edu/cryptdb/
2019-03-01 B. Smeets LiTH course
Raluca Ada Popa, Catherine M. S. Redfield, Nickolai Zeldovich, and Hari Balakrishnan. CryptDB: Protecting Confidentiality with Encrypted Query Processing. In Proceedings of the 23rd ACM Symposium on Operating Systems Principles (SOSP), Cascais, Portugal, October 2011.
Application Encrypted DB Encrypted query Encrypted results
10
Not completely homomorphic encryption based
What are we after, a trusted or trustworthy platform? Trusted: A system is trusted but is it trustworthy? Trustworthy: The system can fullfill the requirements defined by a methodology. Is the methodology then trustworthy ( and we get a recurssion) or we just trust the methdology. Recall: Using Common Criteria a system that is successfully evaluated at level EALx is trustworthy.
2019-03-01 B. Smeets LiTH course
11
methodology to evaluation and certify products according an agreed target set of (security related) requirements
severs, etc.
an CC certificate holds in any country that accepts the CC scheme.
http://www.fmv.se/en/Our-activities/CSEC---The-Swedish-Certification-Body-for-IT-Security/
2019-03-01 B. Smeets LiTH course
12
2019-03-01 B. Smeets LiTH course
Platform (HW) SERVICE Platform (SW) SERVICE CLOUD SERVER
Traditional realization Cloud realization
Exe environment Exe environment
How to deal with the differences between cloud and traditional?
Trustworthy because ? Trustworthy because ? Trustworthy because ? Trustworthy because ?
13
2019-03-01 B. Smeets LiTH course
Platform (HW) Trustworthy because ?
14
trust relation(e.g. a secure channel) to a specific remote system
remote party
2019-03-01 B. Smeets LiTH course
15
Verifier request attest State Attester Observations
Remote system Note: similarity to a challenge-response based authentication
2019-03-01 B. Smeets LiTH course
Service Execution env Program Service Execution env Program Recursion must stop at a service we trust/have to trust, e.g. Intel HW. Trustworthy Service
We want to trust ROOT OF TRUST (RoT)
Note: RoT is not only data (e.g. keys) but also logic, therefore we say that a RoT is an engine. 16
2019-03-01 B. Smeets LiTH course
possible
keys The general view is that HW is more trustworthy than SW realizations
17
2019-03-01 B. Smeets LiTH course
be an attacker (he/she and the device ”work together”/”have the same interests”)
territory”
18
Our focus
2019-03-01 B. Smeets LiTH course
protection mechanisms
19
2019-03-01 B. Smeets LiTH course
kernel User space kernel
User space
hypervisor (VMM)
kernel
User space User space kernel
trusted kernel trusted User space Normal OS Windows, Linux SE Linux, Android iOS Virtual Machine VMWare, KVM, Virtualbox, Java VM Hypervisor/VMM Xen, VMware ESXi, Microsoft Hyper-V (L4) CPU with trusted mode e.g.TrustZone and Intel SGX
virtualization
kernel
Partly based on slide material from Dries Schellekens
20 kernel User space User space
kernel
User space
Containers Docker, LXC systemd
User space
2019-03-01 B. Smeets LiTH course
21
TrustZone is a set of security extensions added to ARMv6 processors and greater, such as ARM11, CortexA8, CortexA9, CortexA15 and now Cortex-M. To improve security, these ARM processors can run a secure operating system (secure OS) and a normal
single core.
2019-03-01 B. Smeets LiTH course
22
User mode Privileged mode Protection rings
Dedicated
Operating System Kernel/Services Applications
Supervisor mode
LiTH course 2019-03-01 B. Smeets
Rings create isolation via hw enforced access control
24
User mode Privileged mode Protection rings
Dedicated
Operating System Kernel/Services Applications
Supervisor mode
App1 App2
LiTH course 2019-03-01 B. Smeets
serv App3
26
System gets compromised by App compromising privileged component
Normal world Secure world
LiTH course 2019-03-01 B. Smeets
27
tagged as belonging to the secure world
is still present
LiTH course 2019-03-01 B. Smeets
28
Normal application Normal OS Secure Service Secure Kernel Secure drivers Secure device Boot loader userspace priviledged userspace priviledged Normal Secure
LiTH course 2019-03-01 B. Smeets
Ordinary OS context switch Context Switch using SMC call instruction
Monitor
29
App_norm App_sec userspace priviledged userspace priviledged Normal Secure
LiTH course 2019-03-01 B. Smeets
30
Access possible Access not possible
App2 userspace priviledged userspace priviledged Normal Secure
LiTH course 2019-03-01 B. Smeets
31
Secure interrupt HW
App1 Interupt handler
Interrupt events This allows (e.g. via a secure timer) us ti implement a security watchdog that at regular intervals takes control Regardless what happens in the normal world. So the normal world cannot starve the secure world
Widespread in use in smartphones using Qualcomm and Samsung chipsets Forms a core of Samsung’s KNOX solution
2019-03-01 B. Smeets LiTH course
33
is practically impossible to get high EAL levels in the Common critera framework nor in the US NIST security levels for HW , FIPS 184-2, Security Requirements For Cryptographic Modules
multiple threads ???
system is not part of the TZ solution and must be addressed by the chip maker that used TZ in his ASICS and the final device vendor ( e.g. Samsung, Sony)
2019-03-01 B. Smeets LiTH course
34
SGX in a new technology introduced in Intel chipsets SGX architecture includes 17 new instructions, new processor structures and a new mode of execution (additional extensions for servers are upcoming).
2019-03-01 B. Smeets LiTH course
35
The new Intel CPU HW features:
to resources via page table mappings, and scheduling the execution of enclave enabled application. Thus, system software still maintains control as to what resources an enclave can access.
can be decomposed into smaller components, such that only security critical components are placed into an enclave.
2019-03-01 B. Smeets LiTH course
36
enclaves and is called Enclave Page Cache (EPC)
2019-03-01 B. Smeets LiTH course
More info see this good overview paper: Victor Costan and Srinivas Devadas, SGX explained: https://eprint.iacr.org/2016/086.pdf
37
defend is own secrets
enclave+processor)
VMM, BIOS, drivers cannot steal app secrets
2019-03-01 B. Smeets LiTH course
Hardware VMM OS App App App App secrets
38
1. Security perimeter is the CPU package boundary 2. Data and code unencrypted inside CPU package 3. Data and code outside CPU package is encrypted/integrity protected, 4. External memory reads and bus snoops tapping gives access to encrypted
2019-03-01 B. Smeets LiTH course
CPU Cores Cache SYSTEM MEMORY
attacks
39
2019-03-01 B. Smeets LiTH course
Enclave (DLL) OS Enclave code Enclclave data TCS (*n) Enclclave data
integrity protection
memory
(call) points into enclave (ecalls)
Protected execution environment embedded in a process Enclave User process
TCS= Thread Control Structure
41
Interactions with enclaves goes via what Intel defined as ECALLs and OCALLs:
(calls from applications into the enclave)
enclave, passing input parameters and pointers to shared memory within the application. Those invocations are called ECALLs.
(calls from enclave to its application)
defined function in the application. Contrary to an ECALL, an OCALL cannot share enclave memory with the application, so it must copy the parameters into the application memory before the
2019-03-01 B. Smeets LiTH course
42
block ECALLs if possible
Note: it depends, of course,
there are problems with nesting ecalls.
2019-03-01 B. Smeets LiTH course
43
Pre-call: activate protective measures OCALL ECALL All/certain ecalls are blocked Post-call: remove restrictions Program flow direction
storage to disk. Encryption is performed using a private Seal Key that is unique to that particular platform and enclave, and is unknown to any other entity
2019-03-01 B. Smeets LiTH course
44
Sealing: Enclave
SealKey . Encrypt Secret data Sealed data Persistent storage Sealkey is derived via EGETKEY
with enclaves
2019-03-01 B. Smeets LiTH course
45
loading activity procedure.
meta-data (i.e.relative locations of each page in enclave’s stack and heap regions, its attributes and security flags, et cetera).
unique measurement called MRENCLAVE
Vendors (ISV) wishing to harden their application with SGX, should first identify sensitive application computation suitable to enclave. Integrity sensitive code such as cryptographic functions or procedures that handle confidential secrets, are some good examples of enclave candidates.
2019-03-01 B. Smeets LiTH course
46
Measurement is basically a recorded cryptographic hash
sealing authority. The sealing authority signs the enclave
key and is part of enclave’s SIGSTRUCT certificate.
2019-03-01 B. Smeets LiTH course
47
To launch an enclave it must be authorized by a so-called Launch Authority.
however other entities can be trusted by the platform
launch authority is specified by its public key hash signed by Intel and stored on the platform. Note: Intel SGX 2.0 will be more flexible with rsp to who can be the Launch Authority
2019-03-01 B. Smeets LiTH course
48
The Independent Software Vendor (ISV) should provide a certificate alongside every enclave.
mandatory supplement for launching any enclave.
SIGSTRUCTs are signed by the ISV with its private key, which was originally signed by an SGX launch authority.
2019-03-01 B. Smeets LiTH course
49
fuses) into the HW and others are derived as needed via EGETKEY calls
2019-03-01 B. Smeets LiTH course
50
In SGX1.0 Intel computes the RPK as an EPID type key. For newer SGX versions there will be
database of issued RPKs to facilitate a proof that an SGX ASIC is genuine. Intel claims they have no knowledge of the RSK
Intel chipsets and play an important role in SGX 1.0.
SGX version will provider alternatives to EPID keys.
unlikability (anonymity)
2019-03-01 B. Smeets LiTH course
52
enclave in ASIC
2019-03-01 B. Smeets LiTH course
53
Management system SERVER CPU Attestation Enclave Service Enclave ID Verifier
RoT anchor (e.g. certificate link to ID credentials in server HW)
We cover SGX 1.0 (the SGX you have today in PCs) and not the next generation SGX 2.0 which addresses shortcomings for server systems.
2019-03-01 B. Smeets LiTH course
54
2019-03-01 B. Smeets LiTH course
55
HW
Enclave A: Claimant Enclave B: Verifier
Key + Key derivation 1: Challenge ( B’s MRENCLAVE) Call EREPORT for B Verify EREPORT Use EGETKEY Verify EREPORT Use EGETKEY Call EREPORT for A 2: Response with report 3: Response with report REPORT KEY REPORT KEY Use Diffie-Hellman to setup secure channel Are protected by MAC
for signing and for which an certificate exists that can be used to verify signatures that have created by signing with this key.
certificate obained and can be checked for validity.
signs the quote
The term ’quoting’ is also used in the Trusted Computing Group specifications when performing remote attestation.
2019-03-01 B. Smeets LiTH course
56
2019-03-01 B. Smeets LiTH course
57
HW Enclave A
Claimant
Key + Key derivation 1: Quote request 2: Response with report 3: Response with report REPORT KEYs Are protected by MAC Quoting Enclave Verifier Application Intel Attestation Server (IAS) 7: Verify attestation EPID EPID public key certificate 7: EPID signed quote
RemoteVerifier
2019-03-01 B. Smeets LiTH course
58
confidential computing using enclave technology
used enclave technology is cloud computing. (Google has a similar initiative with Asylo)
2019-03-01 B. Smeets LiTH course
59
https://github.com/Microsoft/openenclave
a trustworthy consensus scheme.
may operarate on sensitive transaction data. The data and computations that demand privacy can be selectively placed inside an enclave protected from untrusted blockchain node access.
until it is needed for a transaction. It is then decrypted in the secure enclave where permitted participants can view it.
2019-03-01 B. Smeets LiTH course
60
connection to Intel which is not acceptable in many uses cases (is remedied in next generation SGX)
with virtualized systems.
2019-03-01 B. Smeets LiTH course
61
2019-03-01 B. Smeets LiTH course
62
Compared to Intel SGX AMD SEV
space
https://thehackernews.com/2018/05/amd-sev- encryption.html
2019-03-01 B. Smeets LiTH course
63
Slides that follow are only for reference and do not belong to the mandatory course material
2019-03-01 B. Smeets LiTH course
65
2019-03-01 B. Smeets LiTH course
66
trusted when we talk about compute plartforms?
trustworthiness?
trustworthiness of a platform?
trustworthy?
trustworthy PC?
2019-03-01 B. Smeets LiTH course
67
virtualization? discuss arguments.
(trustworthy) computing?
TrustZone enabled system that are located in normal or secure world.
scanner is never executed?
system?
2019-03-01 B. Smeets LiTH course
68
starving an enclave by the OS?
MRSIGNER?
make it execute? Give pros and cons for such capability.
attestation?
2019-03-01 B. Smeets LiTH course
69
2019-03-01 B. Smeets LiTH course
73
can use EPID identities
corresponds to multiple private keys
can be used to generate a signature
using the group public key
2019-03-01 B. Smeets LiTH course
76
Public Secret key 1 Secret key 2 Secret key n
sign message epid signature verify message, epid signature Ok / Not Ok
2019-03-01 B. Smeets LiTH course
77
Issuer Verifier Member
Knows issuer secret Knows private key
Sign
Signs a message using his private key and outputs an EPID signature
Verify
Verifies EPID signature using the group public key
Join
Each Member obtains a unique EPID private key EPID group public key
http://csrc.nist.gov/groups/ST/PEC2011/presentations2011/b