Live data from Hacker News

Bypassing disk encryption on systems with automatic TPM2 unlock

oddlama.org

111–120 of 136 posts

Re: Bypassing disk encryption on systems with automatic TPM2 unlock

#111
How do you deal with something like this in a NAS? There is no way to enter password during boot.

If someone steals the NAS how easily can they get to the data? Assuming volumes are encrypted, but the are automatically mounted on boot?

How to ensure the data is safe in case of theft.

Re: Bypassing disk encryption on systems with automatic TPM2 unlock

#112
post #107
post #95

Earlier quoted context omitted.

I would consider it for my hosted server. Entering a password on boot is a lot of work, because I need to vpn in, and run a java webstart kvm application (serial over ipmi would work better, but it doesn't work well on the hardware I have). Encrypted disks is a requirement because I don't trust the facility to wipe disks properly. But I assume I would be able to clear the TPM (if present) when I return the machine. A…

Dropbear is the solution for this.

Well, if the FreeBSD installer would set that up for me, I probably would have done it that way, but lazy, and I don't reboot that often.

Re: Bypassing disk encryption on systems with automatic TPM2 unlock

#113
post #34

Earlier quoted context omitted.

> You can mitigate this by including PCRs that sign the kernel and initrd nope! the trick the article is describing works even if the kernel and initrd is measured. it uses the same kernel, initrd, and command line. the reason this trick works is that initrds usually fall back to password unlock if the key from the tpm doesn't work. so the hack replaces the encrypted volume, not the kernel, with a compromised one. th…

> 3. the automated tpm unlock fails, prompting for a password. > 4. type in our password. In a serious security conscious setup this should be a big red flag to investigate. Any unexpected boot password prompt.

[deleted]

Re: Bypassing disk encryption on systems with automatic TPM2 unlock

#114
post #5

Earlier quoted context omitted.

If a disk is encrypted, you don't have to worry about the contents if you eventually have to RMA or dispose of the disk. For this use case, it makes no difference how the encryption key is input.

I'd guess the most common scenario is for someone giving away the entire computer, not fiddle with components. Or theft of the full machine. This feels like one of those half-security measures that makes it feel like you're safe, but it's mostly marketing, making you believe *this* device can be both safe and easy to use.

It's pretty fast to destroy all the keys in a TPM. Should take a minute if you know the right place to go. Meanwhile securely deleting a normal drive requires overwriting every sector with random data, which could take hours. So it also helps if you're giving away the whole machine.

Re: Bypassing disk encryption on systems with automatic TPM2 unlock

#115

Very clever! I am the author of one of the older guides https://blastrock.github.io/fde-tpm-sb.html . I was wondering about the solution you propose which seems a bit complicated to me. Here's my idea, please tell me if I'm completely wrong here. What if I put a file on the root filesystem with some random content (say 32 bytes), let's name it /prehash. I hash this file (sha256, blake2, whatever). Then, in the signed…

I was reading another web page (I don't have the link unfortunately) several days ago where another reader pointed out to the author the same type of attack mentioned in this article. To address that attack the author came up with the same solution you proposed and I do believe that is sufficient for preventing the type of attack mentioned in this article. There still are other types of attacks (cold boot attack, sniffing TPM traffic, etc...) that can be done though so it still is a good idea to use a PIN/password, network bound disk encryption, etc... in addition to the the TPM.

I'm currently working on setting up disk encryption for a new home server and as an additional precaution I'm also working on getting the initrd to do a few additional sanity checks prior to decrypting a LUKS partition and prior to mounting the root file system within. One check which I think will be highly effective is that prior to decrypting the LUKS partition I have the initrd hash the entire LUKS header and make sure it has the expected value before allowing the boot to continue. So far it seems to be working OK but hashing the entire LUKS header is overkill which will require some care to make sure the expected hash value is kept updated if the LUKS header changes for some reason (like changing encryption passwords). I can not recommend this idea for everyone consequently.

Re: Bypassing disk encryption on systems with automatic TPM2 unlock

#116
Long before UKI was a thing, this kind of attack was prevented by hardcoding into an EFI stub kernel the sha512 hash of a trusted initrd that would verify the cryptographic authenticity of the initrd that did the "heavy lifting" (mounting disks etc).

We have had not just secure boot but had it better on Linux (and other Unix-like) systems for a very long time.

Re: Bypassing disk encryption on systems with automatic TPM2 unlock

#117
post #2

I don't understand why anyone would use passwordless disk encryption. It just seems inherently vulnerable, especially with the threat model of physical compromise. Entering a password on boot isn't even that much work

Full disk encryption is just inherently a flawed approach compared to per file encryption. Androids approach of only protecting user data with behind the password and otherwise using a separate encryption key to allow the os to boot to the lock screen and some apps to run (eg alarms) is a more user friendly approach. Unfortunately we don't seem to have that sortve option available to us with desktop OS.

Re: Bypassing disk encryption on systems with automatic TPM2 unlock

#118
post #18
post #17

Earlier quoted context omitted.

That's how ChromeOS does it. https://m.youtube.com/watch?v=iO6cb90WiQ4

Android too in a way via Android Verified Boot. I think ChromeOS uses AVB as well. Android Verified Boot extends the System on chip Hardware based secure boot to the kernel and rootfs. Root of trust is fused into the SoC, and second stage bootloaders are signed. Second stage boot loader eg uboot,UEFI/edk2 contains a public key that is used to verify a signed AVB partition. This signed partition contains signed rootfs…

ChromeOS uses a different solution from AVB, but it works pretty similarly in practice.

https://www.chromium.org/chromium-os/chromiumos-design-docs/...

Re: Bypassing disk encryption on systems with automatic TPM2 unlock

#119
post #18

Earlier quoted context omitted.

Android too in a way via Android Verified Boot. I think ChromeOS uses AVB as well. Android Verified Boot extends the System on chip Hardware based secure boot to the kernel and rootfs. Root of trust is fused into the SoC, and second stage bootloaders are signed. Second stage boot loader eg uboot,UEFI/edk2 contains a public key that is used to verify a signed AVB partition. This signed partition contains signed rootfs…

The ingredients are there as Chrome OS and Android have shown, but robust hardware-bound disk encryption has just never been a priority for the general purpose distros.

Any theories on why no one pursues it? Lack of incentives?

Re: Bypassing disk encryption on systems with automatic TPM2 unlock

#120
post #80

When I first read about TPM-based FDE on Linux[0], I was excited that the systemd guys were finally taking a step in the right direction - BitLocker/FileVault were standard on Windows/macOS for a long time by that point. FDE should be secure by default, dead-simple to set up (e.g. a checkbox in the installer that defaults to "enabled"), and painless for everyday use. [0]: https://0pointer.de/blog/brave-new-trusted-bo…

>> we can confuse the initrd into executing a malicious init executable. This hash the next link method is always as flawed as the weakest link..

Of course. The typical Linux initrd is also too complicated. It should be doing this, and nothing else:

- There's an executable called /init, link it statically with everything it needs to do.

- Load kernel modules from a list (hardcoded at build time; optional if you include common modules in the generic kernel).

- Mount the root filesystem (hardcoded at build time) and pivot.

- execve("/sbin/init", ...)

I've built a PoC in pure Go that does all of this, the resulting initrd was ~2.5MB plus kernel modules. I simply moved all the boot-time complexity to build-time. It doesn't do LUKS or TPM yet, but that's also further down the roadmap.

OpenBSD went a step further and crammed FDE decryption into the bootloader. It doesn't do TPM but simple is simple.

Post reply on HN