feat(security): bind TPM2 auto-unlock to PCRs 0+7 - #269
Conversation
Up to standards ✅🟢 Issues
|
|
Hmm, secureblue uses 7+14, might be worth looking into why they are doing that |
|
Good point. While PCR 7 covers the firmware Secure Boot certs and db/dbx, enrolling a custom MOK key to sign and load an unauthorized kernel or driver only trips PCR 14. Binding PCR 14 closes that gap. Since we enroll one, having PCR14 sounds good. I have updated the PR to include PCR 14 in the policy ( |
|
This is related https://github.com/rhboot/shim/blob/main/README.tpm |
|
Thanks for the reference. That confirms PCR 14 covers Maybe the way to go for now is keeping this simple with |
Co-authored-by: renner <80410025+renner0e@users.noreply.github.com>
What changes
Binds TPM2 LUKS auto-unlock in
luks-tpm2-autounlockto PCRs 0 and 7 (--tpm2-pcrs=0+7).Why
The script previously passed
--tpm2-pcrs='', which bound the LUKS token to no PCRs. With an empty PCR policy, the TPM chip unseals the drive key unconditionally for any software booted on that board.Binding to
0+7ensures the TPM checks system integrity before releasing the key:If Secure Boot is turned off or an unsigned bootloader runs, PCR 7 changes and the TPM hard-locks.
Threat model and limitations
This is an incremental hardening step, not a complete solution against all physical attacks.
Current Fedora and Universal Blue systems use split boot components: GRUB, a separate initramfs, and a mutable kernel command line. Because these change across updates, binding PCRs 8, 9, 11, or 12 directly is not feasible without breaking unlock on every update.
This leaves specific gaps where combining a PIN with PCRs helps:
0+7help: When an attacker modifies the boot chain or disables Secure Boot, PCR 7 changes. The TPM refuses to release the key even if the valid PIN is provided.A full solution for verified passwordless boot requires signed Unified Kernel Images (UKIs) and composefs (as described in the Fedora Magazine article on sealed atomic desktops). Until UKIs land in standard builds, combining PCRs
0+7with an optional PIN is the safest baseline available on split boot chains.Trade-offs
0+1), disabling Secure Boot leaves the disk unlock open to unsigned boot media.References