Skip to main content
  1. Index/

Secure Boot (UEFI Secure Boot)

Table of Contents

UEFI Secure Boot is a firmware-level mechanism that ensures each binary executed during the boot process — bootloader, kernel, UEFI drivers — is cryptographically signed by a key the firmware trusts, before it is allowed to run. It is defined in the UEFI specification and implemented by the firmware on virtually all modern x86 and ARM platforms. Its threat model is bootkits and rootkits that install themselves before the OS loads and therefore survive reboots, OS reinstalls, and cannot be detected by any software running after them.

Trust is managed through a four-level key hierarchy stored in authenticated UEFI variables. The Platform Key (PK) — enrolled by the OEM or system owner — is the root of trust; its private key is required to authorize any changes to the next layer. The Key Exchange Key (KEK) database holds keys authorized to update the signature databases. The signature database (db) lists the public keys and binary hashes that are trusted to execute at boot time. The revocation database (dbx) lists keys and hashes that are explicitly blocked, and always takes precedence over db — a binary matching a dbx entry is refused regardless of any db entry. At boot, firmware verifies each EFI binary’s signature against db (and checks it against dbx) before executing it; any failure halts the chain. The entire Secure Boot configuration — PK, KEK, db, dbx — is measured into TPM PCR 7, making the Secure Boot state part of the platform’s attestable identity. In day-to-day operation, firmware decides whether a binary may run by checking db and dbx only; most administrators never change PK, which is typically enrolled once by the OEM or platform owner and left in place for the life of the machine. PK and KEK become relevant when you take ownership of the trust store: enrolling your own keys into firmware, rotating or replacing signature databases, or running enterprise key management and custom Secure Boot policies (for example, restricting which signers may appear in db). For attestation and disk sealing, the full PK/KEK/db/dbx state still matters because it is what TPM PCR 7 records.

On Linux, distributions do not hold a key in the firmware’s db directly. Instead they rely on shim: a small Microsoft-signed EFI binary that acts as a second-stage trust anchor. Shim embeds the distribution’s own CA certificate and validates GRUB and the kernel against it, extending the chain of trust without requiring firmware modification. Shim also maintains a Machine Owner Key (MOK) database — a user-managed secondary trust store stored outside the UEFI variable hierarchy — that allows sysadmins to enroll their own signing keys (for custom kernels or out-of-tree modules) using mokutil, with changes only confirmable from the physical console at boot to prevent userland malware from silently enrolling keys. Secure Boot is a prerequisite for UKI-based measured boot: a UKI’s value as a single signed payload depends entirely on the firmware’s willingness to reject anything not carrying a valid signature.

Secure Boot does not, by itself, restrict what the running kernel may do after boot. Many Linux distributions therefore enable kernel lockdown when Secure Boot is active — typically integrity mode — which blocks or limits actions that could undermine boot-time guarantees, such as loading unsigned kernel modules, abusing sensitive interfaces, or using certain debugging features from privileged context. Lockdown is a runtime complement to firmware verification: Secure Boot attests what was loaded; lockdown reduces the chance that a compromised or malicious root can weaken the system in ways that matter for integrity-focused threat models. It is not a substitute for signed boot artifacts and does not replace measured boot or IMA where those are required.

Additional Information
#

Related

Measured Boot

Measured Boot is a boot process architecture in which each component in the boot chain — firmware, bootloader, kernel, initrd, kernel command line — is cryptographically hashed and that hash is recorded into a TPM Platform Configuration Register (PCR) before the component executes. The critical distinction from Secure Boot is in what each mechanism provides: Secure Boot is an enforcement mechanism that prevents unauthorised components from running at all; Measured Boot is a recording mechanism that creates a tamper-evident log of exactly what did run, without necessarily preventing anything. The two are complementary and typically deployed together — Secure Boot enforces a policy at boot time, Measured Boot produces the evidence that the policy was enforced as claimed. A system can have Measured Boot without Secure Boot (it records everything that ran, even unsigned components), but Secure Boot without Measured Boot provides enforcement with no attestable evidence of what was enforced.

GRUB (GNU GRand Unified Bootloader)

GRUB (GNU GRand Unified Bootloader) is the bootloader used by the majority of Linux distributions on x86 and x86-64 systems. Its role is to bridge the gap between what firmware hands control to and what the Linux kernel needs: firmware (BIOS or UEFI) loads GRUB, and GRUB locates the kernel image and initrd on disk, assembles a kernel command line, and transfers control to the kernel. Because GRUB understands a wide range of filesystem formats — ext4, XFS, Btrfs, FAT, and more — it can read its own configuration and the kernel directly from the root or boot partition without any intermediate step, which is what distinguishes it from simpler bootloaders that can only read from FAT.

LUKS (Linux Unified Key Setup)

LUKS (Linux Unified Key Setup) is the standard specification for block device encryption on Linux, created by Clemens Fruhwirth in 2004. It sits above the kernel’s dm-crypt subsystem — which performs the actual AES sector-by-sector encryption via the device mapper — and adds a structured, on-disk header that decouples key management from the encryption itself. Any block device can be a LUKS container: a partition, a logical volume, a loop device; anything that sits beneath it (filesystem, swap, LVM) is encrypted transparently, with no changes required to the software using it. The managed cryptsetup tool and the libcryptsetup library provide userspace access to LUKS volumes, and are the canonical interface for all operations on them.