Making it harder to compromise Heads even if attacker can flash externally #1589
Replies: 2 comments 1 reply
-
I will revisit but here first thoughts on what I had in mind on my side. Again trying my best to address goals (FDE including boot which should be a seperate discussion on which I have some ideas since we now have Authenticated Recovery shell and could definitely add a TPM "boot time DUK" which only heads would seal/unseal, eg vaultboot did it with additional labeling of boot partition in their codebase) and here, which is kinda RFC for additional layers of security added for externally spi flash access. I will just start by separating those two ideas because I'm already running out of time today, but there are multiple ways to accomplish this. Let me again remind that :
Tldr: as of today, if an attacker knows what is the commit ID, it's not enough to create a rom that could fake measurements. The attacker needs rom backup, which needs physical access to SPI chips, or Recovery shell access, which is successfully prevented with Gpg detached signed Authentication and accepting to create Key Material backup at OEM factory reset/re-ownership, which enables the feature. I will review your ideas in detail next time I have an idea. But my idea here would be to create proper helpers to be able to inspect raw content (there is WiP PR on that) and adding tools to externally inspect a backup rom. Other measures will be ko with spi access, where limited space on SPI flash is only true for older devices and non-maximized board versions nowadays. I'm not sure of having that as a premise for security is a good strategy. But will think about the rest of un reviewed ideas here. @UndeadDevel thanks for creating this discussion! |
Beta Was this translation helpful? Give feedback.
-
The discussion here might get complex and will need to make things way clearer, since not all platforms are equivalent, and not strategies can be applied. We have to make a clear distinction between what hardware backed root of trust mechanisms are available to which platform chipsets. What we can do today, what can be done in the future for old platforms as well, and what can be done for newer platforms. From the outcome of those discussions, documentation will need to be updated. SRTMIvy Sandy Haswell (<Gen 6 CPU)
Gen 6+ CPU
DRTM:
I will edit this post a lot. |
Beta Was this translation helpful? Give feedback.
-
I've been playing with this idea in my head and I'm curious what you think:
One of the characteristics of Heads' typical deployment environment is very constrained available space for the firmware. I wonder if that could be made use of:
What if, in connection with #216 (encrypted boot partition), the encrypted boot would store an additional secret that would be needed for unlocking the main LUKS container? I'm thinking here along the lines of:
If I'm not misunderstanding something then it seems to me this would make it very difficult for the attacker to install some malicious firmware without breaking the ability of the system to decrypt the boot partition, because there simply won't be enough space in the BIOS flash to store the image of the non-compromised BIOS + the compromised BIOS (which needs to look and feel like normal Heads).
The only two ways (2 and 3 are closely related) I see right now how this could be defeated is if
If 1) is possible then maybe this idea is not so good after all, though this would mean that Heads is easy to compress; one possible countermeasure, which would also serve to make this solution compatible with a much wider range of motherboards (the amount of flash ROM available varies a lot) would be to "fill up" the remaining space of the flash ROM with random data generated before flashing.
If only 2+3 are possible then at least the user could know that something is up, because he would likely notice that his LUKS device has been corrupted or the SSD being different (so better than nothing, even though attacker could have imaged the container and now has the passphrase, but at least the user knows; there are also more ways now to more easily notice something is up, before entering the TPM DUK passphrase or DRK passphrase).
To further improve the situation and mitigate 2+3, it might be possible to make use of OPAL native SSD encryption:
Basically the "main" partition (LUKS device) would remain the same, but now be "double-encrypted"; IIUC this doesn't have a performance penalty on OPAL drives, because they don't care if you activate OPAL or not; the difference is only whether there is a key set up or not.
The boot partition would be encrypted only once, namely via OPAL just like the rest of the data (also note that the latest
cryptsetup
supports OPAL now). Assuming that OPAL can be set up, e.g. via cryptsetup, such that it takes the key file (BIOS image) + passphrase / second external key file, then this would actually prevent the attacker from being able to switch out the SSD or corrupt any data on it, because, IIUC, OPAL won't allow reads or writes unless it is unlocked.Of course OPAL is proprietary in implementation and code and so cannot be ultimately trusted, but I think for most threat models this would actually add quite a bit of extra security and the main user data (main partition LUKS device) is still LUKS software encrypted in addition to the OPAL hardware encryption. Also, with the OPAL part implemented, the secret in the boot partition would not be necessary anymore, it seems.
Now, since I'm not an expert on any of these topics, I'm sure I've missed some glaring holes in my scheme...what do you think?
Beta Was this translation helpful? Give feedback.
All reactions