Disk encryption on NetBSD achieving secrecy

16 points by jaypatelani


johnklos

Simple how-tos like these are excellent at giving a good picture about how things work. It's much better than how-tos that don't explain why we're doing things.

demiguru

I like the reasoning for staying on the stock boot path instead of going full cgdroot. One thing stood out though: crash dumps are given as a reason to move /var into the cgd, but in the example layout wd0b is still a plain swap partition. The kernel writes the panic dump into the swap partition and savecore only copies it into /var/crash on the next boot, so the memory image sits unencrypted on disk until something overwrites it. Same goes for anything that got paged out.

Putting swap on its own cgd with urandomkey would cover that, at the cost of not being able to recover dumps after a reboot. Or turn dumps off with swapctl -D none or kern.dump_on_panic=0 if you don't need them.