Figure 1 shows the main components in a typical device with an REE and a TEE. Full descriptions of components not previously defined are provided below. Interactions of all components are further explained in the following paragraphs.
+---------------------------------------------+
| Device | Trusted Component
| +--------+ | Signer
| +---------------+ | |--------------+ |
| | TEE-1 | | TEEP |-----------+ | |
| | +--------+ | +--| Broker | | | | +-------+ |
| | | TEEP | | | | |<-----+ | | +-->| |<-+
| | | Agent |<------+ | | | | | +-| TAM-1 |
| | +--------+ | | |<---+ | | +--->| | |<-+
| | | +--------+ | | | | +-------+ |
| | +----+ +----+ | | | | | TAM-2 | |
| +-->|TA-1| |TA-2| | +-------+ | | | +-------+ |
| | | | | | |<---------| UA-2 |--+ | | |
| | | +----+ +----+ | +-------+ | | | Device
| | +---------------+ | UA-1 | | | | Administrator
| | | | | | |
| +--------------------| |-----+ | |
| | |----------+ |
| +-------+ |
+---------------------------------------------+
-
Trusted Component Signer and Device Administrator:
-
Trusted Component Signers and Device Administrators utilize the servicesof a TAM to manage TAs on devices. Trusted Component Signers do not directly interactwith devices. Device Administrators may elect to use a TAM for remote administrationof 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 insidea TEE that receives TAM requests (typically relayed via a TEEP Brokerthat runs in an REE). A TEEP Agent in the TEE may parse orforward requests to other processing modules in a TEE, which isup to a TEE provider's implementation. A response messagecorresponding to a TAM request is sent back to the TAM, again typicallyrelayed 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 [RFC 4949]. 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 CAscan be used by different device manufacturers.
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 |--------------+
| +---------------+ +---------+ |
| |
+-------------------------------------------+
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.
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 is 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 with which the TEEP Agent is associated.
Each Trusted Component is digitally signed, protecting its integrity and linking the Trusted Component back to the Trusted Component Signer. The Trusted Component Signer is often the Trusted Component Developer but, in some cases, might be another party such as a Device Administrator or other party to whom the code has been licensed (in which case, the same code might be signed by multiple licensees and distributed as if it were different TAs).
A Trusted Component Signer selects one or more TAMs and communicates the Trusted Component(s) to the TAM. For example, the Trusted Component Signer might choose TAMs based upon the markets into which the TAM can provide access. There may be TAMs that provide services to specific types of devices, device operating systems, specific geographical regions, or network carriers. A Trusted Component Signer may be motivated to utilize multiple TAMs in order to maximize market penetration and availability on multiple types of devices. This means that 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 the Untrusted Application to an app store or other app repository, the developer optionally binds the Untrusted Application with a manifest that identifies what TAMs can be contacted for the Trusted Component. In some situations, a Trusted Component may only be available via a single TAM; this is likely the case for enterprise applications or Trusted Component Signers serving a closed community. For broad public apps, there will likely be multiple TAMs in the Untrusted Application's manifest, one servicing one brand of mobile device and another servicing a different manufacturer, etc. Because different devices and manufacturers trust different TAMs, 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, the TEEP Agent selects a single TAM URI that is consistent with the list of trusted TAMs provisioned in the TEEP Agent, invokes the HTTP transport for TEEP to connect to the TAM URI, and begins a TEEP protocol exchange. When the TEEP Agent subsequently 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 such dependencies exist that are prerequisites to install the Trusted Component, then the TEEP Agent recursively follows the same procedure for each dependency that needs to be installed or updated, including 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. That is, dependencies from Trusted Components on other Trusted Components can be expressed in a Software Update for the Internet of Things (SUIT) manifest, including 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" (which is a grouping of one or more TAs installed on a device that can share information within such a group) that must be created and into which one or more TAs can then be installed. It is thus up to the SUIT manifest to express a dependency on having such a security domain 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, just like updating the OS or a shared library could impact an Untrusted Application. Thus, an implementation needs to take such issues into account.
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 appears 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 has implications to the management of the TAs in a TEE. In addition to the Untrusted Application and TA(s), the TA(s) and/or TEE may also require 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 of an Untrusted Application, TA(s), and Personalization Data. Such cases include (possibly among others):
-
The Untrusted Application, TA(s), and Personalization Data are all bundled together in a single package by a Trusted Component Signer and either provided to the TEEP Broker through the TAM or provided separately (with encrypted Personalization Data), with key material needed to decrypt and install the Personalization Data and TA provided by a TAM.
-
The Untrusted Application and the TA(s) are bundled together in a single package, which a TAM or a publicly accessible app store maintains, and the Personalization Data is separately provided by the Personalization Data provider's TAM.
-
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.
-
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.
-
Encrypted Personalization Data is bundled into a package distributed with the Untrusted Application, while the TA(s) and key material needed to decrypt and install the Personalization Data are in a separate package provided by a TAM. 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 Personalization Data as separate Trusted Components with separate installation steps that 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 decryption of private TA binaries or Personalization Data.
In order to better understand these cases, it is helpful to review actual implementations of TEEs and their application delivery mechanisms.
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 the Untrusted Application 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 use that TA (Cases 3-5). In this case, the Untrusted Application would require a reference to an external file or download such a file dynamically, place the contents of the file into memory, and load that as a TA. Obviously, such file or downloaded content must be properly formatted and signed for it to be accepted by the SGX TEE.
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, since such a construction would require a special installation program and SGX TA (which might or might not be the TEEP Agent itself based 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 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, which would pass this data to the installed Untrusted Application, which would in turn send this data to the SGX enclave (TA). This complexity is due to the fact that each SGX enclave is separate and does not have direct communication to 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.
In Arm TrustZone [
TrustZone] for A-class devices, the Untrusted Application and TA may or may not be bundled together. This differs from SGX since in TrustZone, the TA lifetime is not inherently tied to a specific Untrusted Application process lifetime as occurs in SGX. A TA is loaded by a trusted OS running in the TEE, such as a TEE compliant with GlobalPlatform [
GPTEE], where the trusted OS is separate from the OS in the REE. Thus, Cases 2-4 are equally applicable. In addition, it is possible for TAs to communicate with each other without involving any Untrusted Application; thus, the complexity of Cases 1 and 5 are 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 such storage.
This architecture leverages asymmetric cryptography to authenticate a device to a TAM. Additionally, 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 to have the capability to control what TAs are allowed. A device manufacturer enables verification by one or more TAMs and by Trusted Component Signers; 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 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.