From owner-freebsd-stable@freebsd.org Mon May 18 20:52:53 2020 Return-Path: Delivered-To: freebsd-stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 05E472DD1D1 for ; Mon, 18 May 2020 20:52:53 +0000 (UTC) (envelope-from thomas.e.zander@googlemail.com) Received: from mailman.nyi.freebsd.org (mailman.nyi.freebsd.org [IPv6:2610:1c1:1:606c::50:13]) by mx1.freebsd.org (Postfix) with ESMTP id 49QrnJ5jFxz4Lk0 for ; Mon, 18 May 2020 20:52:52 +0000 (UTC) (envelope-from thomas.e.zander@googlemail.com) Received: by mailman.nyi.freebsd.org (Postfix) id C3CD32DD1D0; Mon, 18 May 2020 20:52:52 +0000 (UTC) Delivered-To: stable@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C397E2DCDE9 for ; Mon, 18 May 2020 20:52:52 +0000 (UTC) (envelope-from thomas.e.zander@googlemail.com) Received: from mail-pf1-x442.google.com (mail-pf1-x442.google.com [IPv6:2607:f8b0:4864:20::442]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49QrnJ0XXgz4LbV; Mon, 18 May 2020 20:52:51 +0000 (UTC) (envelope-from thomas.e.zander@googlemail.com) Received: by mail-pf1-x442.google.com with SMTP id n15so2279075pfd.0; Mon, 18 May 2020 13:52:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Oq6GLLTMDKSJX3HKS7xceDskXqWgRKDJNFkRogK28ik=; b=PkegUAwuO7iuuF3iQc71hlY4+e3CRumyfgysy2koOPAEfwIzmA7suFYvhqv47U9lwJ g3hHOi/Z+9oM3Pj41knI/frg9XJzeNJXQaMhjOTQTU4hVcGw8D+pSKszhCIg87iKG0zE 7luwdNohwJo/hL4R7qOyfPQEITV3QLxPDp/y1YthzX3viA2APoeVVSDwVJkVs4DEyP0L DiCVmMyeVHuz46joriU7EkJqL8B6vZphfcYaNqKL827WchQ86AKpVraO5A8RCzbudxQC E33/m4/XztJNQBDH6mf8N33x1JD3wYT5ux0aQsYLMVKMVseuMkmQiHsf7N+CMj+AphZf ZqGw== X-Gm-Message-State: AOAM532o5+ic1QszQd2lih7kXhp9EPJvY6PZOC0/oqmTHiB/lfbvBe/n n/5kaBHJ1Q9LSHADGFAMJ5b/t58UOUQCrklR3shGZYNSwdY= X-Google-Smtp-Source: ABdhPJwkRKd1QmwpkyZY6QRkOMm4FbOvms88k99geQrQul+0Yvt9qdFqZh782UNoIZjDxKC55lfKggkCz7Vuzey+/to= X-Received: by 2002:a63:1556:: with SMTP id 22mr17151356pgv.307.1589835170305; Mon, 18 May 2020 13:52:50 -0700 (PDT) MIME-Version: 1.0 References: <9e094a21-3a4f-5dca-897a-22200513925d@freebsd.org> In-Reply-To: <9e094a21-3a4f-5dca-897a-22200513925d@freebsd.org> From: Thomas Zander Date: Mon, 18 May 2020 22:52:22 +0200 Message-ID: Subject: Re: State of encrypted-almost-everything on ZFS in 2020 To: Allan Jude Cc: stable@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 49QrnJ0XXgz4LbV X-Spamd-Bar: / X-Spamd-Result: default: False [-0.98 / 15.00]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[googlemail.com:s=20161025]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36:c]; FREEMAIL_FROM(0.00)[googlemail.com]; MIME_GOOD(-0.10)[text/plain]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_SPAM_SHORT(0.02)[0.015]; DKIM_TRACE(0.00)[googlemail.com:+]; RCPT_COUNT_TWO(0.00)[2]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::442:from]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; TAGGED_FROM(0.00)[]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 May 2020 20:52:53 -0000 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 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