Since this seems to always come up, the threats I'm trying to defend against are an attacker removing a hard drive from the server and mounting its filesystem elsewhere, as well as an attacker altering kernel parameters passed from Grub to use e.g. init=/bin/sh. Clearly there are other threats this approach does not defend against which I will simply declare out-of-scope. Also: I'm not particularly interested in e.g. PCR hardening so much as getting anything to work at all.
I'm working with the following TPM2 device:
Code: Select all
# systemd-cryptenroll --tpm2-device=list
PATH DEVICE DRIVER
/dev/tpmrm0 MSFT0101:00 tpm_tis
- systemd-cryptenroll
- tpm2-initramfs-tool
- clevis
Of those, systemd-cryptenroll seems it's probably the best approach and one I seem to have partially working, at least. With the `tpm2-tools` package installed I am seemingly able to enroll my LUKS password into my TPM:
Code: Select all
# systemd-cryptenroll --tpm2-device=auto --tpm2-pcrs=0+7 /dev/sda3
🔐 Please enter current passphrase for disk /dev/sda3: [...]
New TPM2 token enrolled as key slot 1.
I've seen a lot of recommendations of dracut for this. I've tried the following:
Code: Select all
apt-get install dracut
dracut --add tpm2-tss -f
With dracut, after grub launches Linux, where it would ordinarily prompt for a password it just sits there with a cursor before dropping to an emergency shell.
I've also tried to add TPM support via initramfs-tools instead, modifying /etc/initramfs-tools/modules to add tpm_tis, and then running update-initramfs -u, but it complains:
Code: Select all
cryptsetup: WARNING: sda3_crypt: ignoring unknown option 'tpm2-device'
I get the same warning when the system boots, followed by a password prompt. This seems relevant: https://groups.google.com/g/linux.debia ... MQ5A?pli=1
Any suggestions?