· Security

What the hypervisor can stop that the guest cannot

Isolation, segmentation, snapshots, virtual TPMs and boot integrity all sit below the guest operating system, where an attacker inside the guest cannot switch them off. What those controls do, and what they leave to you.

A security control that runs inside an operating system can be switched off by whoever takes over that operating system. An attacker with administrative rights in a guest can stop the security agent and clear the logs. A control that runs in the hypervisor is out of reach from inside the guest, and that is the reason to put some of your controls there.

NIST makes the same argument in SP 800-125A Revision 1, its 2018 security recommendations for server hypervisors. It recommends that security monitoring and policy enforcement for VMs "should be based outside of VMs," and the first reason it gives is that a tool placed there "is not vulnerable to a flaw in the Guest OS."

Five of these controls are worth knowing by mechanism, and every mainstream virtualization platform has some form of each.

Five controls that sit below the guest

Isolation. The hypervisor decides what CPU, memory and devices each VM can touch. NIST lists VM process isolation as the first of five baseline hypervisor functions. The effect is that a compromised guest stays one compromised guest. The attacker owns that machine and has no direct route into the memory of the VM next to it. Compare that with several applications sharing one operating system, where taking over the OS means taking over all of them.

Segmentation. Network rules can be enforced at the virtual network adapter, before a packet reaches a physical wire. NIST's companion document, SP 800-125B, covers this ground: network segmentation, traffic control using firewalls and monitoring of VM traffic. What matters is where the rule lives. An attacker who has root in a guest can rewrite that guest's own firewall. The same attacker cannot edit a rule held by the platform, so traffic between two VMs on the same host can be blocked or inspected even when one of them is hostile.

Snapshots. The platform can capture a VM's disk state from outside. Ransomware running in the guest can encrypt everything the guest is able to write. It cannot delete a snapshot it has no access to, provided nothing inside the guest holds credentials for the management layer. That gives you a recovery point the attacker did not get to vote on.

Virtual TPM. A Trusted Platform Module is a small secure device that generates and stores cryptographic keys and records measurements of what booted. The Trusted Computing Group publishes the specification, which is also ISO/IEC 11889. A virtual TPM presents the same interface to a guest, so the guest can seal its disk encryption keys and record its boot measurements just as a physical machine would. The guest's keys are then held outside the guest's own file system.

Boot integrity. With UEFI Secure Boot in the virtual firmware, the guest's boot loader is checked against a list of trusted signatures before the operating system starts. The firmware and its signature databases belong to the platform, so malware in the guest cannot quietly add itself to the list. NIST applies the same idea to the host. Its first recommendation in SP 800-125A is that the hypervisor be launched on hardware that measures each component in the boot sequence and can attest to the result, so you know the layer you are trusting is the one you installed.

What an attacker who controls a guest can and cannot reach
Attacker in the guest can

Take over that one machine

Rewrite the guest's own firewall

Encrypt everything the guest is able to write

Stop the security agent and clear the logs

Attacker in the guest cannot

Reach the memory of the VM next to it directly

Edit a network rule held by the platform

Delete a snapshot it has no access to

Add malware to the virtual firmware's trusted signature list

These controls cannot tell a valid login from a stolen one, and whoever administers the platform is inside the boundary.

What those controls cannot do

They cannot tell a valid login from a stolen one. If an attacker signs in to your application with real credentials, every packet is permitted traffic and every instruction is permitted execution. The hypervisor sees a healthy VM doing its job.

They cannot patch the guest. A vulnerable web server in a well-isolated VM is still vulnerable. Isolation limits where the attacker goes next and does nothing about how they got in.

Segmentation only enforces the rules you wrote. If the policy allows the web tier to reach every database on every port, the platform will enforce that faithfully.

A snapshot is a point in time on the same platform, and it has costs of its own. NIST lists "restoration from snapshots" among the ways a running VM drifts from your standard, because a restored VM comes back with last month's patches and last month's passwords. A snapshot that includes memory also includes whatever keys were in memory. And a snapshot stored on the system that failed is not a backup.

A virtual TPM is software. The open-source documentation for one common emulator describes its state as something that has to be saved, migrated and snapshotted along with the VM. So the secrets in a virtual TPM are as safe as the platform's protection of that state. Whoever administers the platform is inside that boundary.

That last point applies to all five. Think of the hypervisor as the landlord of an apartment building. The landlord controls the walls and the locks and can keep tenants out of each other's units. The landlord cannot stop a tenant from handing a key to a stranger. And the landlord holds a master key, so every tenant is trusting the landlord.

NIST names the worst case directly. It calls it a breach of process isolation, or VM escape, where a rogue VM gets control of the hypervisor and with it the ability to attack every other VM on the host. That is why the same document recommends keeping hypervisor management on a dedicated network segment behind a firewall. The management interface is the master key, and it deserves more protection than anything running above it.

For workloads where you cannot accept trusting the platform operator at all, there is a separate set of technologies. The Confidential Computing Consortium defines confidential computing as protecting data in use "by performing computation in a hardware-based, attested Trusted Execution Environment." It changes who has to be trusted, and it brings its own operational work, so treat it as a separate project.

Who owns which layer

A flaw in the hypervisor is the platform vendor's problem to fix and your platform team's problem to patch. Do it quickly, because every guest depends on it.

A flaw in the guest operating system is the OS vendor's problem to fix and the guest owner's problem to patch. The platform team can contain the damage. It cannot do the patching for them.

Stolen credentials and application bugs belong to the application owner and the identity team. Nothing below the operating system will catch those.

The platform team owns the five controls above, and it owns access to the management layer. That includes knowing who can take a snapshot, who can attach a disk to another VM and who can open a console, because each of those is a way around every control inside the guest.

One caveat. Controls outside the guest see less context than an agent inside it. They know what the VM did on the network and on disk. They often do not know which user or process did it. You need both views, and I would not let anyone argue that one replaces the other.

A useful exercise for your next review: pick one important VM and assume an attacker has administrative rights inside it. List every control that still works. Whatever is on that list is what the platform is giving you. If the list is short, the protection you thought you had is running inside the machine you just gave away.

Views are my own.