Threat Model
A fundamental assumption in our threat model is that TEE can be compromised. Therefore, our primary goal is to ensure that even if the TEE hardware is compromised, the application should still function correctly with minimal data leakage. This is why we introduce Decentralized Root-of-Trust (DeRoT), a verifiable Key Management Service (KMS) for TEE governed by smart contracts, to replace the hardware-kept unrecoverable secret keys in TEE. Based on this assumption, we discuss potential threats and corresponding countermeasures. Specifically, both the confidentiality and integrity guarantees provided by TEE hardware can be compromised.- If confidentiality is compromised, encrypted memory values may be leaked, and this will further affect the sealed data on persistent storage. The countermeasures aim to:
- Limit the damage scope when a single worker is compromised to only the minimal amount of data it knows.
- Ensure forward and backward secrecy so that historical and future data remains safe.
- If the integrity promise is broken, an adversary can instruct the TEE to produce false results. In this case, all outputs from the compromised TEE should not be trusted or used by other TEE hardware and clients. While detecting TEE vulnerabilities and compromises is beyond the scope of DeRoT, it should be able to revoke authentication and prevent dirty data from being persisted.
Introducing DeRoT
Compared to traditional key management services, DeRoT differs in two aspects:- Access Control on Clients: DeRoT verifies its clients to ensure they are genuine TEE hardware running valid applications.
- Verifiable Chain-of-Trust: The DeRoT program, along with all its generated keys, must be verifiable through blockchain technology. We will explain how to verify the integrity of the DeRoT program and check whether a key is genuinely generated by DeRoT in the following sections.
- Vendor- and Hardware-Agnostic TEE Verification: DeRoT is responsible for distributing secret keys only to valid TEE hardware and controlling the key lifecycle. Clients can delegate the Remote Attestation (RA) report verification to DeRoT, needing only to verify whether the key held by the TEE is valid. This simplifies client implementation and abstracts away the details of RA reports. Additionally, this approach can be easily extended to support different TEE hardware and get integrated into existing certificate chains.
- Key Rotation in Data Sealing with Enhanced Security Features: With key rotation, the time window for attackers is significantly limited. Furthermore, this approach ensures forward and backward secrecy for sealed data, enhancing overall security.
- Support for Upgradable and Migratable Applications: Since the sealed data is now encrypted with keys generated by the standalone DeRoT, storage can be entirely separated from TEE hardware. This allows upgraded applications to decrypt saved states in a controllable way, and enables dynamic addition or removal of TEE hardware without concerns about data loss. Additionally, this architecture aligns with the existing cloud paradigm, facilitating easier migration.
Unique Challenge: Stealthy Deployer Attack
Unlike in smart contracts that every operation is observable on-chain, the introduce of DeRoT enables a blockchain-TEE hybrid system where the interactions can happen both on-chain and invisibly off-chain. Also, the support for upgradable application code will introduce more risks since the benign code may be changed to dump the encrypted data in an unconscious way. Considering the following attack from a malicious application deployer:- An open-source benign application is deployed to TEE and trusted by its users to process the privacy data;
- The deployer asks the DeRoT to upgrade the application code. It seems no reason to reject it since he is the owner;
- The deployer injects malicious logic to dump all the privacy data in the new code, but doesn’t announce this to the public. Since this upgrade is between the TEE and DeRoT, it is not observable from the on-chain perspective;
- The deployer can make another upgrade to remove the malicious logic to erase the evidence.
Design
Verifiable DeRoT and Key Chain
%20(1)%20(1).png?fit=max&auto=format&n=Y2wR1-jOsoYpAL6q&q=85&s=1e3783e7d58c0e17be614269d382dd75)
- The DeRoT code is open-source for anyone to do code and security review to ensure the correctness of key management logic and no backdoors;
- The executable must be produced with reproducible build so the verifier can know it matches the source code;
- The digest of valid executable is published through on-chain governance;
- Multiple DeRoT instances run inside TEE. Here we only rely on TEE to provide the measurement over the executable, and ensure it matches the digest on chain.
- the creation of the RootKey;
- the derivation of each application key using RootKey and nonce including deployer identity and application measurement.
Key Derivation
The key management of DeRoT follows the Principle of Least Privilege that the secrecy known by each entity in the system is strictly limited to what it requires to finish the jobs. We first explain the keys used during program execution, and then discuss the privileges of different entities.%20(1)%20(1).png?fit=max&auto=format&n=Y2wR1-jOsoYpAL6q&q=85&s=781d6b64dfffc07e34adb4a9f1bfce41)
- DeRoT, which knows the RootKey and is able to generate any key;
- Storage service, which can be the external storage server or service containing the data and states of the application. The storage service holds the StorageKey and can rotate it independently to keep re-encrypting the data. It’s worth noting that the DeRoT can rotate it synchronously if they share the same timestamp;
- The TEE worker running the applications. Every key it holds must be distributed from DeRoT.
Key Rotation
There are two rotation variables above: the RootKey itself and by changingepoch
during key derivation.
The rotation of the RootKey will immediately changes all the keys in the system, while the interval of updating epoch
can be configured independently for different storage services so they can be rotated in different frequencies based on the requirements.
The update of the applications, which will change the app_hash
above, can be regarded as a special key rotation for the application.