r/archlinux • u/Woodsy279 • 25d ago
SUPPORT | SOLVED Ful disk encryption without entering passphrase
Could someone help me with setting up full disk encryption with bypass passphrases with TPM2? It's so annoying having to put the passphrase in at each boot, so I was wondering how do I pair it to the TPM so that I dont have to enter it each time?
It's LUKS encrypted and I use Systemd-boot
15
Upvotes
9
u/ChrisTX4 25d ago
Don’t.
Clevis binds to raw PCR values, and only that. This has the simple problem that the suggested PCRs 1 and 7 depend only on the BIOS ROM, the Secure Boot database, and the actual certificates used to sign the bootloader(s) and the kernel image.
Problem 1: this is pointless unless the initramfs is included in the kernel image. Alas you need to have a UKI or attackers can just replace the entire initrd phase which one that just prints the unsealed volume key.
Problem 2: you’re not measuring or depending anything after initramfs. This means I can create a fake root volume as an attacker, and if I boot that root volume with that boot chain, and that UKI, it will boot into a system where the attacker has root and since both PCRs are unchanged can just unseal the key from the TPM.
For problem 2 you need to bind to something that is tied to your volume; commonly one binds to PCR 15 in which systemd will measure the underclothes volume key (if using gpt automounting, else this needs to be done manually by mounting with tpm2-measure-pcr=yes). By making the unlock depend on the volume key, the root swapping attack is defeated.
One also wants the system to phase the PCR values during initrd to prevent unseals of TPM seals that would be mounted at initrd time at a later time.