idnits 2.17.1 draft-ietf-teep-architecture-00.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- ** The document seems to lack an IANA Considerations section. (See Section 2.2 of https://www.ietf.org/id-info/checklist for how to handle the case when there are no actions for IANA.) Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (July 2, 2018) is 2125 days in the past. Is this intentional? Checking references for intended status: Informational ---------------------------------------------------------------------------- == Missing Reference: 'CA' is mentioned on line 738, but not defined == Missing Reference: 'Soc' is mentioned on line 740, but not defined == Missing Reference: 'OEM' is mentioned on line 752, but not defined == Unused Reference: 'RFC4648' is defined on line 1008, but no explicit reference was found in the text == Unused Reference: 'RFC7515' is defined on line 1012, but no explicit reference was found in the text == Unused Reference: 'RFC7516' is defined on line 1016, but no explicit reference was found in the text == Unused Reference: 'RFC7517' is defined on line 1020, but no explicit reference was found in the text == Unused Reference: 'RFC7518' is defined on line 1024, but no explicit reference was found in the text == Unused Reference: 'GPTEECLAPI' is defined on line 1033, but no explicit reference was found in the text == Outdated reference: A later version (-03) exists of draft-ietf-teep-opentrustprotocol-00 Summary: 1 error (**), 0 flaws (~~), 11 warnings (==), 1 comment (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 TEEP M. Pei 3 Internet-Draft Symantec 4 Intended status: Informational H. Tschofenig 5 Expires: January 3, 2019 Arm Ltd. 6 A. Atyeo 7 Intercede 8 D. Liu 9 Alibaba Group 10 July 2, 2018 12 Trusted Execution Environment Provisioning (TEEP) Architecture 13 draft-ietf-teep-architecture-00.txt 15 Abstract 17 A Trusted Execution Environment (TEE) was designed to provide a 18 hardware-isolation mechanism to separate a regular operating system 19 from security- sensitive applications. 21 This architecture document motivates the design and standardization 22 of a protocol for managing the lifecyle of trusted applications 23 running inside a TEE. 25 Status of This Memo 27 This Internet-Draft is submitted in full conformance with the 28 provisions of BCP 78 and BCP 79. 30 Internet-Drafts are working documents of the Internet Engineering 31 Task Force (IETF). Note that other groups may also distribute 32 working documents as Internet-Drafts. The list of current Internet- 33 Drafts is at http://datatracker.ietf.org/drafts/current/. 35 Internet-Drafts are draft documents valid for a maximum of six months 36 and may be updated, replaced, or obsoleted by other documents at any 37 time. It is inappropriate to use Internet-Drafts as reference 38 material or to cite them other than as "work in progress." 40 This Internet-Draft will expire on January 3, 2019. 42 Copyright Notice 44 Copyright (c) 2018 IETF Trust and the persons identified as the 45 document authors. All rights reserved. 47 This document is subject to BCP 78 and the IETF Trust's Legal 48 Provisions Relating to IETF Documents 49 (http://trustee.ietf.org/license-info) in effect on the date of 50 publication of this document. Please review these documents 51 carefully, as they describe your rights and restrictions with respect 52 to this document. Code Components extracted from this document must 53 include Simplified BSD License text as described in Section 4.e of 54 the Trust Legal Provisions and are provided without warranty as 55 described in the Simplified BSD License. 57 Table of Contents 59 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 60 2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 3 61 3. Scope and Assumptions . . . . . . . . . . . . . . . . . . . . 6 62 4. Use Cases . . . . . . . . . . . . . . . . . . . . . . . . . . 6 63 4.1. Payment . . . . . . . . . . . . . . . . . . . . . . . . . 6 64 4.2. Authentication . . . . . . . . . . . . . . . . . . . . . 7 65 4.3. Internet of Things . . . . . . . . . . . . . . . . . . . 7 66 4.4. Confidential Cloud Computing . . . . . . . . . . . . . . 7 67 5. Architecture . . . . . . . . . . . . . . . . . . . . . . . . 7 68 5.1. System Components . . . . . . . . . . . . . . . . . . . . 7 69 5.2. Entity Relations . . . . . . . . . . . . . . . . . . . . 9 70 5.3. Trust Anchors in TEE . . . . . . . . . . . . . . . . . . 12 71 5.4. Trust Anchors in TAM . . . . . . . . . . . . . . . . . . 12 72 5.5. Keys and Certificate Types . . . . . . . . . . . . . . . 12 73 5.6. Scalability . . . . . . . . . . . . . . . . . . . . . . . 15 74 5.7. Message Security . . . . . . . . . . . . . . . . . . . . 15 75 5.8. Security Domain Hierarchy and Ownership . . . . . . . . . 15 76 5.9. SD Owner Identification and TAM Certificate Requirements 16 77 5.10. Service Provider Container . . . . . . . . . . . . . . . 17 78 5.11. A Sample Device Setup Flow . . . . . . . . . . . . . . . 17 79 6. Agent . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 80 6.1. Role of the Agent . . . . . . . . . . . . . . . . . . . . 18 81 6.2. Agent Implementation Consideration . . . . . . . . . . . 19 82 6.2.1. Agent Distribution . . . . . . . . . . . . . . . . . 19 83 6.2.2. Number of Agents . . . . . . . . . . . . . . . . . . 19 84 7. Attestation . . . . . . . . . . . . . . . . . . . . . . . . . 20 85 7.1. Attestation Hierarchy . . . . . . . . . . . . . . . . . . 20 86 7.1.1. Attestation Hierarchy Establishment: Manufacture . . 20 87 7.1.2. Attestation Hierarchy Establishment: Device Boot . . 20 88 7.1.3. Attestation Hierarchy Establishment: TAM . . . . . . 21 89 8. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 21 90 9. Security Consideration . . . . . . . . . . . . . . . . . . . 21 91 9.1. TA Trust Check at TEE . . . . . . . . . . . . . . . . . . 21 92 9.2. One TA Multiple SP Case . . . . . . . . . . . . . . . . . 22 93 9.3. Agent Trust Model . . . . . . . . . . . . . . . . . . . . 22 94 9.4. Data Protection at TAM and TEE . . . . . . . . . . . . . 22 95 9.5. Compromised CA . . . . . . . . . . . . . . . . . . . . . 22 96 9.6. Compromised TAM . . . . . . . . . . . . . . . . . . . . . 22 97 9.7. Certificate Renewal . . . . . . . . . . . . . . . . . . . 23 98 10. References . . . . . . . . . . . . . . . . . . . . . . . . . 23 99 10.1. Normative References . . . . . . . . . . . . . . . . . . 23 100 10.2. Informative References . . . . . . . . . . . . . . . . . 23 101 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 24 103 1. Introduction 105 The Trusted Execution Environment (TEE) concept has been designed to 106 separate a regular operating system, also referred as a Rich 107 Execution Environment (REE), from security- sensitive applications. 108 A TEE provides hardware-enforcement so that any data inside the TEE 109 cannot be read by code outside of the TEE. Compromising a REE and 110 normal applications in the REE do not affect code inside the TEE, 111 which is called a Trusted Application (TA), running inside the TEE. 113 In an TEE ecosystem, a Trusted Application Manager (TAM) is commonly 114 used to manage keys and TAs that run in a device. Different device 115 vendors may use different TEE implementations. Different application 116 providers or device administrators may choose to use different TAM 117 providers. 119 To simplify the life of developers an interoperable protocol for 120 managing TAs running in different TEEs of various devices is needed. 122 The protocol addresses the following problems. 124 1. A Device Administrator (DA) or Service Provider (SP) of the 125 device users needs to determine security-relevant information of 126 a device before provisioning the TA to the device with a TEE. 127 Examples include the verification of the device 'root of trust' 128 and the type of TEE included in a device. 130 2. A TEE in a device needs to determine whether a Device 131 Administrator (DA) or a Service Provider (SP) that wants to 132 manage an TA in the device is authorized to manage applications 133 in the TEE. 135 3. Attestation must be able to ensure a TEE is genuine. 137 2. Terminology 139 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 140 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 141 document are to be interpreted as described in RFC 2119 [RFC2119]. 143 Client Application: An application running on a rich OS, such as an 144 Android, Windows, or iOS application. 146 Device: A physical piece of hardware that hosts a TEE along with a 147 rich OS. 149 Agent: An application running in the rich OS allowing the message 150 protocol exchange between a TAM and a TEE in a device. A TEE is 151 responsible to processing relayed messages and for returning an 152 appropriate reponse. 154 Rich Execution Environment (REE) An environment that is provided and 155 governed by a typical OS (Linux, Windows, Android, iOS, etc.), 156 potentially in conjunction with other supporting operating 157 systems and hypervisors; it is outside of the TEE. This 158 environment and applications running on it are considered un- 159 trusted. 161 Secure Boot Module (SBM): A firmware in a device that delivers 162 secure boot functionality. It is generally signed and can be 163 verified whether it can be trusted. 165 Service Provider (SP): An entity that wishes to supply Trusted 166 Applications to remote devices. A Service Provider requires the 167 help of a TAM in order to provision the Trusted Applications to 168 the devices. 170 Trust Anchor: A root certificate that can be used to validate its 171 children certificates. It is usually embedded in a device or 172 configured by a TAM for validating the trust of a remote entity's 173 certificate. 175 Trusted Application (TA): An Application that runs in a TEE. 177 Trusted Execution Environment (TEE): An execution environment that 178 runs alongside of, but is isolated from, an REE. A TEE has 179 security capabilities and meets certain security-related 180 requirements. It protects TEE assets from general software 181 attacks, defines rigid safeguards as to data and functions that a 182 program can access, and resists a set of defined threats. It 183 should have at least the following three properties: 185 (a) A device unique credential that cannot be cloned; 187 (b) Assurance that only authorized code can run in the TEE; 189 (c) Memory that cannot be read by code outside of TEE. 191 There are multiple technologies that can be used to implement a 192 TEE, and the level of security achieved varies accordingly. 194 Trusted Firmware (TFW): A signed SBM firmware that can be verified 195 and is trusted by a TEE in a device. 197 This document uses the following abbreviations: 199 CA Certificate Authority 201 REE Rich Execution Environment 203 SD Security Domain 205 SP Service Provider 207 SBM Secure Boot Module 209 TA Trusted Application 211 TEE Trusted Execution Environment 213 TFW Trusted Firmware 215 TAM Trusted Application Manager 217 3. Scope and Assumptions 219 This specification assumes that an applicable device is equipped with 220 one or more TEEs and each TEE is pre-provisioned with a device-unique 221 public/private key pair, which is securely stored. This key pair is 222 referred to as the 'root of trust' for remote attestation of the 223 associated TEE in a device by an TAM. 225 A Security Domain (SD) concept is used as the security boundary 226 inside a TEE for trusted applications. Each SD is typically 227 associated with one TA provider as the owner, which is a logical 228 space that contains a SP's TAs. One TA provider may request to have 229 multiple SDs in a TEE. One SD may contain multiple TAs. Each 230 Security Domain requires the management operations of TAs in the form 231 of installation, update and deletion. 233 A TA binary and configuration data can be from two sources: 235 1. A TAM supplies the signed and encrypted TA binary 237 2. A Client Application supplies the TA binary 239 The architecture covers the first case where the TA binary and 240 configuration data are delivered from a TAM. The second case calls 241 for an extension when a TAM is absent. 243 Messages exchange with a TAM require some transport and HTTPS is one 244 commonly used transport. 246 4. Use Cases 248 4.1. Payment 250 A payment application in a mobile device requires high security and 251 trust about the hosting device. Payments initiated from a mobile 252 device can use a Trusted Application running inside TEE in the device 253 to provide strong identification and proof of transaction. 255 For a mobile payment application, some biometric identification 256 information could also be stored in the TEE. The mobile payment 257 application can use such information for authentication. 259 A secure user interface (UI) may be used in a mobile device to 260 prevent malicious software from stealing sensitive user input data. 261 Such an application implementation often relies on TEE for user input 262 protection. 264 4.2. Authentication 266 For better security of authentication, a devices may store its 267 sensitive authentication keys inside a TEE of the device, providing 268 hardware-protected security key strength and trusted execution code. 270 4.3. Internet of Things 272 Internet of Things (IoT) has been posing threats to networks and 273 national infrastructures because of existing weak security in 274 devices. It is very desirable that IoT devices can prevent a malware 275 from stealing or modifying sensitive data such as authentication 276 credentials in the device. A TEE can be the best way to implement 277 such IoT security functions. 279 TEEs could be used to store variety of sensitive data for IoT 280 devices. For example, a TEE could be used in smart door locks to 281 store a user's biometric information for identification, and for 282 protecting access the locking mechanism. Bike-sharing is another 283 example that shares a similar usage scenario. 285 4.4. Confidential Cloud Computing 287 A tenant can store sensitive data in a TEE in a cloud computing 288 server such that only the tenant can access the data, preventing the 289 cloud host provider from accessing the data. A tenant can run TAs 290 inside a server TEE for secure operation and enhanced data security. 291 This provides benefits not only to tenants with better data security 292 but also to cloud host provider for reduced liability and increased 293 cloud adoption. 295 5. Architecture 297 5.1. System Components 299 The following are the main components in the system. 301 TAM: A TAM is responsible for originating and coordinating lifecycle 302 management activity on a particular TEE on behalf of a Service 303 Provider or a Device Administrator. For example, a payment 304 application provider, which also provides payment service as a 305 Service Provider using its payment TA, may choose to use a TAM 306 that it runs or a third party TAM service to distribute and 307 update its payment TA application in payment user devices. The 308 payment SP isn't a device administrator of the user devices. A 309 user who chooses to download the payment TA into its devices acts 310 as the device administrator, authorizing the TA installation via 311 the downloading consent. The device manufacturer is typically 312 responsible for embedding the TAM trust verification capability 313 in its device TEE. 315 A TAM may be used by one SP or many SPs where a TAM may run as a 316 Software-as-a-Service (SaaS). A TAM may provide Security Domain 317 management and TA management in a device for the SD and TAs that 318 a SP owns. In particular, a TAM typically offers over-the-air 319 update to keep a SP's TAs up-to-date and clean up when a version 320 should be removed. A TEE administrator or device administrator 321 may decide TAMs that it trusts to manage its devices. 323 Certification Authority (CA): Certificate-based credentials used for 324 authenticating a device, a TAM and an SP. A device embeds a list 325 of root certificates (trust anchors), from trusted CAs that a TAM 326 will be validated against. A TAM will remotely attest a device 327 by checking whether a device comes with a certificate from a CA 328 that the TAM trusts. The CAs do not need to be the same; 329 different CAs can be chosen by each TAM, and different device CAs 330 can be used by different device manufacturers. 332 TEE: A TEE in a device is responsible for protecting applications 333 from attack, enabling the application to perform secure 334 operations. 336 REE: The REE in a device is responsible for enabling off-device 337 communications to be established between a TEE and TAM. The 338 architecture does not assume or require that the REE or Client 339 Applications is secure. 341 Agent: A Client Application is expected to communicate with a TAM to 342 request TAs that it needs to use. The Client Application needs 343 to pass the messages from the TAM to TEEs in the device. This 344 calls for a component in REE that the Client Application can use 345 to pass messages to TEEs. An Agent is this component to fill the 346 role. In other words, an Agent is an application in the REE or 347 software library that can simply relays messages from a Client 348 Application to a TEE in the device. A device usually comes with 349 only one active TEE. A TEE that supports may provide such an 350 Agent to the device manufacturer to be bundled in devices. Such 351 a compliant TEE must also include an Agent counterpart, namely, a 352 processing module inside the TEE, to parse TAM messages sent 353 through the Agent. An Agent is generally acting as a dummy 354 relaying box with just the TEE interacting capability; it doesn't 355 need and shouldn't parse protocol messages. 357 Device Administrator: A device owner or administrator may want to 358 manage what TAs allowed to run in its devices. A default list of 359 allowed TA trust root CA certificates is included in a device by 360 the device's manufacturer, which may be governed by the device 361 carriers sometimes. There may be needs to expose overriding 362 capability for a device owner to decide the list of allowed TAs 363 by updating the list of trusted CA certificates. 365 Secure Boot: Secure boot must enable authenticity checking of TEEs 366 by the TAM. Note that some TEE implementations do not require 367 secure boot functionality. 369 5.2. Entity Relations 371 This architecture leverages asymmetric cryptography to authenticate a 372 device towards a TAM. Additionally, a TEE in a device authenticates 373 a TAM provider and TA signer. The provisioning of trust anchors to a 374 device may different from one use case to the other. The device 375 administrator may want to have the capability to control what TAs are 376 allowed. A device manufacturer enables verification of the TA 377 signers and TAM providers; it may embed a list of default trust 378 anchors that the signer of an allowed TA's signer certificate should 379 chain to. A device administrator may choose to accept a subset of 380 the allowed TAs via consent or action of downloading. 382 PKI CA -- CA CA -- 383 | | | 384 | | | 385 | | | 386 Device | | --- Agent / Client App --- | 387 SW | | | | | 388 | | | | | 389 | | | | | 390 | -- TEE TAM------- 391 | 392 | 393 FW 395 Figure 1: Entities 397 (App Developer) (App Store) (TAM) (Device with TEE) (CAs) 398 | | 399 | --> (Embedded TEE cert) <-- 400 | | 401 | <------------------------------ Get an app cert ----- | 402 | | <-- Get a TAM cert ------ | 403 | 404 1. Build two apps: 405 Client App 406 TA 407 | 408 | 409 Client App -- 2a. --> | ----- 3. Install -------> | 410 TA ------- 2b. Supply ------> | 4. Messaging-->| 411 | | | | 413 Figure 2: Developer Experience 415 Figure 2 shows an application developer building two applications: 1) 416 a rich Client Application; 2) a TA that provides some security 417 functions to be run inside a TEE. At step 2, the application 418 developer uploads the Client Application (2a) to an Application 419 Store. The Client Application may optionally bundle the TA binary. 420 Meanwhile, the application developer may provide its TA to a TAM 421 provider that will be managing the TA in various devices. 3. A user 422 will go to an Application Store to download the Client Application. 423 The Client Application will trigger TA installation by calling TAM. 424 This is the step 4. The Client Application will get messages from 425 TAM, and interacts with device TEE via an Agent. 427 The following diagram will show a system diagram about the entity 428 relationships between CAs, TAM, SP and devices. 430 ------- Message Protocol ----- 431 | | 432 | | 433 -------------------- --------------- ---------- 434 | REE | TEE | | TAM | | SP | 435 | --- | --- | | --- | | -- | 436 | | | | | | | 437 | Client | SD (TAs)| | SD / TA | | TA | 438 | Apps | | | Mgmt | | | 439 | | | | | | | | 440 | | | | | | | | 441 | | Trusted | | Trusted | | | 442 | Agent | TAM/SP | | FW/TEE | | | 443 | | CAs | | CAs | | | 444 | | | | | | | 445 | |TEE Key/ | | TAM Key/ | |SP Key/ | 446 | | Cert | | Cert | | Cert | 447 | | FW Key/ | | | | | 448 | | Cert | | | | | 449 -------------------- --------------- ---------- 450 | | | 451 | | | 452 ------------- ---------- --------- 453 | TEE CA | | TAM CA | | SP CA | 454 ------------- ---------- --------- 456 Figure 3: Keys 458 In the previous diagram, different CAs can be used for different 459 types of certificates. Messages are always signed, where the signer 460 key is the message originator's private key such as that of a TAM, 461 the private key of a trusted firmware (TFW), or a TEE's private key. 463 The main components consist of a set of standard messages created by 464 a TAM to deliver device SD and TA management commands to a device, 465 and device attestation and response messages created by a TEE that 466 responds to a TAM's message. 468 It should be noted that network communication capability is generally 469 not available in TAs in today's TEE-powered devices. The networking 470 functionality must be delegated to a rich Client Application. Client 471 Applications will need to rely on an agent in the REE to interact 472 with a TEE for message exchanges. Consequently, a TAM generally 473 communicates with a Client Application about how it gets messages 474 that originates from TEE inside a device. Similarly, a TA or TEE 475 generally gets messages from a TAM via some Client Application, 476 namely, an agent in this protocol architecture, not directly from the 477 internet. 479 It is imperative to have an interoperable protocol to communicate 480 with different TEEs in different devices that a Client Application 481 needs to run and access a TA inside a TEE. This is the role of the 482 agent, which is a software component that bridges communication 483 between a TAM and a TEE. The agent does not need to know the actual 484 content of messages except for the TEE routing information. 486 5.3. Trust Anchors in TEE 488 Each TEE comes with a trust store that contains a whitelist of root 489 CA certificates that are used to validate a TAM's certificate. A TEE 490 will accept a TAM to create new Security Domains and install new TAs 491 on behalf of a SP only if the TAM's certificate is chained to one of 492 the root CA certificates in the TEE's trust store. 494 A TEE's trust store is typically preloaded at manufacturing time. It 495 is out of the scope in this document to specify how the trust store 496 should be updated when a new root certificate should be added or 497 existing one should be updated or removed. A device manufacturer is 498 expected to provide its TEE trust store live update or out-of-band 499 update to devices. 501 Before a TAM can begin operation in the marketplace to support TEE- 502 powered devices with a particular TEE, it must obtain a TAM 503 certificate from a CA that is listed in the trust store of the TEE. 505 5.4. Trust Anchors in TAM 507 The trust anchor store in a TAM consists of a list of CA certificates 508 that sign various device TEE certificates. A TAM decides what 509 devices it will trust the TEE in. 511 5.5. Keys and Certificate Types 513 This architecture leverages the following credentials, which allow 514 delivering end-to-end security without relying on any transport 515 security. 517 +-------------+----------+--------+-------------------+-------------+ 518 | Key Entity | Location | Issuer | Checked Against | Cardinality | 519 | Name | | | | | 520 +-------------+----------+--------+-------------------+-------------+ 521 | 1. TFW key | Device | FW CA | A white list of | 1 per | 522 | pair and | secure | | FW root CA | device | 523 | certificate | storage | | trusted by TAMs | | 524 | | | | | | 525 | 2. TEE key | Device | TEE CA | A white list of | 1 per | 526 | pair and | TEE | under | TEE root CA | device | 527 | certificate | | a root | trusted by TAMs | | 528 | | | CA | | | 529 | | | | | | 530 | 3. TAM key | TAM | TAM CA | A white list of | 1 or | 531 | pair and | provider | under | TAM root CA | multiple | 532 | certificate | | a root | embedded in TEE | can be used | 533 | | | CA | | by a TAM | 534 | | | | | | 535 | 4. SP key | SP | SP | A SP uses a TAM. | 1 or | 536 | pair and | | signer | TA is signed by a | multiple | 537 | certificate | | CA | SP signer. TEE | can be used | 538 | | | | delegates trust | by a TAM | 539 | | | | of TA to TAM. SP | | 540 | | | | signer is | | 541 | | | | associated with a | | 542 | | | | SD as the owner. | | 543 +-------------+----------+--------+-------------------+-------------+ 545 Table 1: Key and Certificate Types 547 1. TFW key pair and certificate: A key pair and certificate for 548 evidence of secure boot and trustworthy firmware in a device. 550 Location: Device secure storage 552 Supported Key Type: RSA and ECC 554 Issuer: OEM CA 556 Checked Against: A white list of FW root CA trusted by TAMs 558 Cardinality: One per device 560 2. TEE key pair and certificate: It is used for device attestation 561 to a remote TAM and SP. 563 This key pair is burned into the device at device manufacturer. 564 The key pair and its certificate are valid for the expected 565 lifetime of the device. 567 Location: Device TEE 569 Supported Key Type: RSA and ECC 571 Issuer: A CA that chains to a TEE root CA 573 Checked Against: A white list of TEE root CA trusted by TAMs 575 Cardinality: One per device 577 3. TAM key pair and certificate: A TAM provider acquires a 578 certificate from a CA that a TEE trusts. 580 Location: TAM provider 582 Supported Key Type: RSA and ECC. 584 Supported Key Size: RSA 2048-bit, ECC P-256 and P-384. Other 585 sizes should be anticipated in future. 587 Issuer: TAM CA that chains to a root CA 589 Checked Against: A white list of TAM root CA embedded in TEE 591 Cardinality: One or multiple can be used by a TAM 593 4. SP key pair and certificate: an SP uses its own key pair and 594 certificate to sign a TA. 596 Location: SP 598 Supported Key Type: RSA and ECC 600 Supported Key Size: RSA 2048-bit, ECC P-256 and P-384. Other 601 sizes should be anticipated in future. 603 Issuer: an SP signer CA that chains to a root CA 605 Checked Against: A SP uses a TAM. A TEE trusts an SP by 606 validating trust against a TAM that the SP uses. A TEE trusts 607 TAM to ensure that a TA from the TAM is trustworthy. 609 Cardinality: One or multiple can be used by an SP 611 5.6. Scalability 613 This architecture uses a PKI. Trust anchors exist on the devices to 614 enable the TEE to authenticate TAMs, and TAMs use trust anchors to 615 authenticate TEEs. Since a PKI is used, many intermediate CAs 616 certificates can chain to a root certificate, each of which can issue 617 many certificates. This makes the protocol highly scalable. New 618 factories that produce TEEs can join the ecosystem. In this case, 619 such a factory can get an intermediate CA certificate from one of the 620 existing roots without requiring that TAMs are updated with 621 information about the new device factory. Likewise, new TAMs can 622 join the ecosystem, providing they are issued a TAM certificate that 623 chains to an existing root whereby existing TEEs will be allowed to 624 be personalized by the TAM without requiring changes to the TEE 625 itself. This enables the ecosystem to scale, and avoids the need for 626 centralized databases of all TEEs produced or all TAMs that exist. 628 5.7. Message Security 630 Messages created by a TAM are used to deliver device SD and TA 631 management commands to a device, and device attestation and response 632 messages created by the TEE to respond to TAM messages. 634 These messages are signed end-to-end and are typically encrypted such 635 that only the targeted device TEE or TAM is able to decrypt and view 636 the actual content. 638 5.8. Security Domain Hierarchy and Ownership 640 The primary job of a TAM is to help an SP to manage its trusted 641 applications. A TA is typically installed in an SD. An SD is 642 commonly created for an SP. 644 When an SP delegates its SD and TA management to a TAM, an SD is 645 created on behalf of a TAM in a TEE and the owner of the SD is 646 assigned to the TAM. An SD may be associated with an SP but the TAM 647 has full privilege to manage the SD for the SP. 649 Each SD for an SP is associated with only one TAM. When an SP 650 changes TAM, a new SP SD must be created to associate with the new 651 TAM. The TEE will maintain a registry of TAM ID and SP SD ID 652 mapping. 654 From an SD ownership perspective, the SD tree is flat and there is 655 only one level. An SD is associated with its owner. It is up to TEE 656 implementation how it maintains SD binding information for a TAM and 657 different SPs under the same TAM. 659 It is an important decision in this protocol specification that a TEE 660 doesn't need to know whether a TAM is authorized to manage the SD for 661 an SP. This authorization is implicitly triggered by an SP Client 662 Application, which instructs what TAM it wants to use. An SD is 663 always associated with a TAM in addition to its SP ID. A rogue TAM 664 isn't able to do anything on an unauthorized SP's SD managed by 665 another TAM. 667 Since a TAM may support multiple SPs, sharing the same SD name for 668 different SPs creates a dependency in deleting an SD. An SD can be 669 deleted only after all TAs associated with this SD is deleted. An SP 670 cannot delete a Security Domain on its own with a TAM if a TAM 671 decides to introduce such sharing. There are cases where multiple 672 virtual SPs belong to the same organization, and a TAM chooses to use 673 the same SD name for those SPs. This is totally up to the TAM 674 implementation and out of scope of this specification. 676 5.9. SD Owner Identification and TAM Certificate Requirements 678 There is a need of cryptographically binding proof about the owner of 679 an SD in a device. When an SD is created on behalf of a TAM, a 680 future request from the TAM must present itself as a way that the TEE 681 can verify it is the true owner. The certificate itself cannot 682 reliably used as the owner because TAM may change its certificate. 684 To this end, each TAM will be associated with a trusted identifier 685 defined as an attribute in the TAM certificate. This field is kept 686 the same when the TAM renew its certificates. A TAM CA is 687 responsible to vet the requested TAM attribute value. 689 This identifier value must not collide among different TAM providers, 690 and one TAM shouldn't be able to claim the identifier used by another 691 TAM provider. 693 The certificate extension name to carry the identifier can initially 694 use SubjectAltName:registeredID. A dedicated new extension name may 695 be registered later. 697 One common choice of the identifier value is the TAM's service URL. 698 A CA can verify the domain ownership of the URL with the TAM in the 699 certificate enrollment process. 701 A TEE can assign this certificate attribute value as the TAM owner ID 702 for the SDs that are created for the TAM. 704 An alternative way to represent an SD ownership by a TAM is to have a 705 unique secret key upon SD creation such that only the creator TAM is 706 able to produce a proof-of-possession (PoP) data with the secret. 708 5.10. Service Provider Container 710 A sample Security Domain hierarchy for the TEE is shown in Figure 4. 712 ---------- 713 | TEE | 714 ---------- 715 | 716 | ---------- 717 |----------| SP1 SD1 | 718 | ---------- 719 | ---------- 720 |----------| SP1 SD2 | 721 | ---------- 722 | ---------- 723 |----------| SP2 SD1 | 724 ---------- 726 Figure 4: Security Domain Hiearchy 728 The architecture separates SDs and TAs such that a TAM can only 729 manage or retrieve data for SDs and TAs that it previously created 730 for the SPs it represents. 732 5.11. A Sample Device Setup Flow 734 Step 1: Prepare Images for Devices 736 1. [TEE vendor] Deliver TEE Image (CODE Binary) to device OEM 738 2. [CA] Deliver root CA Whitelist 740 3. [Soc] Deliver TFW Image 742 Step 2: Inject Key Pairs and Images to Devices 744 1. [OEM] Generate Secure Boot Key Pair (May be shared among multiple 745 devices) 747 2. [OEM] Flash signed TFW Image and signed TEE Image onto devices 748 (signed by Secure Boot Key) 750 Step 3: Setup attestation key pairs in devices 752 1. [OEM] Flash Secure Boot Public Key and eFuse Key (eFuse key is 753 unique per device) 755 2. [TFW/TEE] Generate a unique attestation key pair and get a 756 certificate for the device. 758 Step 4: Setup trust anchors in devices 760 1. [TFW/TEE] Store the key and certificate encrypted with the eFuse 761 key 763 2. [TEE vendor or OEM] Store trusted CA certificate list into 764 devices 766 6. Agent 768 A TEE and TAs do not generally have capability to communicate to the 769 outside of the hosting device. For example, the Global Platform 770 [GPTEE] specifies one such architecture. This calls for a software 771 module in the REE world to handle the network communication. Each 772 Client Application in REE may carry this communication functionality 773 but it must also interact with the TEE for the message exchange. The 774 TEE interaction will vary according to different TEEs. In order for 775 a Client Application to transparently support different TEEs, it is 776 imperative to have a common interface for a Client Application to 777 invoke for exchanging messages with TEEs. 779 A shared agent comes to meed this need. An agent is an application 780 running in the REE of the device or a SDK that facilitates 781 communication between a TAM and TEE. It also provides interfaces for 782 TAM SDK or Client Applications to query and trigger TA installation 783 that the application needs to use. 785 This interface for Client Applications may be commonly an Android 786 service call for an Android powered device. A Client Application 787 interacts with a TAM, and turns around to pass messages received from 788 TAM to agent. 790 In all cases, a Client Application needs to be able to identify an 791 agent that it can use. 793 6.1. Role of the Agent 795 An agent abstracts the message exchanges with the TEE in a device. 796 The input data is originated from a TAM that a Client Application 797 connects. A Client Application may also directly call Agent for some 798 TA query functions. 800 The agent may internally process a request from TAM. At least, it 801 needs to know where to route a message, e.g., TEE instance. It does 802 not need to process or verify message content. 804 The agent returns TEE / TFW generated response messages to the 805 caller. The agent is not expected to handle any network connection 806 with an application or TAM. 808 The agent only needs to return an agent error message if the TEE is 809 not reachable for some reason. Other errors are represented as 810 response messages returned from the TEE which will then be passed to 811 the TAM. 813 6.2. Agent Implementation Consideration 815 A Provider should consider methods of distribution, scope and 816 concurrency on device and runtime options when implementing an agent. 817 Several non-exhaustive options are discussed below. Providers are 818 encouraged to take advantage of the latest communication and platform 819 capabilities to offer the best user experience. 821 6.2.1. Agent Distribution 823 The agent installation is commonly carried out at OEM time. A user 824 can dynamically download and install an agent on-demand. 826 It is important to ensure a legitimate agent is installed and used. 827 If an agent is compromised it may drop messages and thereby 828 introducing a denial of service. 830 6.2.2. Number of Agents 832 We anticipate only one shared agent instance in a device. The 833 device's TEE vendor will most probably supply one aent. 835 With one shared agent, the agent provider is responsible to allow 836 multiple TAMs and TEE providers to achieve interoperability. With a 837 standard agent interface, TAM can implement its own SDK for its SP 838 Client Applications to work with this agent. 840 Multiple independent agent providers can be used as long as they have 841 standard interface to a Client Application or TAM SDK. Only one 842 agent is expected in a device. 844 TAM providers are generally expected to provide SDK for SP 845 applications to interact with an agent for the TAM and TEE 846 interaction. 848 7. Attestation 850 7.1. Attestation Hierarchy 852 The attestation hierarchy and seed required for TAM protocol 853 operation must be built into the device at manufacture. Additional 854 TEEs can be added post-manufacture using the scheme proposed, but it 855 is outside of the current scope of this document to detail that. 857 It should be noted that the attestation scheme described is based on 858 signatures. The only encryption that takes place may be the use of a 859 so-called eFuse to release the SBM signing key and later during the 860 protocol lifecycle management interchange with the TAM. 862 SBM attestation can be optional in TEEP architecture where the 863 starting point of device attestion can be at TEE certfificates. TAM 864 can define its policies on what kind of TEE it trusts if TFW 865 attestation isn't included during the TEE attestation. 867 7.1.1. Attestation Hierarchy Establishment: Manufacture 869 During manufacture the following steps are required: 871 1. A device-specific TFW key pair and certificate are burnt into the 872 device, encrypted by eFuse. This key pair will be used for 873 signing operations performed by the SBM. 875 2. TEE images are loaded and include a TEE instance-specific key 876 pair and certificate. The key pair and certificate are included 877 in the image and covered by the code signing hash. 879 3. The process for TEE images is repeated for any subordinate TEEs, 880 which are additional TEEs after the root TEE that some devices 881 have. 883 7.1.2. Attestation Hierarchy Establishment: Device Boot 885 During device boot the following steps are required: 887 1. Secure boot releases the TFW private key by decrypting it with 888 eFuse. 890 2. The SBM verifies the code-signing signature of the active TEE and 891 places its TEE public key into a signing buffer, along with its 892 identifier for later access. For a TEE non-compliant to this 893 architecture, the SBM leaves the TEE public key field blank. 895 3. The SBM signs the signing buffer with the TFW private key. 897 4. Each active TEE performs the same operation as the SBM, building 898 up their own signed buffer containing subordinate TEE 899 information. 901 7.1.3. Attestation Hierarchy Establishment: TAM 903 Before a TAM can begin operation in the marketplace to support 904 devices of a given TEE, it must obtain a TAM certificate from a CA 905 that is registered in the trust store of devices with that TEE. In 906 this way, the TEE can check the intermediate and root CA and verify 907 that it trusts this TAM to perform operations on the TEE. 909 8. Acknowledgements 911 The authors thank Dave Thaler for his very thorough review and many 912 important suggestions. Most content of this document are split from 913 a previously combined OTrP protocol document 914 [I-D.ietf-teep-opentrustprotocol]. We thank the former co-authors 915 Nick Cook and Minho Yoo for the initial document content, and 916 contributors Brian Witten, Tyler Kim, and Alin Mutu. 918 9. Security Consideration 920 9.1. TA Trust Check at TEE 922 A TA binary is signed by a TA signer certificate. This TA signing 923 certificate/private key belongs to the SP, and may be self-signed 924 (i.e., it need not participate in a trust hierarchy). It is the 925 responsibility of the TAM to only allow verified TAs from trusted SPs 926 into the system. Delivery of that TA to the TEE is then the 927 responsibility of the TEE, using the security mechanisms provided by 928 the protocol. 930 We allow a way for an (untrusted) application to check the 931 trustworthiness of a TA. An agent has a function to allow an 932 application to query the information about a TA. 934 An application in the Rich O/S may perform verification of the TA by 935 verifying the signature of the TA. The GetTAInformation function is 936 available to return the TEE supplied TA signer and TAM signer 937 information to the application. An application can do additional 938 trust checks on the certificate returned for this TA. It might trust 939 the TAM, or require additional SP signer trust chaining. 941 9.2. One TA Multiple SP Case 943 A TA for multiple SPs must have a different identifier per SP. A TA 944 will be installed in a different SD for each respective SP. 946 9.3. Agent Trust Model 948 An agent could be malware in the vulnerable Rich OS. A Client 949 Application will connect its TAM provider for required TA 950 installation. It gets command messages from the TAM, and passes the 951 message to the agent. 953 The architecture enables the TAM to communicate with the device's TEE 954 to manage SDs and TAs. All TAM messages are signed and sensitive 955 data is encrypted such that the agent cannot modify or capture 956 sensitive data. 958 9.4. Data Protection at TAM and TEE 960 The TEE implementation provides protection of data on the device. It 961 is the responsibility of the TAM to protect data on its servers. 963 9.5. Compromised CA 965 A root CA for TAM certificates might get compromised. Some TEE trust 966 anchor update mechanism is expected from device OEM. A compromised 967 intermediate CA is covered by OCSP stapling and OCSP validation check 968 in the protocol. A TEE should validate certificate revocation about 969 a TAM certificate chain. 971 If the root CA of some TEE device certificates is compromised, these 972 devices might be rejected by a TAM, which is a decision of the TAM 973 implementation and policy choice. Any intermediate CA for TEE device 974 certificates SHOULD be validated by TAM with a Certificate Revocation 975 List (CRL) or Online Certificate Status Protocol (OCSP) method. 977 9.6. Compromised TAM 979 The TEE SHOULD use validation of the supplied TAM certificates and 980 OCSP stapled data to validate that the TAM is trustworthy. 982 Since PKI is used, the integrity of the clock within the TEE 983 determines the ability of the TEE to reject an expired TAM 984 certificate, or revoked TAM certificate. Since OCSP stapling 985 includes signature generation time, certificate validity dates are 986 compared to the current time. 988 9.7. Certificate Renewal 990 TFW and TEE device certificates are expected to be long lived, longer 991 than the lifetime of a device. A TAM certificate usually has a 992 moderate lifetime of 2 to 5 years. A TAM should get renewed or 993 rekeyed certificates. The root CA certificates for a TAM, which are 994 embedded into the trust anchor store in a device, should have long 995 lifetimes that don't require device trust anchor update. On the 996 other hand, it is imperative that OEMs or device providers plan for 997 support of trust anchor update in their shipped devices. 999 10. References 1001 10.1. Normative References 1003 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 1004 Requirement Levels", BCP 14, RFC 2119, 1005 DOI 10.17487/RFC2119, March 1997, . 1008 [RFC4648] Josefsson, S., "The Base16, Base32, and Base64 Data 1009 Encodings", RFC 4648, DOI 10.17487/RFC4648, October 2006, 1010 . 1012 [RFC7515] Jones, M., Bradley, J., and N. Sakimura, "JSON Web 1013 Signature (JWS)", RFC 7515, DOI 10.17487/RFC7515, May 1014 2015, . 1016 [RFC7516] Jones, M. and J. Hildebrand, "JSON Web Encryption (JWE)", 1017 RFC 7516, DOI 10.17487/RFC7516, May 2015, 1018 . 1020 [RFC7517] Jones, M., "JSON Web Key (JWK)", RFC 7517, 1021 DOI 10.17487/RFC7517, May 2015, . 1024 [RFC7518] Jones, M., "JSON Web Algorithms (JWA)", RFC 7518, 1025 DOI 10.17487/RFC7518, May 2015, . 1028 10.2. Informative References 1030 [GPTEE] Global Platform, "Global Platform, GlobalPlatform Device 1031 Technology: TEE System Architecture, v1.0", 2013. 1033 [GPTEECLAPI] 1034 Global Platform, "Global Platform, GlobalPlatform Device 1035 Technology: TEE Client API Specification, v1.0", 2013. 1037 [I-D.ietf-teep-opentrustprotocol] 1038 Pei, M., Atyeo, A., Cook, N., Yoo, M., and H. Tschofenig, 1039 "The Open Trust Protocol (OTrP)", draft-ietf-teep- 1040 opentrustprotocol-00 (work in progress), May 2018. 1042 Authors' Addresses 1044 Mingliang Pei 1045 Symantec 1046 350 Ellis St 1047 Mountain View, CA 94043 1048 USA 1050 Email: mingliang_pei@symantec.com 1052 Hannes Tschofenig 1053 Arm Ltd. 1054 Absam, Tirol 6067 1055 Austria 1057 Email: Hannes.Tschofenig@arm.com 1059 Andrew Atyeo 1060 Intercede 1061 St. Mary's Road, Lutterworth 1062 Leicestershire, LE17 4PS 1063 Great Britain 1065 Email: andrew.atyeo@intercede.com 1067 Dapeng 1068 Alibaba Group 1069 Wangjing East Garden 4th Area,Chaoyang District 1070 Beijing 100102 1071 China 1073 Email: maxpassion@gmail.com