Skip to content

Lesson 13 of 13 · 15m

Defensive Practice: Measuring and Locking

Firmware defense is inventory, measured boot, revocation hygiene, and a small set of fused and configured bits — done before an incident, not after.

You cannot prove clean; you can prove unchanged

The honest starting point for firmware defense is that direct integrity proof of a running BIOS/ME/EC stack is not available. What is available: measuring what booted, locking what can be locked, and keeping the revocation and update state current. Those are concrete, and they close the documented attack classes.

Inventory first. dmidecode -t bios for the build, fwupdmgr get-devices for every ESRT-visible component, chipsec_util spi info for the descriptor's region map. Compare CSME/BIOS/BMC versions against the vendor's security advisories — a fleet where nobody tracks firmware versions is a fleet running five-year-old DXE.

Audit the write protection. chipsec_main -m common.bios_wp checks BIOSWE, BLE, SMM_BWP, and the PRx ranges; common.spi_lock checks FLOCKDN; common.smrr covers SMRAM caching; common.me_mfg_mode flags a CSME still in manufacturing mode — a catastrophic find that turns the ME region into a read/write playground; common.secureboot.variables validates the PK/KEK/db/dbx set. These modules exist precisely because the misconfigurations LoJax used still ship. Run the suite on one representative machine per hardware generation — it is cheap enough to be a checklist, not an engagement.

Keep revocation current. mokutil --sb-state for Secure Boot state; fwupdmgr refresh and fwupdmgr update carry UEFI capsules, CSME updates, and dbx revocations through LVFS. A stale dbx is a standing invitation to every revoked-but-still-signed bootloader in existence — that is the hole BlackLotus rode. fwupdmgr get-history shows when each component last moved; a fleet still reporting a 2019 BIOS is running years of unpatched DXE.

Measure the boot. TPM 2.0 measured boot extends every pre-OS component hash into PCRs; the event log sits at /sys/kernel/security/tpm0/binary_bios_measurements and tpm2_eventlog parses it. PCR 7 binds Secure Boot state and the PK/KEK/db/dbx set. Where remote attestation matters, the same measurements feed quote-based verification (Keylime is the working open implementation). Tamper-evident boot — coreboot plus Heads — prints a TOTP on screen: if firmware changed, the code changed. That is the strongest 'did the machine I left come back' signal available.

Fused decisions. Intel Boot Guard burns the OEM public-key hash into chipset field-programmable fuses and verifies the initial boot block against it — genuinely strong, and permanently one-way: a board fused for verified boot will never run unsigned firmware, which also means it will never run coreboot. Choose the board first. me_cleaner plus the HAP bit shrinks CSME to bring-up only — at the cost of AMT, on some boards fan control or GPU init — a real tradeoff, chosen knowingly.

Image baseline. chipsec_main -m tools.uefi.scan_image -a check,image.bin,efi_whitelist.json walks every EFI executable inside a firmware image — a flash dump or an extracted update, not the ESP filesystem — against a JSON allowlist generated once from a known-clean reference; tools.uefi.scan_blocked is the blocklist sibling. ESP hygiene is its own, separate check: find /boot/efi -name '*.efi', efibootmgr -v, sbctl verify — unexpected bootx64.efi or shimx64.efi binaries are how bootkits look from userspace before they hide.

If you ship hardware, the list compresses: blow the JTAG/debug eFuse on production, bootdelay=-2, no UART console in the production device tree, per-device credentials provisioned at factory, FIT signatures required, anti-rollback on a hardware counter, and BMC-class management interfaces on their own network. Each of those maps to a lesson earlier in this course — they are the ship-side answers to the audit-side findings, and none of them is expensive. The expensive version is discovering in incident review that the board shipped with debug open and a shared firmware key.

The wrong mental model

"Firmware security is someone else's layer." Every mechanism in this course is within reach of free tools and a checklist. The organizations that get implants are not the ones missing exotic defense; they are the ones where nobody ran chipsec, nobody updated dbx, and nobody knew what the board shipped with. There is also a discipline nobody enjoys: re-measure after every vendor update. A capsule that fixes LogoFAIL rewrites your baseline too, and the machine that quietly fails to match its old PCRs next Tuesday is telling you something. Measure early — the baseline you take today is the only thing that can tell you the firmware changed tomorrow.

Was this lesson helpful?

Sign in to rate

Keep reading

Related articles from the SudoSecurity blog.