A Reasonably Secure Linux Laptop

2023-07-19

Recently, my laptop died. To setup a new one, I wanted to play with the security settings a bit, and learn some stuff along the way. I had used full-disk encryption on the old laptop, but that was mostly taken from someone else’s configuration, and I barely understood the details when I had set that up. This time, I wanted to do this right.

I put together a list of things I wanted…

…and spent the following several days reading the Arch wiki, various blog posts, and random pieces of documentation. Most of these settings are for fun, since my only threat model is protecting my data in case of laptop theft; I don’t really have to worry about evil maids sneaking up to my hotel room.

I had originally wanted to also encrypt the boot partition, but that’s only supported by GRUB, and GRUB in turn only fully supports LUKS1. That is, there is some preliminary support for LUKS2, but not for the Argon 2 key derivation function.

In the end, the Simple encrypted root with TPM2 and Secure Boot section on the Arch wiki proved the most useful, as it described pretty much the same setup that I had in mind. There are a few tweaks I had to make, but all in all, it was a surprisingly smooth process.

Thanks to storing the LUKS key in the TPM chip, there is no need to enter a passphrase, and the drive unlocks automatically. It did seem a little off at first, like I was losing some degree of security. I had to convince myself that it’s OK:

Of course, as the saying goes, anyone is capable of inventing an encryption scheme that they themselves are unable to break, but I feel pretty OK about this. Like I said in the beginning, as long as my data is secure from laptop theft, I’m good.