Vehicle Networks: Privileged position

Superimposing least privileged VMs to handle data storage and networking functionality on the separation kernel

Lee Cresswell from Lynx Software Technologies discusses separation, security and the connected car

Most vehicles contain various wireless technologies, including cellular, wifi, Bluetooth, near field communications and other RF communications. There is frequently a direct path from these wireless technologies to the central automotive bus of the vehicle, providing access not only to navigation, security and other smart applications, but also to braking, steering and cruise control.

Now that connection has become the norm, there is a significant learning curve for companies and individuals alike to understand the problems, and implement appropriate solutions.

 

Attack surfaces

The ISO 26262 standard provides an automotive-specific risk-based approach to determine automotive safety integrity levels (Asils). The principle of the assignment of Asils for various automotive systems implies an assumption of separation, so the most critical systems on a vehicle cannot be compromised by less critical functionality elsewhere.

Traditionally, this was fine. ECUs were dedicated to their local function – engine control, ABS or whatever – but an increasingly holistic approach to vehicle control meant increasing levels of interaction between each module.

A simple example of this interaction might be an automatic transmission, where the engine needs to tell the transmission what the engine speed is, and the transmission needs to tell other modules when a gear change occurs. Traditionally such communications were handled by a traditional wiring loom, but as more and more similar interactions became necessary with the advent of features such as cruise control and anti-lock braking systems, these dedicated looms became impossibly complex.

The answer to that conundrum lay in the development of vehicle networks, commonly in the format of a Can bus. This network provides a medium for data exchange, allowing a uniform wiring architecture irrespective of the options specified on each individual car so that the appropriate modules can be simply plugged in to it.

While the vehicle remained isolated from the outside world, this connectivity between modules posed little threat to the security of the vehicle. Once the communications mechanisms on such a network were proven not to compromise the integrity of any systems using them, the various systems could be considered separated and so the principles of ISO 26262 remain upheld.

But the connected car changed all that. External access brings with it the potential for malicious outside influences to access any weak point, or attack surface. Such an attack surface represents a significant risk even if it exists in a low or non-critical system, because the availability of the previously benign networks provides a portal to the highest Asil systems. In stark terms, just because someone has attacked your car infotainment system doesn’t mean they can’t access the brakes. 

Clearly, then, a connected car will never offer the same level of security as an unconnected one. But for a connected vehicle to be considered safe and compliant with the principles of ISO 26262, it is imperative that attack surfaces are minimised, and that separation between systems is optimised.

 

Hardware based separation

The Tesla Model S uses a physical (lan-Can) gateway box to isolate the infotainment system from the safety-critical vehicle controller. The gateway box implements a structured API which supports a limited range of commands between the two networks, meaning if the safety critical vehicle controllers are to be accessed then a detailed knowledge of that API is required. It has not, however, proved to be entirely secure, perhaps showing how difficult a challenge is the connected car. Almost as importantly, it also introduces a considerable hardware overhead cost.

 

Software based separation

Although the Tesla system represents an effective approach to separation, if a similar or better method can be found through software then it is likely to be more cost effective.

Search for the phrase “embedded hypervisor” on any popular automotive electronics site, and it would be easy to suppose that each of the many offerings is equivalent. To explore that notion a little further, consider a similar system to that of the Tesla, abstracted for this purpose and deploying a hypervisor instead of hardware separation. 

The hypervisor functionality is important because it allows the system to mirror the Tesla in permitting restricted communications between two very different applications (virtual machines, or VMs) – one to handle the vehicle controllers, and the other the infotainment systems. A similarly obscure and structured API to that deployed in the Tesla would also make sense here.

But as far as the security is concerned, it is imperative that even if the outfacing infotainment VM is hacked and compromised, the vehicle controller VM is not vulnerable. If the VMs are to be truly separated rather than conjoined by the hypervisor, it is therefore vital the attack surface is made as small as possible by minimising the resources shared between them.

 

Type one hypervisor

To illustrate that point, consider KVM; a virtualisation infrastructure for the Linux kernel that turns it into a hypervisor. It serves merely as an example of a problem shared with any type one hypervisor.

If KVM Linux were to be the hypervisor of choice in the abstracted automotive system, the security of the vehicle controller VM would be reliant on a monolithic kernel that would expose at least 390 interfaces, with hundreds of thousands parameter options, implemented by 19.5 million lines of constantly changing code. Not only that, but the IO stack would reside in the monolithic kernel of the hypervisor, providing an easy attack vector to the vehicle controller VM.

KVM Linux provides exactly the hypervisor functionality required to support the system functionality. However, if the primary aim is separation between VMs of differing criticality then it is clearly far from optimal. A better approach would be to retain the hypervisor functionality, but to make separation and the reduction of attack surface the primary focuses of the architecture. 

To understand how that can be achieved, it is helpful to first consider the principles of least privilege and separation kernels.

 

Least privilege and separation kernels

The concept of a separation kernel was first mooted by John Rushby in 1981 who suggested that it should consist of a “combination of hardware and software that permits multiple functions to be realised on a common set of physical resources without unwanted mutual interference”.

Similarly, as long as 30 years ago, J Saltzer and M Schroeder suggested that “every programme and every user of the system should operate using the least set of privileges necessary to complete the job”.

An architectural approach based on an amalgam of those two concepts ensures that each active, executable entity (subject) has sufficient privileges and resources to perform its function – but no more.

 

Separation kernel

Clearly, these principles are not new. It is the advent of hardware-assisted virtualisation (Intel VT, Arm v7 and v8, NXP virtualisation extensions, Mips virtualisation and so on) that has all but removed the overhead associated with implementing them in practice by shifting it from the software to the hardware.

The separation kernel combines the principles of least privilege and separation kernels with this enabling technology of hardware virtualisation, so that each theoretical subject is implemented as a VM. By contrast with the type one hypervisor KVM’s 19.5 million source lines of code (slocs), such an approach results in a separation kernel of about 25,000 slocs – a much more satisfactory and shared resource.

The least privilege principles are fulfilled by ensuring that the separation kernel includes nothing that could logically be managed in user space including device drivers, VM monitors and, critically, IO stacks.

And there is no compromise in hypervisor functionality, with each VM being presented with a virtual motherboard providing the resources dictated by the system architect at configuration time. Consequently, any operating system supported by the underlying hardware can be hosted by a separation kernel hypervisor.

 

Microkernel

It is worth noting that the principle of least privilege is not unique to the separation kernel. Least privilege microkernel technology has its roots in an era predating hardware virtualisation, and was admirable given the hardware available at the time. Back then there were two privilege levels for microkernel architects to consider – the supervisor and user privilege levels – and many made good use of them to run potentially vulnerable code such as device drivers in user space rather than supervisor space.

Along with the advent of hardware virtualisation came a virtual machine monitor (VMM) privilege level and, with it, a dilemma for microkernel architecture. If the higher privilege level was ignored, then there was a vulnerable and powerful attack surface that was not being accounted for at all. But if they promoted the privilege of their old supervisor space code to this new privilege level, they would be left with a lot of code running at a higher level than necessary for its function.

In the event, microkernel design has evolved to accommodate hardware virtualisation and its associated privilege levels, and some microkernels can even make use of hardware virtualisation itself.  However, it is inevitable that such a development path will have led to compromise in that some code will run at a higher privilege level than least privilege principles would dictate. Where security is a critical factor, that is not an acceptable compromise to make.

For a security critical separation to reduce the attack surface optimally, it must ensure that each software component has the lowest privilege it needs to function in this new world of hardware virtualisation.

In the context of the automotive world, separation kernels may well be based on well-founded principles, but it is only useful if it can be applied to provide the secure environment needed to ensure that the car is not vulnerable to cyber attack.

This has to be achieved in the context of an existing infrastructure consisting largely of the public internet. The onus for security therefore falls on the gateway devices – and in this case that means the systems contained within the car.

It is also important that the high build and maintenance costs associated with multiple vehicle networks should be avoided.

The diagram shows how such a system could be designed in practice. The networking and data handling are implemented as minimalist least privilege VMs, tightly coded and running as bare metal applications to reduce their footprint and hence vulnerability.

Three VMs provide the means to run the apps, possibly mapped to the individual cores of a multicore processor where there is hard real time dependency.

Encryption keys ensure the integrity of three tiers of data security, while the separation kernel provides the underpinnings to guarantee that the system’s trusted code base is reduced.  

The net result is robust, providing resilient application interfaces to prevent malicious software from subverting the virtual software architecture. It ensures the integrity of critical applications by protecting them from possible corruption from other application partitions. Costs are reduced and yet confidentiality is guaranteed through the application of a single network structure. And it can be ensured that vehicle applications are genuine, and that network encryption cannot be bypassed.

In summary, coupling least privilege and separation kernel principles with the enabling technology of hardware virtualisation can solve the conundrum of securing the connected car.

Lee Cresswell is vice president of sales for Lynx Software Technologies

www.lynx.com

 

Recommend to Colleagues: