Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 18 May 2020 22:52:22 +0200
From:      Thomas Zander <thomas.e.zander@googlemail.com>
To:        Allan Jude <allanjude@freebsd.org>
Cc:        stable@freebsd.org
Subject:   Re: State of encrypted-almost-everything on ZFS in 2020
Message-ID:  <CAFU734w-amFe0F9yyLnPWGGZG06%2BLpRh4yc6B5BZrU6vDTZtiw@mail.gmail.com>
In-Reply-To: <9e094a21-3a4f-5dca-897a-22200513925d@freebsd.org>
References:  <CAFU734wh-2MtqF3XUbCwE5wbCLDhdWqtSsJWUdL4i4hgJvS62A@mail.gmail.com> <9e094a21-3a4f-5dca-897a-22200513925d@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi,

thank you for the quick response. I think I have a good overview of
the state of affairs now, thanks!

On Sat, 16 May 2020 at 18:46, Allan Jude <allanjude@freebsd.org> wrote:

> > - Encrypted ZFS root pool on RAID-Z
>
> Yes, this has been supported in a few varieties for a few major versions now

... and it's a cool feature, no doubt! Unfortunately, it requires me
to supply a password via keyboard, as you explain below, so it does
not match my use case.

> > - Supply the key for the encrypted root pool during boot via USB thumb drive
> >   - No keyboard is attached to the machine
> >   - No /boot on the thumb drive, just the key
>
> This feature was never implemented for GELIBoot. Currently the bootstrap
> code only supports a manually entered passphrase.

Thanks for clarifying this!

> > - I don't mind if /boot is encrypted or not (the use case is not to
> > protect against nation state attackers)
>
> If you use an unencrypted /boot (as opposed to GELIBoot), then I think
> you might be able to use the thumb drive approach to hold the key. You
> would need to set the correct loader.conf variables to read the key from
> the thumbdrive. It might be easier if the key is written raw into a
> partition than if it is on a filesystem since it won't be mounted at
> that point.

Okay, that sounds like not all hope is lost :-)
So, something like this might work IIUC:
- Have a small (e.g. 16kB) GPT partition on the USB thumb drive, using
geom_label, accessible as /dev/label/foo
- dd the key onto /dev/label/foo
- Have this in loader.conf:
geli_label_crypted_keyfile0_load="YES"
geli_label_crypted_keyfile0_type="label/crypted:geli_keyfile0"
geli_label_crypted_keyfile0_name="/dev/label/foo"

> > - Bonus points if I can use bectl
>
> However, if you use an unencrypted /boot, then you lose bectl and boot
> environments, since the kernel is not part of the root filesystem.

That's okay, having. bectl would be nice, but secondary.

> > I'd like to have a setup where essentially nothing is stored on the
> > USB drive except the keyfile.
>
> I proposed some ideas on how to do this at BSDCan a few years ago, but
> have never had the time or financial backing to develop the feature.

I am sorry to hear that. One would expect this was not an
unconventional use case.

Thanks so much for the response, I'll play with the raw partition idea
over the next few days and will report back how it went.

Best regards
Riggs



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAFU734w-amFe0F9yyLnPWGGZG06%2BLpRh4yc6B5BZrU6vDTZtiw>