Hardware-Based Trusted Computing Architectures for Isolation and Attestation

Electronic devices pervade our daily lives, both visibly through the devices that we interact with daily, but also invisibly as control industrial control systems and critical infrastructure that we rely on. At the same time, these devices have become increasingly connected, exposing them to remote attackers.

The fact that these systems can be exploited is far from fiction, as numerous attacks have occurred in recent years. Discovered in 2010 and perhaps one of the most well-known worms, Stuxnet was designed to sabotage Iran’s nuclear program [1]. It targeted a uranium enrichment facility in Natanz, where it infected the computers of engineers, trying to gain access to specific type of industrial controller. This device managed the frequency of the centrifuges that are critical to the enrichment process, varying their frequency to drive down yields. Not only did it disrupt the controller’s operation, it initially made a record of the intended operation and replayed this to the engineers monitoring the process, confusing them as to what was going on.

Attackers have also managed to gain access to the Ukrainian power grid. One evening in 2015, control centre operators suddenly saw the pointer of their computer moving across the screen, flipping high-voltage breakers in local substations. They also targeted two other centres, cutting power to several regions in the country. They even disabled the backup power of the control centres in order to slow down the response to their attack.

Not only industrial control systems and critical infrastructure have been breached, but also large enterprise networks. In 2017, shipping giant Maersk’s global operations ground to a halt as the NotPetya ransomware tore through the company’s systems. This not only resulted in employees being locked out of their machines, but had far-reaching global effects as Maersk’s shipping terminals could no longer accept containers nor release cargo. It took the company days to get its essential operations back up and running, and some employees could only resume work after two weeks.

The common thread among these attacks, and software exploits in general, is the fact that these devices and the software that runs on them acted outside their defined scope. Trusted computing aims to prevent exactly this, guaranteeing that a device can be trusted if it always behaves in the expected manner for the intended purpose. This definition was set out by the Trusted Computing Group in 2004 and covers a complex goal, which has resulted in a wide range of contributions from both academia and industry.

Protected Module Architectures

Protected Module Architectures (PMAs) are a foundational concept that can be found in many of these solutions. A 2008 publication by McCune et al. first introduced this concept, after observing that the complexity of modern applications has made it increasingly difficult to guarantee they are free of bugs. The authors of this paper therefore suggested to isolate critical functionality (e.g., implementations of cryptographic algorithms) in separate, contained modules.

These modules can then be isolated from all other software running on the system, ensuring that their operation cannot be tampered with. Furthermore, the integrity of these modules can be attested, showing that they were not modified. They could even be proven to be free of bugs through formal verification. Finally, it is important to note that while PMAs significantly reduce the attack surface, they do not close it completely, as they typically expose some functionality through public APIs, which could enable attacks if not designed carefully.

Isolation and Attestation

The previous paragraph laid the basics for the two mechanisms that are at the core of every trusted computing architecture: isolation and attestation. The former guarantees that no other software running on the system can tamper with the module’s execution. The latter allows an authorized local or remote party to obtain proof that the module is in a certain state. Either of these mechanisms can be implemented at various levels of the architectures, e.g., isolation mechanisms have been proposed at kernel-level (Salus), as a hypervisor (Fides), or in hardware.

Our work has focused on hardware-based trusted computing architectures, where the functionality that anchors the trust assessment is implemented in hardware. These components are therefore referred to as Roots of Trust, and they have to be inherently trusted. If they were to be compromised, none of the architecture’s security guarantees would hold. Consequently, this is an important motivation for implementing this functionality in hardware, as it is very hard or even impossible to alter it after production.

Memory Access Control

As detailed earlier, the isolation mechanisms ensures that other applications cannot interfere with the execution of the protected module. This requires a configurable access control mechanism, as most architectures support simultaneous execution of one or more protected modules with variable sizes.

Constrained architectures tend to rely on program counter-based access control. Here, the memory access privileges depend on the value of the program counter, i.e., the memory address of the currently executing instruction. The code and data sections of a protected module can only be accessed when the program counter is inside the module. If the program counter is outside, either because unprotected software is executing or another module is active, the processor ensures that these sections cannot be accessed. Since it should still be possible to start executing the module, trusted computing architectures define an entry point through which the module can be entered. This therefore results in fine-grained access control that can be implemented in hardware with little overhead. An example of an architecture that implements this type of isolation mechanism is Sancus.

While program counter-based access control is very powerful and well-suited to embedded systems, high-performance architectures tend to extend their existing Memory Management Unit (MMU) to enable isolation. At the level of a memory page, their granularity is therefore much coarser, but they enable flexible memory protection through established concepts that are well-understood. This approach is illustrated by the design of Intel’s Software Guard Extensions (SGX).

Measurements

As we mentioned, attestation mechanisms allow an authorized third party to obtain proof that a module is in a specific state. To this end, the module is measured, i.e., the authenticity of the module is verified. A common approach is to hash or MAC the code and data, with some designs also including additional identifying information (e.g., the module’s memory layout). A common approach to implement attestation is to use the of this measurement in a cryptographic protocol to authenticate a challenge sent by the authorized party. Various attestation protocols exist, based on different cryptographic protocols and with varying properties, but we will not discuss these in detail here.

When combined with the isolation mechanism, attestation functionality enables the establishment of Dynamic Roots of Trust (DRoTs). Before a module is executed, it is measured, proving that it has not been tampered with. Isolation is typically enabled atomically right after the measurement has completed, protecting the module that has just been authenticated from Time-of-Check Time-of-Use (TOCTOU) attacks. This is a powerful mechanism, which ensures that the unmodified module is started and cannot be tampered with afterwards, while no other software that was running before the measurement took place or that is started afterwards has to be trusted.

Conclusion

Trusted computing architectures with isolation and attestation mechanisms give strong guarantees to smaller modules containing critical functionality. They respectively ensure that other applications cannot tamper with their execution and allow authorized third parties to verify their authenticity. Designs from both academia and industry have shown that it is not only possible to build these architectures, but also that they are practical and have realistic performance overhead.

While these designs implement Protected Module Architectures (PMAs), they also have their limitations. First, isolation mechanisms prevent attackers from reusing a module’s code to exploit a system, but will not protect it against internal vulnerabilities. It is therefore important that a module is carefully implemented with this in mind. Second, almost all hardware-based designs have ignored side-channel attacks (both from software and hardware). This has become especially clear with the recent publication of several microarchitectural attacks, which exploit behaviour which is fundamental to modern high-performance processors. Examples of these attacks are Meltdown, Spectre, and Foreshadow (which can extract data from SGX enclaves), as well as the very recently announced ZombieLoad, RIDL, and Fallout vulnerabilities. Discussing these here would lead us too far, but they might be the topic of a future post.

Acknowledgements

This post is based on a survey that I co-authored together with Johannes Götzfried, Ruan de Clercq, Tilo Müller, Felix Freiling, and Ingrid Verbauwede. I would also like to thank my colleagues Toon Purnal and Furkan Turan for proofreading this text.