From nobody Mon Feb 14 23:29:55 2022 X-Original-To: freebsd-amd64@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id B8EA719CE83D for ; Mon, 14 Feb 2022 23:30:05 +0000 (UTC) (envelope-from jmg@gold.funkthat.com) Received: from gold.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "gate2.funkthat.com", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4JyL6h558Vz3N3x for ; Mon, 14 Feb 2022 23:30:04 +0000 (UTC) (envelope-from jmg@gold.funkthat.com) Received: from gold.funkthat.com (localhost [127.0.0.1]) by gold.funkthat.com (8.15.2/8.15.2) with ESMTPS id 21ENTvWc083334 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 14 Feb 2022 15:29:57 -0800 (PST) (envelope-from jmg@gold.funkthat.com) Received: (from jmg@localhost) by gold.funkthat.com (8.15.2/8.15.2/Submit) id 21ENTt9e083332; Mon, 14 Feb 2022 15:29:55 -0800 (PST) (envelope-from jmg) Date: Mon, 14 Feb 2022 15:29:55 -0800 From: John-Mark Gurney To: Georg Bege Cc: freebsd-amd64@FreeBSD.org Subject: Re: geli keyfile arguments / gpt partitions Message-ID: <20220214232955.GF97875@funkthat.com> Mail-Followup-To: Georg Bege , freebsd-amd64@FreeBSD.org References: <54f1aaaa-d4ed-1273-df9d-27cae3c1dc5f@bege.email> List-Id: Porting FreeBSD to the AMD64 platform List-Archive: https://lists.freebsd.org/archives/freebsd-amd64 List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-amd64@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <54f1aaaa-d4ed-1273-df9d-27cae3c1dc5f@bege.email> X-Operating-System: FreeBSD 11.3-STABLE amd64 X-PGP-Fingerprint: D87A 235F FB71 1F3F 55B7 ED9B D5FF 5A51 C0AC 3D65 X-Files: The truth is out there X-URL: https://www.funkthat.com/ X-Resume: https://www.funkthat.com/~jmg/resume.html X-TipJar: bitcoin:13Qmb6AeTgQecazTWph4XasEsP7nGRbAPE X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? User-Agent: Mutt/1.6.1 (2016-04-27) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (gold.funkthat.com [127.0.0.1]); Mon, 14 Feb 2022 15:29:57 -0800 (PST) X-Rspamd-Queue-Id: 4JyL6h558Vz3N3x X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of jmg@gold.funkthat.com has no SPF policy when checking 208.87.223.18) smtp.mailfrom=jmg@gold.funkthat.com X-Spamd-Result: default: False [-1.80 / 15.00]; MID_RHS_MATCH_FROM(0.00)[]; ARC_NA(0.00)[]; FREEFALL_USER(0.00)[jmg]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[funkthat.com]; AUTH_NA(1.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_HAM_SHORT(-1.00)[-1.000]; RCPT_COUNT_TWO(0.00)[2]; MLMMJ_DEST(0.00)[freebsd-amd64]; FORGED_SENDER(0.30)[jmg@funkthat.com,jmg@gold.funkthat.com]; R_SPF_NA(0.00)[no SPF record]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:32354, ipnet:208.87.216.0/21, country:US]; FROM_NEQ_ENVFROM(0.00)[jmg@funkthat.com,jmg@gold.funkthat.com]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-ThisMailContainsUnwantedMimeParts: N Georg Bege wrote this message on Tue, Feb 01, 2022 at 20:06 +0100: > Hello mailing list, > > Im trying to realize a specific encrypted setup on my FreeBSD machine at > home. > > For now I've a raidz2 pool, which did contain root - however it doesnt > boot anylonger. > > I have a dedicated SATA disk with UEFI boot code and /boot data, so this > works and I can bootup. > > What I wanted to do now is now encrypt the devices of the pool, > > which should work in general because I can boot the kernel and thus the > kernel should be able to decrypt the required disk devices. > > > My issue is now that if I find anything on google etc, all examples want > me to put the keyfile on /boot and then provide it as an argument like: > geli__keyfile0_name="/boot/encrypted.key" > > This is something I dont want to do, instead I'd prefer that I put the > keyfile data on a single gpt partition of an usb stick of my choice - > > I can reach this device whenever I boot up... however it seems I can not > provide a /dev/... device just like this as an argument. > > I dont even know if the kernel is able to read raw data from a gpt > partition... but well why not? It should be possible? > > > Has anyone a clue how to archive this or which arguments I need to provide? I wrote a custom rc.d script to handle this. The core is: cd / && for i in *.key; do geli attach -p -k "$i" "label/${i%.key}" geli attach -p -k "$i" "gpt/${i%.key}" done I now relize I could do a if [ -c ] before each so I don't get the error message, but I wrote this a LONG time ago, and it wasn't a big deal to [not] see the error messages on boot... and before the above, I have code that mounts the device w/ the keys on it.. the -p is necessary in addition to the -k: -k keyfile Specifies a file which contains the keyfile component of the User Key (or part of it). For more information see the description of the -K option for the init subcommand. -p Do not use a passphrase as a component of the User Key. Cannot be combined with the -j option. -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not."