RFC 9397

Trusted Execution Environment Provisioning (TEEP) Architecture

πŸ“… published July 2023, from ietf

RFC 9397: Trusted Execution Environment Provisioning (TEEP) Architecture ✨

Okay bestie, let's start with the paperwork πŸ“‹ This is RFC 9397, called Trusted Execution Environment Provisioning (TEEP) Architecture πŸŽ€ It comes from the Internet Engineering Task Force (IETF) stream and is dated July 2023. Its category is Informational, so it explains the thinking rather than being a standards-track spec πŸ’œ The ISSN is 2070-1721. The authors are M. Pei (Broadcom), H. Tschofenig (no affiliation listed in the header), D. Thaler (Microsoft), and D. Wheeler (Amazon) 🫢 The header doesn't list any RFCs it obsoletes or updates, so there's nothing to chase there πŸ™ˆ

Abstract πŸ“

So a Trusted Execution Environment (TEE) is basically a locked safe room inside your device 🏰 It enforces two things: any code inside the room can't be tampered with, and any data that code uses can't be read or messed with by any code outside the room. This architecture doc talks about why we want a standard protocol for managing the lifecycle of Trusted Applications that live inside that room πŸ”

Status of This Memo πŸͺ§

This document is not an Internet Standards Track specification. It's published for informational purposes πŸ’…

It's a product of the IETF, so it represents the consensus of the IETF community. It went through public review and got approved for publication by the Internet Engineering Steering Group (IESG) ✨ Not everything the IESG approves is a candidate for any level of Internet Standard, so check out Section 2 of RFC 7841 if you're curious about that πŸ€“

For the current status, any errata, and how to give feedback, head to https://www.rfc-editor.org/info/rfc9397 πŸ¦‹

Copyright (c) 2023 IETF Trust and the persons identified as the document authors. All rights reserved πŸ’œ

This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/license-info) as they're in effect on the date this document was published. Please read these carefully, because they spell out your rights and restrictions for this document πŸ™ Code Components pulled out of this document must include Revised BSD License text as described in Section 4.e of the Trust Legal Provisions, and they're provided without warranty as described in the Revised BSD License 🌈

Table of Contents πŸ—ΊοΈ

   1.  Introduction
   2.  Terminology
   3.  Use Cases
     3.1.  Payment
     3.2.  Authentication
     3.3.  Internet of Things
     3.4.  Confidential Cloud Computing
   4.  Architecture
     4.1.  System Components
     4.2.  Multiple TEEs in a Device
     4.3.  Multiple TAMs and Relationship to TAs
     4.4.  Untrusted Apps, Trusted Apps, and Personalization Data
       4.4.1.  Example: Application Delivery Mechanisms in Intel SGX
       4.4.2.  Example: Application Delivery Mechanisms in Arm
               TrustZone
     4.5.  Entity Relations
   5.  Keys and Certificate Types
     5.1.  Trust Anchors in a TEEP Agent
     5.2.  Trust Anchors in a TEE
     5.3.  Trust Anchors in a TAM
     5.4.  Scalability
     5.5.  Message Security
   6.  TEEP Broker
     6.1.  Role of the TEEP Broker
     6.2.  TEEP Broker Implementation Consideration
       6.2.1.  TEEP Broker APIs
       6.2.2.  TEEP Broker Distribution
   7.  Attestation
   8.  Algorithm and Attestation Agility
   9.  Security Considerations
     9.1.  Broker Trust Model
     9.2.  Data Protection
     9.3.  Compromised REE
     9.4.  CA Compromise or Expiry of CA Certificate
     9.5.  Compromised TAM
     9.6.  Malicious TA Removal
     9.7.  TEE Certificate Expiry and Renewal
     9.8.  Keeping Secrets from the TAM
     9.9.  REE Privacy
   10. IANA Considerations
   11. Informative References
   Acknowledgments
   Contributors
   Authors' Addresses

1. Introduction 🌸

Apps running on a device are a big target 😀 Lots of attacks are aimed at breaking an app's execution or at revealing the data it's working with. These attacks get worse as the number of other apps on the device grows, especially when those apps come from potentially untrustworthy sources. Feature complexity and the weird, unintended interactions between features and apps make the potential for attacks even bigger. And the more sensitive the apps or data on the device, the higher the risk. For example, leaked emails from a mail client worry the owner, but a compromised banking app is an even bigger deal πŸ’Έ

The Trusted Execution Environment (TEE) concept lets apps run in a protected environment that enforces two things: any code inside that environment can't be tampered with, and any data used by that code can't be read or tampered with by any code outside it, including a commodity operating system (if one is present) πŸ”’ With multiple TEEs, this also means code in one TEE can't be read or tampered with by code in another TEE. Iconic separation, honestly πŸ‘‘

This separation makes a successful attack on app components and the data inside the TEE less likely πŸ¦‹ App components usually get picked to run inside a TEE because they do security-sensitive operations or handle sensitive data. An app component running inside a TEE is commonly called a Trusted Application (TA) (see [GPTEE] and [OP-TEE] for examples). An app running outside any TEE, in the Rich Execution Environment (REE), is called an Untrusted Application (UA) πŸ’… Picture a banking app: the code for the authentication protocol could live in a TA, while the app logic, including HTTP protocol parsing, sits in the Untrusted Application. Processing credit card numbers or account balances could also happen in a TA, since that's sensitive data πŸ’³ The exact code split is the developer's call, based on the assets they want to protect according to their threat model 🧠

TEEs are typically used when software or data needs protecting from unauthorized access, and the threat actors might have physical or administrative access to the device πŸ•΅οΈβ€β™€οΈ That shows up in gaming consoles (where anti-cheat protection matters), ATMs or IoT devices in places where attackers might get physical access, cell phones and other devices used for mobile payments, and hosted cloud environments ☁️ These can be thought of as hybrid devices, where one user or administrator controls the REE and a different (remote) user or administrator controls a TEE in the same physical device. Some constrained devices might not have an REE at all (just a TEE), and no local "user" per se, only a remote TEE administrator πŸ€– For more on these confidential computing use cases and the threat model, check out [CC-Overview] and [CC-Technical-Analysis] πŸ“š

TEEs use hardware enforcement combined with software protection to secure TAs and their data πŸ›‘οΈ They typically offer TAs a more limited set of services than what Untrusted Applications normally get πŸ₯Ί

But not all TEEs are the same, bestie πŸ™ƒ Different vendors may have different implementations, with different security properties, features, and control mechanisms for operating on TAs. Some vendors even market multiple TEEs of their own, with different properties aimed at different markets. And a device vendor may integrate one or more TEEs into their devices depending on what the market needs 🏷️

To make life easier for TA developers working with TAs in a TEE, we need an interoperable protocol for managing TAs running in different TEEs across various devices πŸŽ€ This software update protocol needs to make sure that compatible trusted and Untrusted Components (if any) of an application get installed on the correct device. In this TEE ecosystem, there's often a need for an external trusted party to verify the identity, claims, and permissions of TA developers, devices, and their TEEs. That external trusted party is the Trusted Application Manager (TAM) πŸ‘‘

The Trusted Execution Environment Provisioning (TEEP) protocol tackles these problems:

  • An installer of an Untrusted Application that depends on a given TA wants to request installation of that TA in the device's TEE so the Untrusted Application's installation can complete. But the TEE needs to verify whether that TA is actually authorized to run in the TEE and to consume potentially scarce TEE resources 🧐
  • A TA developer providing a TA whose code is confidential wants to determine security-relevant information about a device before letting their TA be provisioned to the TEE within that device. One example is verifying the type of TEE included in a device and whether it can provide the security protections required πŸ”
  • A TEE in a device needs to determine whether an entity that wants to manage a TA in the device is authorized to manage TAs in the TEE, and which TAs that entity is permitted to manage πŸ—οΈ
  • A Device Administrator wants to determine if a TA exists on a device (in other words, is installed in the TEE) and, if it doesn't, install the TA in the TEE πŸ“₯
  • A Device Administrator wants to check whether a TA in a device's TEE is the most up-to-date version, and if it isn't, update the TA in the TEE πŸ”„
  • A Device Administrator wants to remove a TA from a device's TEE if the TA developer is no longer maintaining it, if the TA has been revoked, or if the TA isn't used for other reasons (e.g., due to an expired subscription) πŸ—‘οΈ

For TEEs that simply verify and load signed TAs from an untrusted filesystem, classic application distribution protocols can be used without modification πŸ₯° But the problems in the bullets above need a new protocol, and that's the TEEP protocol πŸ’– TEEP is a solution for TEEs that can install and enumerate TAs in a TEE-secured location, where no other domain-specific protocol standard that meets the needs (e.g., [GSMA] and [OTRP]) is already in use 🧚

Next up: Section 2, Terminology πŸŽ€βœ¨

2. Terminology ✨

okay bestie, before we get into the good stuff we need the vocab down 🫢 these are the terms the doc uses, so here's the tea πŸ’…

App Store: an online spot where Untrusted Applications can be downloaded πŸ›οΈ

Device: a physical piece of hardware that hosts one or more TEEs, often along with an REE πŸ–₯️

Device Administrator: an entity in charge of administering a device, which could be the Device Owner. A Device Administrator has privileges on the device to install and remove Untrusted Applications and TAs, approve or reject Trust Anchors, and approve or reject TA developers, among other possible privileges on the device. A Device Administrator can manage the list of allowed TAMs by modifying the list of Trust Anchors on the device. Although a Device Administrator may have privileges and device-specific controls to locally administer a device, the Device Administrator may choose to remotely administer a device through a TAM. πŸ‘‘ the admin is basically the boss of the device, no cap

Device Owner: a device is always owned by someone πŸ”‘ Sometimes the (primary) device user also owns the device, which makes the user/owner also the Device Administrator. In enterprise environments it's more common for the enterprise to own the device, and for any device user to have no or limited administration rights. In that case, the enterprise appoints a Device Administrator that is not the Device Owner. 🏒

Device User: a human being who uses a device πŸ™‹β€β™€οΈ Many devices have a single device user. Some devices have a primary device user with other human beings as secondary device users (like a parent letting their kids use their tablet or laptop) 🧸 Other devices aren't used by a human being, so they have no device user at all πŸ€–

Personalization Data: a set of configuration data that's specific to the device or user πŸŽ€ It may depend on the type of TEE, a particular TEE instance, the TA, and even the user of the device. An example of Personalization Data might be a secret symmetric key used by a TA to communicate with some service. πŸ”

Raw Public Key: a raw public key consists of only the algorithm identifier (type) of the key and the cryptographic public key material, such as the SubjectPublicKeyInfo structure of a PKIX certificate [RFC5280]. Other serialization formats that do not rely on ASN.1 may also be used. 🧁

Rich Execution Environment (REE): an environment that is provided and governed by a typical OS (e.g., Linux, Windows, Android, iOS), potentially in conjunction with other supporting operating systems and hypervisors. It is outside of the TEE(s) managed by the TEEP protocol. This environment and applications running on it are considered untrusted (or more precisely, less trusted than a TEE). 🌈 the REE is the everyday world, and it's way less trusted than a TEE, iykyk

Trust Anchor: as defined in [RFC6024] and [RFC9019], a Trust Anchor "represents an authoritative entity via a public key and associated data. The public key is used to verify digital signatures, and the associated data is used to constrain the types of information for which the trust anchor is authoritative." The Trust Anchor may be a certificate, a raw public key, or other structure, as appropriate. It can be a non-root certificate when it is a certificate. βš“

Trust Anchor Store: as defined in [RFC6024], a "trust anchor store is a set of one or more trust anchors stored in a device... A device may have more than one trust anchor store, each of which may be used by one or more applications." As noted in [RFC9019], "a trust anchor store must resist modification against unauthorized insertion, deletion, and modification." 🏦

Trusted Application (TA): an application (or, in some implementations, an application component) that runs in a TEE. ✨

Trusted Application Manager (TAM): an entity that manages Trusted Applications and other Trusted Components running in TEEs of various devices. πŸŽ›οΈ

Trusted Component: a set of code and/or data in a TEE that is managed as a unit by a Trusted Application Manager. Trusted Applications and Personalization Data are managed by being included in Trusted Components. Trusted OS code or trusted firmware can also be expressed as Trusted Components that a Trusted Component depends on. 🧩

Trusted Component Developer: an entity that develops one or more Trusted Components. πŸ‘©β€πŸ’»

Trusted Component Signer: an entity that signs a Trusted Component with a key that a TEE will trust. The signer might or might not be the same entity as the Trusted Component Developer. For example, a Trusted Component might be signed (or re-signed) by a Device Administrator if the TEE will only trust the Device Administrator. A Trusted Component might also be encrypted if the code is considered confidential, for example, when a developer wants to provide a TA without revealing its code to others. πŸ”

Trusted Execution Environment (TEE): an execution environment that enforces that only authorized code can execute within the TEE, and that data used by that code cannot be read or tampered with by code outside the TEE. A TEE also generally has a unique device credential that cannot be cloned. There are multiple technologies that can be used to implement a TEE, and the level of security achieved varies accordingly. In addition, TEEs typically use an isolation mechanism between Trusted Applications to ensure that one TA cannot read, modify, or delete the data and code of another TA. πŸ›‘οΈ TEEs are the main character of this whole doc, periodt

Untrusted Application (UA): an application running in an REE. An Untrusted Application might depend on one or more TAs. πŸ“±


3. Use Cases ✨

3.1. Payment πŸ’³

A payment application in a mobile device requires high security and trust in the hosting device. Payments initiated from a mobile device can use a Trusted Application to provide strong identification and proof of transaction. πŸ’–

For a mobile payment application, some biometric identification information could also be stored in a TEE. The mobile payment application can use such information for unlocking the device and local identification of the user. πŸ‘†

A trusted user interface (UI) may be used in a mobile device or point-of-sale device to prevent malicious software from stealing sensitive user input data. Such an implementation often relies on a TEE for providing access to peripherals, such as PIN input or a trusted display, so that the REE cannot observe or tamper with the user input or output. πŸ”’ the REE is not getting a peek at your PIN, bestie

3.2. Authentication πŸ”‘

For better security of authentication, a device may store its keys and cryptographic libraries inside a TEE, limiting access to cryptographic functions via a well-defined interface and thereby reducing access to keying material. πŸ—οΈ

3.3. Internet of Things 🧚

Weak security in Internet of Things (IoT) devices has been posing threats to critical infrastructure, i.e., assets that are essential for the functioning of a society and economy. It is desirable that IoT devices can prevent malware from manipulating actuators (e.g., unlocking a door) or stealing or modifying sensitive data, such as authentication credentials in the device. A TEE can be one of the best ways to implement such IoT security functions. For example, [GPTEE] uses the term "trusted peripheral" to refer to such things being accessible only from the TEE, and this concept is used in some GlobalPlatform-compliant devices today. 🏠 no more unlocking doors for malware, slay

3.4. Confidential Cloud Computing ☁️

A tenant can store sensitive data, such as customer details or credit card numbers, in a TEE in a cloud computing server such that only the tenant can access the data, which prevents the cloud hosting provider from accessing the data. A tenant can run TAs inside a server TEE for secure operation and enhanced data security. This provides benefits not only to tenants with better data security but also to cloud hosting providers for reduced liability and increased cloud adoption. 🫧 everybody wins in this one, it's giving teamwork


4. Architecture ✨

4.1. System Components ✨

Okay bestie, Figure 1 is the big picture 🧚 It shows every main piece in a typical device with an REE and a TEE πŸ’– Any components we haven't defined yet get full descriptions below, and the paragraphs after the diagram explain how they all talk to each other 🫢

   +---------------------------------------------+
   | Device                                      |     Trusted Component
   |                          +--------+         |               Signer
   |    +---------------+     |        |--------------+              |
   |    | TEE-1         |     | TEEP   |-----------+  |              |
   |    | +--------+    |  +--| Broker |         | |  |   +-------+  |
   |    | | TEEP   |    |  |  |        |<-----+  | |  +-->|       |<-+
   |    | | Agent  |<------+  |        |      |  | |    +-| TAM-1 |
   |    | +--------+    |     |        |<---+ |  | +--->| |       |<-+
   |    |               |     +--------+    | |  |      | +-------+  |
   |    | +----+ +----+ |                   | |  |      | TAM-2 |    |
   |  +-->|TA-1| |TA-2| |        +-------+  | |  |      +-------+    |
   |  | | |    | |    |<---------| UA-2  |--+ |  |                   |
   |  | | +----+ +----+ |  +-------+     |    |  |               Device
   |  | +---------------+  | UA-1  |     |    |  |         Administrator
   |  |                    |       |     |    |  |
   |  +--------------------|       |-----+    |  |
   |                       |       |----------+  |
   |                       +-------+             |
   +---------------------------------------------+

Figure 1: Notional Architecture of TEEP

Trusted Component Signer and Device Administrator: Trusted Component Signers and Device Administrators utilize the services of a TAM to manage TAs on devices. Trusted Component Signers do not directly interact with devices. Device Administrators may elect to use a TAM for remote administration of TAs instead of managing each device directly.

Trusted Application Manager (TAM): A TAM is responsible for performing lifecycle management activity on Trusted Components on behalf of Trusted Component Signers and Device Administrators. This includes installation and deletion of Trusted Components and may include, for example, over-the-air updates to keep Trusted Components up-to-date and clean up when Trusted Components should be removed. TAMs may provide services that make it easier for Trusted Component Signers or Device Administrators to use the TAM's service to manage multiple devices, although that is not required of a TAM.

The TAM performs its management of Trusted Components on the device through interactions with a device's TEEP Broker, which relays messages between a TAM and a TEEP Agent running inside the TEE. TEEP authentication is performed between a TAM and a TEEP Agent.

When the TEEP Agent runs in a user or enterprise device, network and application firewalls normally protect user and enterprise devices from arbitrary connections from external network entities. In such a deployment, a TAM outside that network might not be able to directly contact a TEEP Agent but needs to wait for the TEEP Broker to contact it. The architecture in Figure 1 accommodates this case as well as other less restrictive cases by leaving such details to an appropriate TEEP transport protocol (e.g., [TEEP-HTTP], though other transport protocols can be defined under the TEEP protocol for other cases).

A TAM may be publicly available for use by many Trusted Component Signers, or a TAM may be private and accessible by only one or a limited number of Trusted Component Signers. It is expected that many enterprises, manufacturers, and network carriers will run their own private TAM.

A Trusted Component Signer or Device Administrator chooses a particular TAM based on whether the TAM is trusted by a device or set of devices. The TAM is trusted by a device if the TAM's public key is, or chains up to, an authorized Trust Anchor in the device and conforms with all constraints defined in the Trust Anchor. A Trusted Component Signer or Device Administrator may run their own TAM, but the devices they wish to manage must include this TAM's public key or certificate, or a certificate it chains up to, in the Trust Anchor Store.

A Trusted Component Signer or Device Administrator is free to utilize multiple TAMs. This may be required for managing Trusted Components on multiple different types of devices from different manufacturers or mobile devices on different network carriers, since the Trust Anchor Store on these different devices may contain keys for different TAMs. To overcome this limitation, Device Administrator may be able to add their own TAM's public key or certificate, or a certificate it chains up to, to the Trust Anchor Store on all their devices.

Any entity is free to operate a TAM. For a TAM to be successful, it must have its public key or certificate installed in a device's Trust Anchor Store. A TAM may set up a relationship with device manufacturers or network carriers to have them install the TAM's keys in their device's Trust Anchor Store. Alternatively, a TAM may publish its certificate and allow Device Administrators to install the TAM's certificate in their devices as an aftermarket action.

TEEP Broker: A TEEP Broker is an application component running in a Rich Execution Environment (REE) that enables the message protocol exchange between a TAM and a TEE in a device. A TEEP Broker does not process messages on behalf of a TEE but is merely responsible for relaying messages from the TAM to the TEE and for returning the TEE's responses to the TAM. In devices with no REE (e.g., a microcontroller where all code runs in an environment that meets the definition of a Trusted Execution Environment in Section 2), the TEEP Broker would be absent, and the TEEP protocol transport would be implemented inside the TEE itself.

TEEP Agent: The TEEP Agent is a processing module running inside a TEE that receives TAM requests (typically relayed via a TEEP Broker that runs in an REE). A TEEP Agent in the TEE may parse or forward requests to other processing modules in a TEE, which is up to a TEE provider's implementation. A response message corresponding to a TAM request is sent back to the TAM, again typically relayed via a TEEP Broker.

Certification Authority (CA): A CA is an entity that issues digital certificates (especially X.509 certificates) and vouches for the binding between the data items in a certificate [RFC4949]. Certificates are then used for authenticating a device, a TAM, or a Trusted Component Signer, as discussed in Section 5. The CAs do not need to be the same; different CAs can be chosen by each TAM, and different device CAs can be used by different device manufacturers.


4.2. Multiple TEEs in a Device πŸ¦‹

Some devices might implement multiple TEEs. In these cases, there might be one shared TEEP Broker that interacts with all the TEEs in the device. However, some TEEs (for example, SGX [SGX]) present themselves as separate containers within memory without a controlling manager within the TEE. As such, there might be multiple TEEP Brokers in the REE, where each TEEP Broker communicates with one or more TEEs associated with it.

It is up to the REE and the Untrusted Applications how they select the correct TEEP Broker. Verification that the correct TA has been reached then becomes a matter of properly verifying TA attestations, which are unforgeable.

The multiple TEEP Broker approach is shown in the diagram below. For brevity, TEEP Broker 2 is shown interacting with only one TAM, Untrusted Application, and TEE, but no such limitations are intended to be implied in the architecture.

   +-------------------------------------------+
   | Device                                    |     Trusted Component
   |                                           |               Signer
   |    +---------------+                      |                  |
   |    | TEE-1         |                      |                  |
   |    | +-------+     |     +--------+       |      +--------+  |
   |    | | TEEP  |     |     | TEEP   |------------->|        |<-+
   |    | | Agent |<----------| Broker |       |      |        | TA
   |    | | 1     |     |     | 1      |---------+    |        |
   |    | +-------+     |     |        |       | |    |        |
   |    |               |     |        |<---+  | |    |        |
   |    | +----+ +----+ |     |        |    |  | |  +-|  TAM-1 | Policy
   |    | |TA-1| |TA-2| |     |        |<-+ |  | +->| |        |<-+
   |  +-->|    | |    |<---+  +--------+  | |  |    | +--------+  |
   |  | | +----+ +----+ |  |              | |  |    | TAM-2  |    |
   |  | |               |  |   +-------+  | |  |    +--------+    |
   |  | +---------------+  +---| UA-2  |--+ |  |       ^          |
   |  |                    +-------+   |    |  |       |       Device
   |  +--------------------| UA-1  |   |    |  |       |   Administrator
   |                +------|       |   |    |  |       |
   |    +-----------|---+  |       |---+    |  |       |
   |    | TEE-2     |   |  |       |--------+  |       |
   |    | +------+  |   |  |       |-------+   |       |
   |    | | TEEP |  |   |  +-------+       |   |       |
   |    | | Agent|<-------+                |   |       |
   |    | | 2    |  |   | |                |   |       |
   |    | +------+  |   | |                |   |       |
   |    |           |   | |                |   |       |
   |    | +----+    |   | |                |   |       |
   |    | |TA-3|<---+   | |   +---------+  |   |       |
   |    | |    |        | |   | TEEP    |<-+   |       |
   |    | +----+        | +---| Broker  |      |       |
   |    |               |     | 2       |--------------+
   |    +---------------+     +---------+      |
   |                                           |
   +-------------------------------------------+

Figure 2: Notional Architecture of TEEP with multiple TEEs

In the diagram above, TEEP Broker 1 controls interactions with the TAs in TEE-1, and TEEP Broker 2 controls interactions with the TAs in TEE-2. This presents some challenges for a TAM in completely managing the device, since a TAM may not interact with all the TEEP Brokers on a particular platform. In addition, since TEEs may be physically separated, with wholly different resources, there may be no need for TEEP Brokers to share information on installed Trusted Components or resource usage.

4.3. Multiple TAMs and Relationship to TAs

Okay bestie, this is where the TAMs come in and it's giving network drama πŸ’…πŸ¦‹. As shown in Figure 2, a TEEP Broker provides communication between one or more TEEP Agents and one or more TAMs. The selection of which TAM to interact with might be made with or without input from an Untrusted Application, but it's ultimately the decision of a TEEP Agent. ✨

For any given Trusted Component, a TEEP Agent is assumed to be able to determine whether that Trusted Component is installed (or minimally, is running) in a TEE that the TEEP Agent is associated with. πŸ”

Each Trusted Component is digitally signed, which protects its integrity and links it back to the Trusted Component Signer. The Trusted Component Signer is often the Trusted Component Developer, but in some cases it might be another party, like a Device Administrator or someone else the code has been licensed to. (In that case, the same code might get signed by multiple licensees and distributed as if it were different TAs.) Wild, right? πŸ™ˆ

A Trusted Component Signer picks one or more TAMs and communicates the Trusted Component(s) to the TAM. For example, the Trusted Component Signer might choose TAMs based on the markets the TAM can provide access to. There may be TAMs that serve specific types of devices, device operating systems, specific geographical regions, or network carriers. A Trusted Component Signer may be motivated to use multiple TAMs in order to maximize market penetration and availability across multiple types of devices, so the same Trusted Component will often be available through multiple TAMs. 🌈

When the developer of an Untrusted Application that depends on a Trusted Component publishes it to an app store or other app repository, the developer optionally binds the Untrusted Application to a manifest. That manifest identifies which TAMs can be contacted for the Trusted Component. In some situations, a Trusted Component may only be available through a single TAM. This is likely the case for enterprise applications or for Trusted Component Signers serving a closed community. For broad public apps, there will likely be multiple TAMs in the Untrusted Application's manifest, such as one serving one brand of mobile device and another serving a different manufacturer. Different devices and manufacturers trust different TAMs, so the manifest can include multiple TAMs that support the required Trusted Component. πŸ’–

When a TEEP Broker receives a request (see the RequestTA API in Section 6.2.1) from an Untrusted Application to install a Trusted Component, a list of TAM URIs may be provided for that Trusted Component, and the request is passed to the TEEP Agent. If the TEEP Agent decides that the Trusted Component needs to be installed, it selects a single TAM URI that is consistent with the list of trusted TAMs provisioned in the TEEP Agent. Then it invokes the HTTP transport for TEEP to connect to the TAM URI and begins a TEEP protocol exchange. When the TEEP Agent later receives the Trusted Component to install, and the Trusted Component's manifest indicates dependencies on any other Trusted Components, each dependency can include a list of TAM URIs for the relevant dependency. If any of those dependencies are prerequisites to install the Trusted Component, the TEEP Agent recursively follows the same procedure for each dependency that needs to be installed or updated. That includes selecting a TAM URI that is consistent with the list of trusted TAMs provisioned on the device and beginning a TEEP exchange. If multiple TAM URIs are considered trusted, only one needs to be contacted, and they can be attempted in some order until one responds. πŸ”

Separate from the Untrusted Application's manifest, this framework relies on the use of the manifest format in [SUIT-MANIFEST] for expressing how to install a Trusted Component, as well as any dependencies on other TEE components and versions. In other words, dependencies from Trusted Components on other Trusted Components can be expressed in a Software Update for the Internet of Things (SUIT) manifest. That includes dependencies on any other TAs, trusted OS code (if any), or trusted firmware. Installation steps can also be expressed in a SUIT manifest. 🧚

For example, TEEs compliant with GlobalPlatform [GPTEE] may have a notion of a "security domain" (a grouping of one or more TAs installed on a device that can share information within that group). A security domain may need to be created first, and then one or more TAs can be installed into it. So it's up to the SUIT manifest to express a dependency on a security domain already existing or being created first, as appropriate. πŸŽ€

Updating a Trusted Component may cause compatibility issues with any Untrusted Applications or other components that depend on the updated Trusted Component. It's just like how updating the OS or a shared library could impact an Untrusted Application. So an implementation needs to take such issues into account. ⚠️


4.4. Untrusted Apps, Trusted Apps, and Personalization Data

In TEEP, there is an explicit relationship and dependence between an Untrusted Application in an REE and one or more TAs in a TEE, as shown in Figure 2. For most purposes, an Untrusted Application that uses one or more TAs in a TEE looks no different from any other Untrusted Application in the REE. 🫢 However, the way the Untrusted Application and its corresponding TAs are packaged, delivered, and installed on the device can vary. The variations depend on whether the Untrusted Application and TA are bundled together or provided separately, and this affects how the TAs get managed in a TEE. Besides the Untrusted Application and TA(s), the TA(s) and/or TEE may also need additional data to personalize the TA to the device or a user. Implementations of the TEEP protocol must support encryption to preserve the confidentiality of such Personalization Data, which may potentially contain sensitive data. The encryption is used to ensure that no personalization data is sent in the clear. Implementations must also support mechanisms for integrity protection of such Personalization Data. Other than the requirement to support confidentiality and integrity protection, the TEEP architecture places no limitations or requirements on the Personalization Data. πŸ”

There are multiple possible cases for bundling an Untrusted Application, TA(s), and Personalization Data. Such cases include (possibly among others):

  1. The Untrusted Application, TA(s), and Personalization Data are all bundled together in a single package by a Trusted Component Signer. That package is either provided to the TEEP Broker through the TAM or provided separately (with encrypted Personalization Data), with the key material needed to decrypt and install the Personalization Data and TA provided by a TAM.
  2. The Untrusted Application and the TA(s) are bundled together in a single package, which a TAM or a publicly accessible app store maintains. The Personalization Data is separately provided by the Personalization Data provider's TAM.
  3. All components are independent packages. The Untrusted Application is installed through some independent or device-specific mechanism, and one or more TAMs provide (directly or indirectly by reference) the TA(s) and Personalization Data.
  4. The TA(s) and Personalization Data are bundled together into a package provided by a TAM, while the Untrusted Application is installed through some independent or device-specific mechanism, such as an app store.
  5. Encrypted Personalization Data is bundled into a package distributed with the Untrusted Application, while the TA(s) and the key material needed to decrypt and install the Personalization Data are in a separate package provided by a TAM. The Personalization Data is encrypted with a key unique to that specific TEE, as discussed in Section 5.

The TEEP protocol can treat each TA, any dependencies the TA has, and the Personalization Data as separate Trusted Components with separate installation steps. Those steps are expressed in SUIT manifests, and a SUIT manifest might contain or reference multiple binaries (see [SUIT-MANIFEST] for more details). The TEEP Agent is responsible for handling any installation steps that need to be performed inside the TEE, such as decrypting private TA binaries or Personalization Data. 🧩

To understand these cases better, it helps to look at actual implementations of TEEs and their application delivery mechanisms. πŸ‘€

4.4.1. Example: Application Delivery Mechanisms in Intel SGX

In Intel Software Guard Extensions (SGX), the Untrusted Application and TA are typically bundled into the same package (Case 2). The TA exists in the package as a shared library (.so or .dll). The Untrusted Application loads the TA into an SGX enclave when it needs the TA. This organization makes it easy to maintain compatibility between the Untrusted Application and the TA, since they are updated together. πŸ’œ It is entirely possible to create an Untrusted Application that loads an external TA into an SGX enclave and uses that TA (Cases 3-5). In this case, the Untrusted Application would require a reference to an external file, or it would download such a file dynamically, place the contents of the file into memory, and load that as a TA. Obviously, such a file or downloaded content must be properly formatted and signed for it to be accepted by the SGX TEE.

Obviously, an external file or downloaded content has to be properly formatted and signed, or the SGX TEE won't accept it. Don't skip this part, bestie! 🚨

In SGX, any Personalization Data is normally loaded into the SGX enclave (the TA) after the TA has started. Although it is possible with SGX to include the Untrusted Application in an encrypted package along with Personalization Data (Cases 1 and 5), there are currently no known instances of this in use. That's because such a construction would require a special installation program and an SGX TA (which might or might not be the TEEP Agent itself, depending on the implementation) to receive the encrypted package, decrypt it, separate it into the different elements, and then install each one. This installation is complex because the Untrusted Application, once decrypted inside the TEE, must be passed out of the TEE to an installer in the REE that would install the Untrusted Application. Finally, the Personalization Data would need to be sent out of the TEE (encrypted in an SGX enclave-to-enclave manner) to the REE's installation app. That app would pass this data to the installed Untrusted Application, which would in turn send this data to the SGX enclave (TA). The complexity comes from the fact that each SGX enclave is separate and does not have direct communication with other SGX enclaves. 😭

As long as signed files (TAs and/or Personalization Data) are installed into an untrusted filesystem and trust is verified by the TEE at load time, classic distribution mechanisms can be used. βœ… However, some uses of SGX allow a model where a TA can be dynamically installed into an SGX enclave that provides a runtime platform. The TEEP protocol can be used in such cases, where the runtime platform could include a TEEP Agent. 🌸

4.4.2. Example: Application Delivery Mechanisms in Arm TrustZone ✨

okay so in Arm TrustZone [TrustZone] for A-class devices πŸ¦‹, the Untrusted Application and the TA may or may not be bundled together. this is different from SGX bc in TrustZone, the TA lifetime is not inherently tied to a specific Untrusted Application process lifetime the way it is in SGX πŸ’…. a TA gets loaded by a trusted OS running in the TEE, like a TEE compliant with GlobalPlatform [GPTEE], and that trusted OS is separate from the OS in the REE. so Cases 2-4 are equally applicable 🌸. plus, TAs can talk to each other without involving any Untrusted Application at all 🫢, so the complexity of Cases 1 and 5 is lower than in the SGX example, though still more complex than Cases 2-4 πŸ™ˆ.

a trusted OS running in the TEE (e.g., OP-TEE [OP-TEE]) that supports loading and verifying signed TAs from an untrusted filesystem can, like SGX, use classic file distribution mechanisms πŸ“. if secure TA storage is used (e.g., a Replay-Protected Memory Block device) on the other hand, the TEEP protocol can be used to manage that storage 🌈.

4.5. Entity Relations 🧚

this architecture leverages asymmetric cryptography to authenticate a device to a TAM πŸ”‘. on top of that, a TEEP Agent in a device authenticates a TAM. the provisioning of Trust Anchors to a device may be different from one use case to the other πŸŽ€. a Device Administrator may want the capability to control what TAs are allowed πŸ‘‘. a device manufacturer enables verification by one or more TAMs and by Trusted Component Signers, and it may embed a list of default Trust Anchors into the TEEP Agent and TEE for TAM trust verification and TA signature verification πŸ’œ.

 (App Developers)   (App Store)   (TAM)      (Device with TEE)  (CAs)
        |                   |       |                |            |
        |                   |       |      (Embedded TEE cert) <--|
        |                   |       |                |            |
        | <--- Get an app cert -----------------------------------|
        |                   |       |                |            |
        |                   |       | <-- Get a TAM cert ---------|
        |                   |       |                |            |
1. Build two apps:          |       |                |            |
                            |       |                |            |
   (a) Untrusted            |       |                |            |
       App - 2a. Supply --> |       |                |            |
                            |       |                |            |
   (b) TA -- 2b. Supply ----------> |                |            |
                            |       |                |            |
                            | --- 3. Install ------> |            |
                            |       |                |            |
                            |       | 4. Messaging-->|            |

                Figure 3: Example Developer Experience

Figure 3 shows an example where the same developer builds and signs two applications: (a) an Untrusted Application and (b) a TA that provides some security functions to be run inside a TEE ✨. this example assumes that the developer, the TEE, and the TAM have previously been provisioned with certificates πŸ“œ.

At step 1, the developer authors the two applications πŸ’».

At step 2, the developer uploads the Untrusted Application (2a) to an Application Store πŸ›οΈ. in this example, the developer is also the Trusted Component Signer and thus generates a signed TA πŸ–‹οΈ. the developer can then either bundle the signed TA with the Untrusted Application, or provide a signed Trusted Component containing the TA to a TAM that will be managing the TA in various devices πŸ¦‹.

At step 3, a user will go to an Application Store to download the Untrusted Application (where the arrow indicates the direction of data transfer) πŸ“².

At step 4, since the Untrusted Application depends on the TA, installing the Untrusted Application will trigger TA installation via communication with a TAM πŸ”₯. the TEEP Agent will interact with the TAM via a TEEP Broker that facilitates communications between the TAM and the TEEP Agent 🀝.

some implementations that install Trusted Components might ask for a user's consent πŸ™‹. in other implementations, a Device Administrator might choose the Untrusted Applications and related Trusted Components to be installed πŸ‘‘. a user consent flow is out of scope of the TEEP architecture 🚫.

the main components of the TEEP protocol consist of a set of standard messages created by a TAM to deliver Trusted Component management commands to a device, and device attestation and response messages created by a TEE that responds to a TAM's message πŸ’–.

it should be noted that network communication capability is generally not available in TAs in today's TEE-powered devices πŸ“‘. consequently, Trusted Applications generally rely on a Broker in the REE to provide access to network functionality in the REE. a Broker does not need to know the actual content of messages to facilitate such access 🫣.

similarly, since the TEEP Agent runs inside a TEE, the TEEP Agent generally relies on a TEEP Broker in the REE to provide network access, relay TAM requests to the TEEP Agent, and relay the responses back to the TAM πŸ’Œ.

5. Keys and Certificate Types ✨

this architecture leverages the following credentials, which allow achieving end-to-end security between a TAM and a TEEP Agent πŸ”.

Table 1 summarizes the relationships between various keys and where they are stored πŸ—‚οΈ. each public/private key identifies a Trusted Component Signer, TAM, or TEE, and gets a certificate that chains up to some Trust Anchor. a list of trusted certificates is used to check a presented certificate against 🧾.

different CAs can be used for different types of certificates 🏷️. TEEP messages are always signed, where the signer key is the message originator's private key, such as that of a TAM or a TEE ✍️. in addition to the keys shown in Table 1, there may be additional keys used for attestation or encryption. Refer to the RATS Architecture [RFC9334] for more discussion πŸ“š.

    +================+===============+===========+==============+
    | Purpose        | Cardinality & | Private   | Location of  |
    |                | Location of   | Key Signs | Trust Anchor |
    |                | Private Key   |           | Store        |
    +================+===============+===========+==============+
    | Authenticating | 1 per TEE     | TEEP      | TAM          |
    | TEEP Agent     |               | responses |              |
    +----------------+---------------+-----------+--------------+
    | Authenticating | 1 per TAM     | TEEP      | TEEP Agent   |
    | TAM            |               | requests  |              |
    +----------------+---------------+-----------+--------------+
    | Code Signing   | 1 per Trusted | TA binary | TEE          |
    |                | Component     |           |              |
    |                | Signer        |           |              |
    +----------------+---------------+-----------+--------------+

                       Table 1: Signature Keys

note that Personalization Data is not included in the table above πŸ™ˆ. the use of Personalization Data is dependent on how TAs are used and what their security requirements are πŸ’….

TEEP requests from a TAM to a TEEP Agent are signed with the TAM private key (for authentication and integrity protection) πŸ›‘οΈ. Personalization Data and TA binaries can be encrypted with a key unique to that specific TEE πŸ”’. conversely, TEEP responses from a TEEP Agent to a TAM can be signed with the TEE private key ✨.

the TEE key pair and certificate are thus used for authenticating the TEE to a remote TAM and for sending private data to the TEE 🫢. often, the key pair is burned into the TEE by the TEE manufacturer, and the key pair and its certificate are valid for the expected lifetime of the TEE πŸ”₯. a TAM provider is responsible for configuring the TAM's Trust Anchor Store with the manufacturer certificates or CAs that are used to sign TEE keys. this is discussed further in Section 5.3 πŸ“–. typically, the same TEE key pair is used for both signing and encryption, though separate key pairs might also be used in the future, as the joint security of encryption and signature with a single key remains, to some extent, an open question in academic cryptography πŸ€“.

the TAM key pair and certificate are used for authenticating a TAM to a remote TEE and for sending private data to the TAM (separate key pairs for authentication vs. encryption could also be used in the future) πŸ¦‹. a TAM provider is responsible for acquiring a certificate from a CA that is trusted by the TEEs it manages. this is discussed further in Section 5.1 πŸ’œ.

the Trusted Component Signer key pair and certificate are used to sign Trusted Components that the TEE will consider authorized to execute πŸŽ€. TEEs must be configured with the certificates or keys that they consider authorized to sign TAs that they will execute. this is discussed further in Section 5.2 πŸ‘‘.

5.1. Trust Anchors in a TEEP Agent

a TEEP Agent's Trust Anchor Store contains a list of Trust Anchors, which are typically CA certificates that sign various TAM certificates 🧁. the list is usually preloaded at manufacturing time and can be updated using the TEEP protocol if the TEE has some form of "Trust Anchor Manager TA" that has Trust Anchors in its configuration data πŸ› οΈ. thus, Trust Anchors can be updated similarly to the Personalization Data for any other TA 🌸.

when a Trust Anchor update is carried out, it is imperative that any update must maintain integrity, where only an authentic Trust Anchor list from a device manufacturer or a Device Administrator is accepted 🚨. details are out of scope of this architecture document and can be addressed in a protocol document πŸ“.

before a TAM can begin operation in the marketplace to support a device with a particular TEE, it must be able to get its raw public key, its certificate, or a certificate it chains up to, listed in the Trust Anchor Store of the TEEP Agent 🏁.

5.2. Trust Anchors in a TEE

the Trust Anchor Store in a TEE contains a list of Trust Anchors (raw public keys or certificates) that are used to determine whether TA binaries are allowed to execute by checking if their signatures can be verified πŸ”. the list is typically preloaded at manufacturing time and can be updated using the TEEP protocol if the TEE has some form of "Trust Anchor Manager TA" that has Trust Anchors in its configuration data ⭐. thus, Trust Anchors can be updated similarly to the Personalization Data for any other TA, as discussed in Section 5.1 πŸŽ€.

5.3. Trust Anchors in a TAM

the Trust Anchor Store in a TAM consists of a list of Trust Anchors, which are certificates that sign various device TEE certificates 🧾. a TAM will accept a device for Trusted Component management if the TEE in the device uses a TEE certificate that is chained to a certificate or raw public key that the TAM trusts, is contained in an allow list, is not found on a block list, and/or fulfills any other policy criteria 🫢.

5.4. Scalability ✨

okay bestie, this is the part where the whole architecture gets to show off πŸ’… It uses a PKI (including self-signed certificates πŸŽ€). Trust Anchors live on the devices so the TEEP Agent can authenticate TAMs, the TEE can authenticate Trusted Component Signers, and TAMs use Trust Anchors to authenticate TEEP Agents.

When a PKI is in play, loads of intermediate CA certificates can chain up to one root certificate, and each of those can issue many certificates of its own 🌸 That's what makes the protocol highly scalable, literally iconic.

New factories that produce TEEs can join the ecosystem too ✨ A factory just gets an intermediate CA certificate from one of the existing roots, and the TAMs don't need to be updated with info about that new device factory. No drama.

New TAMs can join the party as well, as long as they're issued a TAM certificate that chains to an existing root πŸ¦‹ Then the TAs already in the TEE can be personalized by that TAM without any changes to the TEE itself. Main character energy for the whole ecosystem.

So the ecosystem scales and nobody has to maintain centralized databases of all the TEEs produced, all the TAMs that exist, or all the Trusted Component Signers that exist πŸ™…β€β™€οΈ fr fr, that's the vibe.

5.5. Message Security πŸ”

Messages created by a TAM deliver Trusted Component management commands to a device πŸ“¦ Meanwhile, the device TEE creates device attestation and messages to respond to those TAM messages.

These messages are signed end-to-end between a TEEP Agent and a TAM πŸ’œ Confidentiality comes from encrypting the sensitive payloads (like Personalization Data and attestation evidence), not from encrypting the messages themselves. Encrypting the payloads is important so that only the targeted device TEE or TAM can decrypt and view the actual content. Iykyk, privacy is the flex πŸ‘‘

6. TEEP Broker 🧚

A TEE and its TAs often just can't communicate directly outside the hosting device πŸ™ˆ For example, GlobalPlatform [GPTEE] specifies one such architecture. That calls for a software module in the REE world to handle the network communication with a TAM.

A TEEP Broker is an application component running in the REE of the device, or an SDK, that facilitates communication between a TAM and a TEE 🌈 It also gives Untrusted Applications interfaces to query and trigger installation of the Trusted Components they need.

An Untrusted Application might talk to a TEEP Broker at runtime to trigger Trusted Component installation itself πŸ’– Or it might simply have a metadata file that describes the Trusted Components it depends on and the associated TAM(s) for each one. An REE Application Installer can read that metadata file and invoke the TEEP Broker to trigger Trusted Component installation on behalf of the Untrusted Application, without the app needing to run first. Lowkey genius.

6.1. Role of the TEEP Broker

A TEEP Broker works with a TEEP Agent inside a TEE, relaying messages between the TEEP Agent and the TAM, and it may also interact with one or more Untrusted Applications (see Section 6.2.1) ✨ The Broker can't parse the encrypted TEEP messages exchanged between a TAM and a TEEP Agent. It just relays them, no peeking πŸ™ˆ

When a device has more than one TEE, there could be one TEEP Broker per TEE in the REE πŸ“ Or a common TEEP Broker could serve multiple TEEs, as long as the transport protocol (e.g., [TEEP-HTTP]) lets the TEEP Broker tell which TEE is relevant for each message from a TAM. Very organized, very slay.

The Broker only needs to send an error message back to the TAM if the TEE isn't reachable for some reason πŸ¦‹ Other errors come back as TEEP response messages from the TEE, and those get passed along to the TAM.

6.2. TEEP Broker Implementation Consideration πŸŽ€

As shown in Figure 4, there are multiple ways a TEEP Broker can be implemented, with more or fewer layers living inside the TEE. For example, in model A (the one with the smallest TEE footprint), only the TEEP implementation is inside the TEE, while the TEEP/HTTP implementation sits in the TEEP Broker outside the TEE.

                  Model:    A      B      C

                           TEE    TEE    TEE
   +----------------+       |      |      |
   |      TEEP      |  Agent |      |      | Agent
   | implementation |       |      |      |
   +----------------+       v      |      |
            |                      |      |
   +----------------+       ^      |      |
   |    TEEP/HTTP   |  Broker |      |      |
   | implementation |       |      |      |
   +----------------+       |      v      |
            |               |             |
   +----------------+       |      ^      |
   |     HTTP(S)    |       |      |      |
   | implementation |       |      |      |
   +----------------+       |      |      v
            |               |      |
   +----------------+       |      |      ^
   |   TCP or QUIC  |       |      |      | Broker
   | implementation |       |      |      |
   +----------------+       |      |      |
                           REE    REE    REE

                    Figure 4: TEEP Broker Models

In other models, additional layers are moved into the TEE, which increases the TEE footprint, with the Broker either containing or calling the topmost protocol layer outside of the TEE 🧚 An implementation is free to pick any of these models, so choose your fighter πŸ’…

TEEP Broker implementers should consider methods of distribution, scope, and concurrency on devices, plus runtime options 🌸

6.2.1. TEEP Broker APIs

The following conceptual APIs exist from a TEEP Broker to a TEEP Agent πŸ’œ

  1. RequestTA: A notification from an REE application (e.g., an installer or an Untrusted Application) that the application depends on a given Trusted Component, which may or may not already be installed in the TEE.
  2. UnrequestTA: A notification from an REE application (e.g., an installer or an Untrusted Application) that the application no longer depends on a given Trusted Component, which may or may not already be installed in the TEE. For example, if the Untrusted Application is uninstalled, the uninstaller might invoke this conceptual API.
  3. ProcessTeepMessage: A message arriving from the network, to be delivered to the TEEP Agent for processing.
  4. RequestPolicyCheck: A hint (e.g., based on a timer) that the TEEP Agent may wish to contact the TAM for any changes, without the device itself needing any particular change.
  5. ProcessError: A notification that the TEEP Broker could not deliver an outbound TEEP message to a TAM.

For comparison, similar APIs may exist on the TAM side, where a Broker may or may not exist, depending on whether the TAM uses a TEE or not πŸ‘‘

  1. ProcessConnect: A notification that a new TEEP session is being requested by a TEEP Agent.
  2. ProcessTeepMessage: A message arriving at an existing TEEP session, to be delivered to the TAM for processing.

For further discussion on these APIs, see [TEEP-HTTP] πŸ¦‹

6.2.2. TEEP Broker Distribution

The Broker installation is commonly carried out at device manufacturing time 🏭 A user may also dynamically download and install a Broker on demand πŸ“²

7. Attestation ✨

Okay bestie, attestation is when one entity (an Attester) shows up with "evidence", which is a bundle of claims, and basically says "trust me, these are true" to another entity (a Verifier), with enough proof to back it up πŸ’…. Different Verifiers might want different levels of confidence, and not every attestation is good enough for every Verifier πŸ₯Ή. Then a third entity (a Relying Party) can read the "attestation results" (another set of claims, this time from a Verifier) and make authorization decisions πŸ”₯. (See [RFC9334] for more tea.)

In TEEP, as shown in Figure 5, the big goal of attestation is letting a device (the Attester) prove to a TAM (the Relying Party) that a TEE in the device has particular properties, was built by a particular manufacturer, and/or is running a particular TA πŸŽ€. Other claims are possible too. TEEP doesn't limit which claims can show up in evidence or attestation results, but it does define a minimal set of attestation result claims that TEEP needs to work properly 🫢. You can extend those claims, and other standards or groups can define the format and meaning of extended claims 🌈.

   +----------------+
   | Device         |            +----------+
   | +------------+ |  Evidence  |   TAM    |   Evidence    +----------+
   | |     TEE    |------------->| (Relying |-------------->| Verifier |
   | | (Attester) | |            |  Party)  |<--------------|          |
   | +------------+ |            +----------+  Attestation  +----------+
   +----------------+                             Result

                      Figure 5: TEEP Attestation Roles

At the time of writing, device and TEE attestations haven't been standardized across the market, which is very much a "it's complicated" situation πŸ’€. Different devices, manufacturers, and TEEs support different attestation protocols. So for TEEP to be inclusive, it doesn't care what format the evidence is in. Proprietary or standardized formats are both fine between a TEE and a Verifier (who may or may not be colocated in the TAM), as long as the format supports encrypting anything that's considered sensitive πŸ”.

That said, not every Verifier is going to be able to process every proprietary form of attestation evidence, so keep that in mind πŸ‘€. TEEP is also agnostic about the format of attestation results and about the protocol (if any) used between the TAM and a Verifier. The only requirement is that they convey at least the required set of claims in some format. And the attestation algorithms themselves aren't defined in the TEEP protocol, so check [RFC9334] and [TEEP] for more discussion πŸ“š.

When appraising evidence from a TEE, here's what to think about:

  • What security measures a manufacturer takes when provisioning keys into devices/TEEs;
  • What hardware and software components have access to the attestation keys of the TEE;
  • The source or local verification of claims within an attestation prior to a TEE signing a set of claims;
  • The level of protection afforded to attestation keys against exfiltration, modification, and side channel attacks;
  • The limitations of use applied to TEE attestation keys;
  • The processes in place to discover or detect TEE breaches; and
  • The revocation and recovery process of TEE attestation keys.

Some TAMs may need additional claims before they can properly authorize a device or TEE 🧐. The specific format for these additional claims is outside the scope of this specification, but the TEEP protocol lets these additional claims be included in the attestation messages πŸ’–.

For more on the attestation and appraisal process, the RATS Architecture [RFC9334] is the place to go πŸ¦‹.

The following information is required for TEEP attestation:

  • Device Identifying Information: Attestation information may need to uniquely identify a device to the TAM. Unique device identification lets the TAM provide services to the device, like managing installed TAs, providing subscriptions to services, and locating device-specific keying material to communicate with or authenticate the device πŸ”‘. In some use cases, it may be enough to identify only the model or class of the device. For example, a DAA Issuer's group public key ID when the attestation uses DAA; see [RATS-DAA]. Another example of models is the hwmodel (Hardware Model) as defined in [EAT]. The security and privacy requirements around device identification will vary depending on the type of TA provisioned to the TEE πŸ™ˆ.
  • TEE Identifying Information: The type of TEE that generated this attestation must be identified. This includes version identification information for the hardware, firmware, and software version of the TEE, as applicable by the TEE type πŸ› οΈ. TEE manufacturer information is required so the same TEE type made by different manufacturers can be told apart, and so considerations around manufacturer provisioning, keying, and support for the TEE can be addressed πŸ“.
  • Freshness Proof: A claim that includes freshness information must be included, such as a nonce or timestamp ⏰.

8. Algorithm and Attestation Agility

[RFC7696] outlines the requirements for migrating from one mandatory-to-implement cryptographic algorithm suite to another over time πŸ”„. This feature is also known as "crypto agility". Protocol evolution gets way easier when crypto agility is considered during the design of the protocol 🧚. For TEEP, the diverse range of use cases (from trusted app updates for smartphones and tablets to code updates on higher-end IoT devices) creates the need for different mandatory-to-implement algorithms from the start 🌸.

Crypto agility in TEEP covers both symmetric and asymmetric algorithms πŸ”. In the context of TEEP, symmetric algorithms are used for encryption and integrity protection of TA binaries and Personalization Data, while asymmetric algorithms are used for signing messages and managing symmetric keys πŸ’œ.

On top of the cryptographic algorithms, TEEP also needs different attestation technologies. A device must provide techniques to inform a TAM about the attestation technology it supports πŸ“£. In lots of deployments, the TAM is more likely to support one or more attestation techniques, while the device may only support one πŸ€“.


9. Security Considerations 🚨

Okay, this section is serious business, so let's get into it 😭.

9.1. Broker Trust Model

The architecture lets the TAM talk, through a TEEP Broker, to the device's TEE so it can manage Trusted Components 🀝. But the TEEP Broker runs in a potentially vulnerable REE, which means it could be malware or be infected by malware 😱. So all TAM messages are signed and sensitive data is encrypted, so the TEEP Broker can't modify or capture sensitive data. The TEEP Broker can still carry out DoS attacks, though, as discussed in Section 9.3 πŸ’€.

A TEEP Agent in a TEE is responsible for protecting itself against potential attacks from a compromised TEEP Broker or rogue malware in the REE πŸ›‘οΈ. A rogue TEEP Broker might send corrupted data to the TEEP Agent, launch a DoS attack by flooding it with TEEP protocol requests, or simply drop or delay notifications to a TEE πŸ™…β€β™€οΈ. The TEEP Agent validates the signature of each TEEP protocol request and checks the signing certificate against its Trust Anchors βœ…. To mitigate DoS attacks, it might also add some protection scheme, such as a threshold on repeated requests or on the number of TAs that can be installed 🚧.

Because there's no better alternative available, some implementations might rely on an untrusted timer or other event to call the RequestPolicyCheck API (Section 6.2.1). That means a compromised REE can stop a TEE from receiving policy changes, so the TEE can end up out of date with respect to policy 😬. Any other manipulator-in-the-middle can do the same just by blocking communication with a TAM πŸ•΅οΈ. Ultimately, that kind of outdated compliance could be addressed by using attestation in secure communication. The attestation evidence reveals what state the TEE is in, so communication from an out-of-compliance TEE (other than remediation, such as via TEEP) can be rejected 🚫.

Similarly, in most implementations, the REE is involved in the mechanics of installing new TAs πŸ› οΈ. However, the authority over which TAs run in a given TEE sits between the TEEP Agent and the TAM πŸ‘‘. A TEEP Broker can, in effect, make suggestions, as discussed in Section 6.2.1, but it can't decide or enforce what runs where πŸ™ƒ. The TEEP Broker can also control which TEE a given installation request is directed at, but a TEEP Agent will only accept TAs that are actually applicable to it and where the installation instructions are received from a TAM that it trusts πŸ’….

The authorization model for the UnrequestTA operation is, however, weaker. It expresses the removal of a dependency from an application that was untrusted to begin with πŸ₯΄. This means a compromised REE could remove a valid dependency from an Untrusted Application on a TA. Normal REE security mechanisms should be used to protect the REE and Untrusted Applications πŸ”’.

9.2. Data Protection

It's the TAM's responsibility to protect data on its servers 🏰. Similarly, it's the responsibility of the TEE implementation to protect data against integrity and confidentiality attacks from outside the TEE 🫑. TEEs that isolate TAs from each other within the TEE are likewise responsible for protecting TA data against the REE and other TAs. For example, this can be used to protect the data of one user or tenant from being compromised by another user or tenant, even if the attacker has TAs 🦹.

The protocol between TEEP Agents and TAMs is similarly responsible for providing integrity and confidentiality protection against adversaries between them πŸ›‘οΈ. Choosing the layers at which to best protect against network adversaries is a design choice 🧩. As discussed in Section 6, the transport protocol and any security mechanism associated with it (e.g., the Transport Layer Security protocol) under the TEEP protocol may terminate outside a TEE 🌐. If it does, the TEEP protocol itself must provide integrity and confidentiality protection to secure data end-to-end πŸ”. For example, confidentiality protection for payloads may be provided by using encrypted TA binaries and encrypted attestation information πŸ”. See [TEEP] for how a specific solution addresses the design question of how to provide integrity and confidentiality protection πŸŽ€.

9.3. Compromised REE πŸ’€

okay so, it's possible that the REE on a device gets compromised 😭. We've already seen attacks on the public Internet where a bunch of compromised devices get used to mount DDoS attacks, which is so messy. A compromised REE can be used for that kind of attack, but it cannot tamper with the TEE's code or data while doing it πŸ”’. A compromised REE can, however, launch DoS attacks against the TEE πŸ™ˆ.

The compromised REE might terminate the TEEP Broker so TEEP transactions can't reach the TEE, or it might drop, replay, or delay messages between a TAM and a TEEP Agent πŸ’…. A DoS attack can't be prevented, but the REE can't access anything in the TEE if the TEE is implemented correctly ✨. Some TEEs may have a watchdog scheme to observe REE state and mitigate DoS attacks against it, but most TEEs don't have that capability πŸ₯².

In some other scenarios, the compromised REE may ask a TEEP Broker to make repeated requests to a TEEP Agent in a TEE to install or uninstall a Trusted Component πŸ”. An installation or uninstallation request built by the TEEP Broker or REE will be rejected by the TEEP Agent, because it won't have the correct signature from a TAM to pass request signature validation πŸ›‘οΈ.

This can turn into a DoS attack by exhausting resources in a TEE with repeated requests 😩. In general, a DoS threat exists when the REE is compromised, and a DoS attack can happen to other resources. The TEEP architecture doesn't change this πŸ€·β€β™€οΈ.

A compromised REE might also request starting the full installation flow for Trusted Components that aren't necessary πŸ™„. It may also repeat a prior legitimate Trusted Component installation request. A TEEP Agent implementation is responsible for making sure it can recognize and decline such repeated requests, and it's also responsible for protecting the resource usage allocated for Trusted Component management πŸ‘‘.

9.4. CA Compromise or Expiry of CA Certificate πŸ₯€

A root CA for TAM certificates might get compromised, its certificate might expire, or a Trust Anchor other than a root CA certificate may also expire or be compromised 😱. TEEs are responsible for validating the entire TAM certification path, including the TAM certificate and any intermediate certificates up to the root certificate. Check Section 6 of [RFC5280] for details πŸ“–. That validation usually includes checking for certificate revocation, but certificate status check protocols may not scale down to constrained devices that use TEEP πŸͺ«.

To handle the above, a certification path update mechanism is expected from TAM operators, so the TAM can get a new certification path that a TEEP Agent can validate βœ…. The Trust Anchor in the TEEP Agent's Trust Anchor Store may also need updating. For that, a TEE Trust Anchor update mechanism is expected from device equipment manufacturers (OEMs), such as using the TEEP protocol to distribute new Trust Anchors 🌸.

Similarly, a root CA for TEE certificates might get compromised, its certificate might expire, or a Trust Anchor other than a root CA certificate may also expire or be compromised. TAMs are responsible for validating the entire TEE certification path, including the TEE certificate and any intermediate certificates up to the root certificate. That validation includes checking for certificate revocation.

If TEE certification path validation fails, the TEE might be rejected by a TAM, depending on the TAM's policy 🚫. To fix that, a certification path update mechanism is expected from device OEMs, so the TEE can get a new certification path that a TAM can validate. The Trust Anchor in the TAM's Trust Anchor Store may also need updating πŸ”„.

9.5. Compromised TAM πŸ‘Ή

Device TEEs are responsible for validating the supplied TAM certificates. A compromised TAM can bring multiple threats and damage to the user devices it manages, and therefore to the Device Owners πŸ’”. Information on devices the TAM manages may leak to a bad actor. A compromised TAM can also install lots of TAs to launch a DoS attack on devices, for example by filling up a device's TEE resources reserved for TAs, so other TAs can't get the resources to be installed or function properly πŸ—‘οΈ. It may also install malicious TAs on potentially many devices, under the condition that it also has a Trusted Component signer key trusted by the TEEs. This makes TAMs high-value targets 🎯.

A TAM could be compromised without impacting its certificate or raising concern from the TAM's operator 😢.

To mitigate this threat, TEEP Agents and Device Owners have several options for detecting and mitigating a compromised TAM, including but potentially not limited to the following:

  1. Apply an ACL to the TAM key, limiting which Trusted Components the TAM is allowed to install or update.
  2. Use a transparency log to expose a TAM compromise. TAMs publish an out-of-band record of Trusted Component releases, so a TEE can cross-check the Trusted Components delivered against the Trusted Components installed to detect a TAM compromise πŸ•΅οΈβ€β™€οΈ.
  3. Use remote attestation of the TAM to prove trustworthiness πŸͺͺ.

9.6. Malicious TA Removal πŸ—‘οΈ

It's possible a rogue developer distributes a malicious Untrusted Application and wants a malicious TA installed 😈. Such a TA might be able to dodge malware detection by the REE, or get at trusted resources inside the TEE. It couldn't reach other TEEs or other TAs, though, if the TEE provides isolation between TAs 🧱.

It's the TAM's job to not install malicious TAs in the first place πŸ™…β€β™€οΈ. The TEEP architecture lets a TEEP Agent decide which TAMs it trusts via Trust Anchors, and delegate the TA authenticity check to the TAMs it trusts 🀝.

A TA that was once considered trustworthy may later turn out to be buggy or compromised πŸ›. In this case, the TAM can initiate the removal of the TA by notifying devices to remove it (and potentially notify the REE or Device Owner to remove any Untrusted Application that depends on the TA) 🧹. If the TAM doesn't currently have a connection to the TEEP Agent on a device, the notification happens the next time connectivity does exist. So to recover, the TEEP Agent must be able to reach out to the TAM, for example whenever the RequestPolicyCheck API (Section 6.2.1) is invoked by a timer or other event ⏰.

Furthermore, the policy in the Verifier in an attestation process can be updated so that any evidence that includes the malicious TA results in an attestation failure. There is, however, a time window during which a malicious TA might still operate successfully: the validity time of the previous attestation result πŸ•°οΈ. For example, if the Verifier in Figure 5 is updated to treat a previously valid TA as no longer trustworthy, any attestation result it previously generated saying that the TA is valid will continue to be used until that result expires. As such, the TAM's Verifier should take the acceptable time window into account when generating attestation results 🧠. See [RFC9334] for further discussion πŸ“š.

9.7. TEE Certificate Expiry and Renewal πŸ“…

TEE device certificates are expected to be long-lived, longer than the lifetime of a device 🌈. A TAM certificate usually has a moderate lifetime of 1 to 5 years. A TAM should get renewed or rekeyed certificates. The root CA certificates for a TAM, which are embedded into the Trust Anchor Store in a device, should have long lifetimes that don't require device Trust Anchor updates. On the other hand, it is imperative that OEMs or device providers plan for support of a Trust Anchor update in their shipped devices 🚒.

For those cases where TEE devices are given certificates for which no good expiration date can be assigned, the recommendations in Section 4.1.2.5 of [RFC5280] are applicable πŸ“œ.

9.8. Keeping Secrets from the TAM 🀫

In some scenarios, it's desirable to protect the TA binary or Personalization Data from being disclosed to the TAM that distributes them πŸ•΅οΈ. In that case, the files can be encrypted end-to-end between a Trusted Component Signer and a TEE. However, there must be some means of provisioning the decryption key into the TEE, and/or some means of the Trusted Component Signer securely learning a public key of the TEE that it can use to encrypt πŸ”‘. The Trusted Component Signer can't necessarily even trust the TAM to report the correct public key of a TEE for use with encryption, since the TAM might instead provide the public key of a TEE that it controls 😬.

One way to solve this is for the Trusted Component Signer to run its own TAM, which is only used to distribute the decryption key via the TEEP protocol. The key file can be a dependency in the manifest of the encrypted TA πŸ“¦. So the TEEP Agent looks at the Trusted Component manifest to determine if there's a dependency with a TAM URI of the Trusted Component Signer's TAM. The Agent then installs the dependency and continues with the Trusted Component installation steps, including decrypting the TA binary with the relevant key 🎁.

9.9. REE Privacy 🫣

The TEEP architecture is applicable to cases where devices have a TEE that protects data and code from the REE administrator. In such cases, the TAM administrator, not the REE administrator, controls the TEE in the devices 🏰. Examples include:

  • A cloud hoster may be the REE administrator where a customer administrator controls the TEE hosted in the cloud.
  • A device manufacturer might control the TEE in a device purchased by a customer.

The privacy risk is that data in the REE might be susceptible to disclosure to the TEE administrator. This risk is not introduced by the TEEP architecture, but it is inherent in most uses of TEEs πŸ‘€. This risk can be mitigated by making sure the REE administrator explicitly chooses to have a TEE that is managed by another party. In the cloud hoster example, this choice is made by explicitly offering a service to customers to provide TEEs for them to administer. In the device manufacturer example, this choice is made by the customer choosing to buy a device made by a given manufacturer πŸ›’.

10. IANA Considerations πŸ“‹

This document has no IANA actions 🫢.

11. Informative References ✨

[CC-Overview] Confidential Computing Consortium, "Confidential Computing: Hardware-Based Trusted Execution for Applications and Data", November 2022, https://confidentialcomputing.io/wp-content/uploads/sites/85/2021/03/confidentialcomputing_outreach_whitepaper-8-5x11-1.pdf.

[CC-Technical-Analysis] Confidential Computing Consortium, "A Technical Analysis of Confidential Computing", v1.3, November 2022, https://confidentialcomputing.io/wp-content/uploads/sites/10/2023/03/CCC-A-Technical-Analysis-of-Confidential-Computing-v1.3_unlocked.pdf.

[EAT] Lundblade, L., Mandyam, G., O'Donoghue, J., and C. Wallace, "The Entity Attestation Token (EAT)", Work in Progress, Internet-Draft, draft-ietf-rats-eat-21, 30 June 2023, https://datatracker.ietf.org/doc/html/draft-ietf-rats-eat-21.

[GPTEE] GlobalPlatform, "TEE System Architecture v1.3", GlobalPlatform GPD_SPE_009, May 2022, https://globalplatform.org/specs-library/tee-system-architecture/.

[GSMA] GSM Association, "SGP.22 RSP Technical Specification", Version 2.2.2, June 2020, https://www.gsma.com/esim/wp-content/uploads/2020/06/SGP.22-v2.2.2.pdf.

[OP-TEE] TrustedFirmware.org, "OP-TEE Documentation", https://optee.readthedocs.io/en/latest/.

[OTRP] GlobalPlatform, "TEE Management Framework: Open Trust Protocol (OTrP) Profile v1.1", GlobalPlatform GPD_SPE_123, July 2020, https://globalplatform.org/specs-library/tee-management-framework-open-trust-protocol/.

[RATS-DAA] Birkholz, H., Newton, C., Chen, L., and D. Thaler, "Direct Anonymous Attestation for the Remote Attestation Procedures Architecture", Work in Progress, Internet-Draft, draft-ietf-rats-daa-03, 10 March 2023, https://datatracker.ietf.org/doc/html/draft-ietf-rats-daa-03.

[RFC4949] Shirey, R., "Internet Security Glossary, Version 2", FYI 36, RFC 4949, DOI 10.17487/RFC4949, August 2007, https://www.rfc-editor.org/info/rfc4949.

[RFC5280] Cooper, D., Santesson, S., Farrell, S., Boeyen, S., Housley, R., and W. Polk, "Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile", RFC 5280, DOI 10.17487/RFC5280, May 2008, https://www.rfc-editor.org/info/rfc5280.

[RFC6024] Reddy, R. and C. Wallace, "Trust Anchor Management Requirements", RFC 6024, DOI 10.17487/RFC6024, October 2010, https://www.rfc-editor.org/info/rfc6024.

[RFC7696] Housley, R., "Guidelines for Cryptographic Algorithm Agility and Selecting Mandatory-to-Implement Algorithms", BCP 201, RFC 7696, DOI 10.17487/RFC7696, November 2015, https://www.rfc-editor.org/info/rfc7696.

[RFC9019] Moran, B., Tschofenig, H., Brown, D., and M. Meriac, "A Firmware Update Architecture for Internet of Things", RFC 9019, DOI 10.17487/RFC9019, April 2021, https://www.rfc-editor.org/info/rfc9019.

[RFC9334] Birkholz, H., Thaler, D., Richardson, M., Smith, N., and W. Pan, "Remote ATtestation procedureS (RATS) Architecture", RFC 9334, DOI 10.17487/RFC9334, January 2023, https://www.rfc-editor.org/info/rfc9334.

[SGX] Intel, "Intel(R) Software Guard Extensions (Intel (R) SGX)", https://www.intel.com/content/www/us/en/architecture-and-technology/software-guard-extensions.html.

[SUIT-MANIFEST] Moran, B., Tschofenig, H., Birkholz, H., Zandberg, K., and O. RΓΈnningstad, "A Concise Binary Object Representation (CBOR)-based Serialization Format for the Software Updates for Internet of Things (SUIT) Manifest", Work in Progress, Internet-Draft, draft-ietf-suit-manifest-22, 27 February 2023, https://datatracker.ietf.org/doc/html/draft-ietf-suit-manifest-22.

[TEEP] Tschofenig, H., Pei, M., Wheeler, D. M., Thaler, D., and A. Tsukamoto, "Trusted Execution Environment Provisioning (TEEP) Protocol", Work in Progress, Internet-Draft, draft-ietf-teep-protocol-15, 3 July 2023, https://datatracker.ietf.org/doc/html/draft-ietf-teep-protocol-15.

[TEEP-HTTP] Thaler, D., "HTTP Transport for Trusted Execution Environment Provisioning: Agent Initiated Communication", Work in Progress, Internet-Draft, draft-ietf-teep-otrp-over-http-15, 27 March 2023, https://datatracker.ietf.org/doc/html/draft-ietf-teep-otrp-over-http-15.

[TrustZone] Arm, "TrustZone for Cortex-A", https://www.arm.com/technologies/trustzone-for-cortex-a.


Acknowledgments 🫢

We would like to thank Nick Cook, Minho Yoo, Brian Witten, Tyler Kim, Alin Mutu, Juergen Schoenwaelder, Nicolae Paladi, Sorin Faibish, Ned Smith, Russ Housley, Jeremy O'Donoghue, Anders Rundgren, and Brendan Moran for their feedback. Thank you all, you're literally the best πŸ’œ

Contributors 🌸

Andrew Atyeo Intercede Email: andrew.atyeo@intercede.com

Liu Dapeng Alibaba Group Email: maxpassion@gmail.com

Authors' Addresses πŸ¦‹

Mingliang Pei Broadcom Email: mingliang.pei@broadcom.com

Hannes Tschofenig Email: hannes.tschofenig@gmx.net

Dave Thaler Microsoft Email: dthaler@microsoft.com

David Wheeler Amazon Email: davewhee@amazon.com

πŸ“¦ where this page comes from