
FreeBSD Full Disk Encryption, with an External Boot Drive, GELI, and UFS (2015) - eatonphil
https://vesterman.com/FreeBSD/FullDiskEncryption
======
mioelnir
I've switched back from such a setup to having an unencrypted UFS boot
partition. The external boot medium works nicely, but then you think about a
USB stick being your SPOF too much, then you create backup sticks. Which means
you have to secure them at least as good as the one "you are always carrying".
But you can not simply carry the backup as well, as that would subject it to
the same wear and tear. Which spawns the second backup. It is a rabbit hole.

That said, I am really looking forward to Allan Jude's last patches hitting
CURRENT, at which point I will rebuild that Laptop with UEFI booted, full disk
encrypted root on ZFS without any unencrypted bootpartition.

There will still be the issue of the unencrypted bootloader that does the
initial decryption to load the kernel, but that will likely end up an
irrelevant attack vector compared to the Laptop's BIOS anyway...

~~~
simonebrunozzi
Which laptop do you use? I love FreeBSD but have always failed at installing
it properly on a laptop (Macbook dual boot, or Dell XPS 13).

~~~
mioelnir
It's a Dell Latitude E6430 aka whatever my workplace gave out at the time I
got a new one. Which means I can not claim that any sort of research went into
choosing this one or that that it runs FreeBSD dis-proportionally well - which
it does not. It just runs it, with the occasional hickup here and there.

For example on boot, it always prints that the boot device is invalid, since
it gets confused by finding GPT partitioning without UEFI. Then you press
enter and it happily continues to boot...

I never fully configured the UMTS modem in it I think, that entire class of
hardware is just soul crushingly awful.

And as I am running CURRENT, every once in a while there is commit that throws
i915kms into a suspend/resume tantrum (refusing to shut down, not coming back
up). But since I do actually power down the laptop instead of suspending it,
so that the disk encryption actually has a chance to help me out, I am not too
bothered by it.

My use case for the laptop is mainly being a glorified ssh terminal
multiplexer. It just needs to provide a comfortable, familiar runtime that I
can navigate blindly at 3am, still partially asleep and without any coffee.
All the tools need to be there, in the correct drawer, with the correct label
and all the right marker labels on the man pages.

I tried running a Linux laptop/workstation combination at work since that is
what our boxes predominantly run, but it just feels like running around in
somebody else's slippers all day.

Sorry for oversharing.

------
keithpeter
_" Optionally, at this point you might want to overwrite any preexisting data
on your hard drives with zeroes or, preferably, random values."_

Am I being silly, or could a hard drive full of _random_ data be confused with
a hard drive full of encrypted data by some member of the security services in
the future? Would zeros not be a better bet?

The Debian installer attempts to write random data to the whole drive when you
elect to encrypt the hard drive (except for the small /boot partition as
mentioned in OA). I always quit out of that. My security needs are of the
'laptop left on bus' variety, not enterprise level.

~~~
Terribledactyl
At that point, you are trying to remove the ability to read the old files on
the disk you are about to use for new encrypted data. Wiping with all zeros
will make it extremely difficult to recover files and random will be even more
so. But by writing down zeros, you leak metadata about the encrypted parts of
your drive. Zeros almost certainly don't contain data, but the noise will. If
I can see you have 30gb of noise on a drive, rest zeros then I know something
I probably shouldn't, namely that you have written at least 30gb to that
drive. But that same 30gb of noise wouldn't be discernible in a drive full of
random data.

What you might be thinking of is when decommissioning the drive after having
encrypted it. At this point, I don't think it matters. I'm not sure drives
come with all zeroed status from the manufacturer anyways.

~~~
buy_used
Buy a used platter of off eBay or from your favorite reseller of refurbished
equipment (and keep the receipt). Replace the disk's controller with one of
your own (the one it came with was broken). Ummm, I dunno what the previous
owner of this drive has done with it!

~~~
justinjlynn
In this era of strict liability crimes that won't help you. In fact, it may
actually be more risky.

~~~
buy_used
How so? By future laws that outlaw resales? Make do-it-yourself repairs
illegal?

Yeah, that would suck.

~~~
dasyatidprime
I think ey probably meant “finding illegal content on the parts of the platter
you haven't touched yet”.

~~~
justinjlynn
Yes, that's what I meant. It's possible that merely having some forms of data
in your possession would be considered prima facie evidence of crime -- there
is no need for the state to demonstrate that you put it there or that you had
any idea it was there to be convicted. That you might take content from
somewhere and not look at what it is before carrying it is reckless -- and
much like carrying, through airport security, luggage packed by someone
unfamiliar to you.

------
616c
Sounds very cool, as an almost life-long Linux user.

Important question, that makes me suffer in other *nix platforms: does anyone
run a rig like this AND it work properly with sleep/hibernation and resume?

~~~
cperciva
Works fine with suspend-to-RAM. FreeBSD doesn't have software suspend-to-disk
support (and it's almost never implemented by the BIOS).

~~~
616c
> FreeBSD doesn't have software suspend-to-disk support (and it's almost never
> implemented by the BIOS).

Linux has spoied me so bad I never noticed the former, and I am shocked by the
latter.

Nice to get a response from a completely ignorant BSD and security notice, by
the way. :-) I guess I could ego trip and say "how can I trust this user" but
I suspect others will chuckle like me.

~~~
cperciva
I'm having trouble understanding this comment. Possibly due to typos?

~~~
chongli
I think this person is impressed that the founder of Tarsnap would respond to
the question of a novice.

------
xenophonf
And here's how you do the same thing, only with ZFS:

[https://web.archive.org/web/20120606231347/https://web.irtno...](https://web.archive.org/web/20120606231347/https://web.irtnog.org/Members/xenophon/blog/revised-
freebsd-root-zfs-geli)

(Sorry---I'd posted this to my now-defunct blog back in 2012.)

~~~
xenophonf
Here's how you do something similar, only in a dual-boot setup with Mac OS X
(FileVault2) and Ubuntu (OpenZFS/LUKS):

[https://gist.github.com/xenophonf/2e2d1a1550b0fb8dae98](https://gist.github.com/xenophonf/2e2d1a1550b0fb8dae98)

------
snvzz
I kinda like how Dragonfly does implement dm-crypt such as on Linux
(compatible) instead :).

------
z0xcd
Question: when installing FreeBSD 11, I can automatically encrypt the disk in
the install if I use ZFS, using UFS doesn't work, I would have to do that
manually. Why didn't they implement this already?

~~~
mioelnir
I think the encrypted ZFS installer bits were upstreamed by PCBSD which is
ZFS-only; so it would make sense for them not to implement the UFS version.

Apart from that, probably nobody needed it bad enough to sit down and write it
so far.

------
CIPHERSTONE
Great write up!

