I wrote this post myself and used AI to check the grammar and syntax.
I want to clarify what secure boot and measured boot are. I often find that people do not understand secure boot at all. They tend to hear “secure” and think, “This is what I need.” Who doesn’t want their system to be secure, after all?
Then come all these stories about TPMs. Remember? The thing that prevented older PCs from upgrading to Windows 11 because it was now mandatory. Some very technical individual might have heard of “measured” boot and might even know that it is related to TPMs. Often, these people think that it’s an additional security layer on top of secure boot. Or even — I’ve heard that one before — a requirement for secure boot. All of this is mostly wrong, and this is why I’m writing this post.
“Secure” boot
Here, we are only going to talk about secure boot in the context of UEFI. It can be generalized, but that’s not what people talk about when they mention secure boot.
“Secure boot” is a terrible name. At best, we should call it “signed boot.” This is a UEFI feature, UEFI being a spec describing a firmware/OS interface. UEFI is the de facto standard for x86 firmware and is even used on arm64 servers or RISC-V.
I’ll leave you to watch this amazing presentation from James Bottomley about secure boot if you want to go into more detail. The TL;DR is that UEFI firmware holds a set of “trusted” keys. These keys are set up there by your device manufacturer and can be used to sign the OS. If the “secure boot” feature is enabled, only OS images signed by these trusted keys can be loaded.
Who owns these keys? Microsoft. Who can update these keys? Your device manufacturer and Microsoft, because they are the only ones whose keys are authorized by your firmware to sign DB updates.
The good thing is that most UEFI firmware allows the user to put the firmware in “Setup Mode.” In this state, the user can wipe all the key material and replace it with their own certificate, essentially taking full ownership of the boot stack (at least after the firmware). See this book from one of my colleagues, Rod Smith.
“Measured” boot
Here again, we only consider measured boot with a TPM. The concept can be generalized, but it’s not the point.
Measured boot is a way for each element of the boot chain to record what is coming next in a way that cannot be tampered with. For example, the UEFI firmware will record the hash of the OS kernel that it boots and store it in a read-only location in a secure hardware (lol — IYKYK) enclave.
In practice, this secure enclave is a TPM (Trusted Platform Module). Just like UEFI, TPM is just a spec. The spec describes a hardware interface. Whether the thing is actual hardware or emulated software running at a higher privilege level on your CPU is … up to your device manufacturer.
So what can you do with this?
First, you can audit the system. The TPM can use its secure key to sign “quotes” that contain the measurements. Yes, I know, it’s more complicated, but I’m writing a blog post, not a book. These quotes can then be sent to a remote trusted system — think a known-good server that was already vetted — where they can be verified. This allows you to validate claims about a system. For example, this system runs this kernel, which I trust. With some cryptographic shenanigans and the help of things like dm-verity on Linux, these claims can actually become very precise. What I described here is called “remote attestation.”
The second useful feature that a TPM offers is the ability to “seal” things against these recorded events. A common use is to seal your disk encryption key. That way, if someone messes with your system while you are finally taking a break away from your laptop — and assuming they can’t compromise the TPM — you will never be able to boot with a malicious kernel. Indeed, the system will boot. The firmware will log the kernel that it launches and refuse to unlock your disk if it’s not the one that is expected.
So what is better in the end?
I should say that it’s all about your threat model and so on, but I actually believe that secure boot is fairly useless nowadays. With the current rate at which CVEs are being discovered, being able to boot a kernel from last year — that was built and signed by a known-good vendor — is as bad as being able to boot a malicious kernel. What you want to do is to be able to know that whatever you boot is the last update you installed — plus maybe one or two previous kernels just in case — but nothing else. You can only do that with measured boot.