this post was submitted on 17 Dec 2023
31 points (100.0% liked)

Selfhosted

44782 readers
713 users here now

A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.

Rules:

  1. Be civil: we're here to support and learn from one another. Insults won't be tolerated. Flame wars are frowned upon.

  2. No spam posting.

  3. Posts have to be centered around self-hosting. There are other communities for discussing hardware or home computing. If it's not obvious why your post topic revolves around selfhosting, please include details to make it clear.

  4. Don't duplicate the full text of your blog or github here. Just post the link for folks to click.

  5. Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).

  6. No trolling.

Resources:

Any issues on the community? Report it using the report flag.

Questions? DM the mods!

founded 2 years ago
MODERATORS
 

Hi everyone, I found the great question on booting encrypted drives, and since I'm somewhat paranoid I'd like to ask a follow-up:

When the key to decrypt the drive is input into the system, I'm assuming it stays in the RAM till the time the computer shuts downs. We know that one could, in theory, get a dump of the contents of the RAM in such a state, if done correctly. How would you deal with this problem? Is there some way to insert the USB, decrypt the drive, and then remove the USB and all traces of the key from the system?

Thanks!


Edit: link to the question I referenced: https://feddit.de/post/6735667

all 18 comments
sorted by: hot top controversial new old
[–] sirprize@lemm.ee 18 points 1 year ago (1 children)

That's not possible because of the way disk encryption works. When you unlock an encrypted drive, it does not actually decrypt it - that would take way too long and leave the disk unencrypted. Instead, the computer keeps the key in RAM and uses it to decrypt the accessed data blocks on the fly.

[–] MigratingtoLemmy@lemmy.world 4 points 1 year ago

Thank you, and indeed, I realise that I may have been asking for the impossible

[–] brygphilomena@lemmy.world 8 points 1 year ago (1 children)

Honestly, I am just so curious about your threat model that you are considering this for self hosting.

[–] MigratingtoLemmy@lemmy.world 1 points 1 year ago (1 children)
[–] gloriousspearfish@feddit.dk 6 points 1 year ago* (last edited 1 year ago)

What he means is, your security considerations here must come from some perceived threat. What kind of threat do you forsee that requires this high level of security?

Usually when you consider security you start with a threat model, describing the scenarios you want to protect your systems from. And based on that you decide the necessary technical security measures that are relevant.

[–] 4am@lemm.ee 6 points 1 year ago (1 children)

If an attacker wants your encrypted data that bad, they will attack the running machine and use it to access the data, they will not steal a key and then attempt to physically remove the drive.

Drive encryption is for prevention of access when the drive is offline, it doesn’t protect a running system which can access that data.

If you are worried about the key being accessed while the machine is running, focus on hardening access to the machine via network, etc.

[–] MigratingtoLemmy@lemmy.world 1 points 1 year ago

This machine will not be connected to the Internet, and the only way to get to it would be a VLAN-hopping attack (in which case, I'll have to think of something else)

[–] mumblerfish@lemmy.world 6 points 1 year ago

The key needs to be available to continue to be able to decrypt the data on the device. All encrypted data is not decrypted as you mount or unlock your encrypted device, that is done one the fly as you use it.

The attack you are thinking of should also not be relevant. What you worry about appears to imply that you are more concerned about the key being protected, rather than the data the key protects. You seem to wish to have your decrypted data available, but not the key.

[–] njordomir@lemmy.world 2 points 1 year ago (2 children)

Sharing this article as I think it ties in with this conversation well: https://www.zdnet.com/article/cryogenically-frozen-ram-bypasses-all-disk-encryption-methods/

I do want to say that for most people, this is likely NOT a concern, but I don't know OPs threat model.

[–] surewhynotlem@lemmy.world 4 points 1 year ago (2 children)

For those not clicking the link, "cryogenically frozen" actually means an upside down can of compressed air.

[–] Markaos@lemmy.one 1 points 1 year ago

On the other hand, it's also worth noting that newer RAM generations are less and less susceptible to this kind of attack. Not because of any countermeasures, they just lose the data without constant refreshing much quicker even when chilled / frozen, so the attack becomes impractical.

So from DDR4 up, you're probably safe.

[–] njordomir@lemmy.world 1 points 1 year ago

That was a perfect one sentence summary of the article!

Its amazing some of the things people come up with like gathering intel on what a computer is doing via power draw changes, monitoring an air-gapped computers electromagnetic fields, or in this case "cryogenically" freezing ram with compressed air.

[–] Tangent5280@lemmy.world 2 points 1 year ago

OP is likely Raoul Silva, the antagonist from Skyfall (2012).

[–] WaterWaiver@aussie.zone 2 points 1 year ago* (last edited 1 year ago) (1 children)

I wouldn't attack via USB, that path has already been too well thought out. I'd go for an interface with some sort of way to get DMA, such as:

  • PCIE slots including M.2 and external thunderbolt. Some systems might support hotplug and there will surely be some autoloading device drivers that can be abused for DMA (such as a PCIE firewire card?)
  • Laptop docking connectors (I can't find a public pinout for the one on my Thinkpad, but I assume it'll have something vulnerable/trusted like PCIE)
  • Firewire (if you're lucky, way too old to be found now)
  • If you have enough funding: possibly even ones no-one has thought about like displayport + GPU + driver stack. I believe there have been some ethernet interface vulnerabilities previously (or were those just crash/DOS bugs?)
[–] MigratingtoLemmy@lemmy.world 1 points 1 year ago

Thank you, I'll need to think more about possible attack vectors

[–] Kalcifer@sh.itjust.works 2 points 1 year ago* (last edited 1 year ago) (1 children)

I’m assuming it stays in the RAM till the time the computer shuts downs

Correct.

We know that one could, in theory, get a dump of the contents of the RAM in such a state, if done correctly.

An example of such an attack would a "cold boot attack".

Is there some way to insert the USB, decrypt the drive, and then remove the USB and all traces of the key from the system?

It sort of depends on how the underlying hardware is designed. You can create a system in which the RAM's contents are encrypted by the hardware, but at some point the data must be decrypted for use. For example, one could theoretically sniff the data-lines between the RAM, and the CPU. This is all of course ignoring the fact that the hardware, itself, could be compromised i.e. Intel M.E., backdoors/vulnerabilities in the BIOS, etc. There's lots that can be done to try to mitigate security vulnerabilites, but there is always a tradeoff between security, and convenience.

Maybe the best form of security is memorizing a private key, then manually doing the math with a pen and paper to decrypt some text, and transmit it with a carrier pigeon.