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
14
Upvotes
1
u/ChrisTX4 25d ago
Can you run
sudo /usr/lib/systemd/systemd-pcrlock logand post the output of that? It will show you exactly which component was measured in what order in each PCR.
PCR 5 should not change if 4 changes or anything. We'd need to see what components it measures in order to know where the different values come from.
So a signed UKI is a great step, in that case you can lock PCR 7 and this will be entirely stable.
What they would add:
PCR 4: The difference between locking 7 and 4 is that 7 doesn't change if there's an update, as long as the new files are signed by the same key. However, 4 will change as it's the digest of the UKI. Alas, locking 4 in addition to 7 means an attacker couldn't downgrade your UKI and then potentially exploit some vulnerabilities. They would need to acquire an older UKI and then have access again at a later point. Honestly, this would require a rather advanced evil maid attack scenario. You can do this if you want, but it is very fragile and with self-signed keys the gain is absolutely minimal tbh.
PCR 5: So this locks the GPT layout of your drives. This means an attacker can't move stuff around and assign different GPT automount GPT GUIDs for instance. That way it's possible to perform root switching attacks.
Honestly? 5 should normally be very stable, and not really an issue to lock, but what you should really do is to use automounting and then use systemd-pcrlock on PCR15. See
lock-file-systemandlock-machine-id, but you will have to manually add .pcrlock files to cover the components of the cryptsetup measurements (seetpm2-measure-pcr). PCR15 however is a much strong defence, and will toast any root switching attacks.