From nobody Sat Jun 24 13:40:34 2023 X-Original-To: freebsd-fs@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 4QpFcH66rhz4gdCp for ; Sat, 24 Jun 2023 13:40:47 +0000 (UTC) (envelope-from rick.macklem@gmail.com) Received: from mail-pg1-x52a.google.com (mail-pg1-x52a.google.com [IPv6:2607:f8b0:4864:20::52a]) (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 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QpFcG4XVVz434H; Sat, 24 Jun 2023 13:40:46 +0000 (UTC) (envelope-from rick.macklem@gmail.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20221208 header.b=b8jXnbz7; spf=pass (mx1.freebsd.org: domain of rick.macklem@gmail.com designates 2607:f8b0:4864:20::52a as permitted sender) smtp.mailfrom=rick.macklem@gmail.com; dmarc=pass (policy=none) header.from=gmail.com Received: by mail-pg1-x52a.google.com with SMTP id 41be03b00d2f7-5535efe37b7so904183a12.3; Sat, 24 Jun 2023 06:40:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1687614044; x=1690206044; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=maOtxhl+CY/OcvmQwpB5u+Inn7JN8yxHCllaC1jic70=; b=b8jXnbz76FStm66xBUivB/0X1QrfpKi8LaYWaFio0XCJSy46J8FL8gFXb9n6pJzJ1V wrQH1c1N8TARVgF61xBv+YHJpfBE9m22Jd3pnLZ7KjWE1O76bnJvi0nYm3Sd+atrrZnD SQ8ECIbX1mJPMG4+xlCSmcd2SY6SykYSwD4jiEx5ADjCkKTSRhaw5WAh/2U9B4fZ48Hy ZymT8rFk/ir0miVCPer/L3sa6pYa+4I6rSClTLi+CA8Ws4tg3M9r8zBBWInCNzpccn+t YN1qlFH/3e9Gh+So1rdivkgxPWVHwvfVRLjnYvtEWzD0omzx2wvW3cBTRha6F+xzUDmT hHqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687614044; x=1690206044; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=maOtxhl+CY/OcvmQwpB5u+Inn7JN8yxHCllaC1jic70=; b=igk4nHmuE4iuK8gaoR6YfpPUSDI2QEi6vuuD1w5M5nUIAQ43F5gNyguM2Q6ecidwnc q2ZS5sMwCxWdMRSPP157IG2O8E/rWGJNqqhKn4heMt2a5SZz7gANnRUrDZP6YPszXU68 eeR3AfOVu7fOKYZusGJn+PfmdP/iQt6TjyXeLh0pyYk7qPv86Oe2MzWz8Pzga+2RIYaF 5NRrq7xvoWEfN+rZNYq+gxCp6Jb+zoMP6O0b9viL3LuHSffizwALoaIafxbaablTHlc1 mJIrSpqkJyX5z/7iFCNmArLpOLD8x4qTgu683sIgnaeRdlIG8G581wcXenBGGKYHoheS 0qnw== X-Gm-Message-State: AC+VfDwBrZ1pE0uBR8XxOiNt9rfgZlKXs/TEJoM9RAFdFo9IWf0379Io 6Av5urEcwrlMVqksR6n0jo1VDV8hX/+3KWj8PTDNs2Q= X-Google-Smtp-Source: ACHHUZ4ZvOoNpkEAwkhdS69HfNoxmyEr7Ilv4UePDPgjfWSfyL4aJZGTgYSkrffs9yRZbcZalXnbS5AplkDg82FcY+A= X-Received: by 2002:a17:90a:2d89:b0:262:c66a:469b with SMTP id p9-20020a17090a2d8900b00262c66a469bmr603061pjd.12.1687614044335; Sat, 24 Jun 2023 06:40:44 -0700 (PDT) List-Id: Filesystems List-Archive: https://lists.freebsd.org/archives/freebsd-fs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-fs@freebsd.org MIME-Version: 1.0 References: In-Reply-To: From: Rick Macklem Date: Sat, 24 Jun 2023 06:40:34 -0700 Message-ID: Subject: Re: Diskless NFS over TLS To: Peter Jeremy Cc: freebsd-fs@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spamd-Result: default: False [-0.22 / 15.00]; NEURAL_SPAM_MEDIUM(0.99)[0.987]; NEURAL_HAM_SHORT(-0.98)[-0.979]; NEURAL_SPAM_LONG(0.77)[0.768]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20221208]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36:c]; MIME_GOOD(-0.10)[text/plain]; MLMMJ_DEST(0.00)[freebsd-fs@freebsd.org]; ARC_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; FROM_EQ_ENVFROM(0.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FREEMAIL_ENVFROM(0.00)[gmail.com]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::52a:from]; DKIM_TRACE(0.00)[gmail.com:+]; TAGGED_FROM(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; TO_DN_SOME(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCVD_TLS_LAST(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; MID_RHS_MATCH_FROMTLD(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-Rspamd-Queue-Id: 4QpFcG4XVVz434H X-Spamd-Bar: / X-ThisMailContainsUnwantedMimeParts: N On Sat, Jun 24, 2023 at 6:15=E2=80=AFAM Rick Macklem wrote: > > On Sat, Jun 24, 2023 at 2:24=E2=80=AFAM Peter Jeremy = wrote: > > > > I have a number of aarch64 SBCs that run "diskless": U-Boot loads > > boot.scr.uimg, loader.efi and the DTB via TFTP, EFI loads the loader > > config and kernel via NFS and passes the NFS root details to the kernel= . > > > > I am contemplating whether it's possible to use secure NFS for at least > > the root mount[*]. The problem is that NFS-over-TLS relies on > > rpc.tlsclntd to perform the STARTTLS and that needs a functional > > userland to run it. > At this point, I do not think the "tls" option can be added via "mount -u= ". > I had assumed that users would want "on the wire encryption, etc" to > be done right away, before any non-encrypted data travels across the > wire. > > I suppose allowing "tls" to be added via "mount -u" could be added to > the code. What do others think about this? > (It means that the file system mount would be running insecure for a whil= e.) > Btw, to make this work for your case would be non-trivial, since the old (non-TLS) TCP connection would need to continue to work until the TLS handshake upcal= l to the daemon is completed. And the, the TCP connection used for NFS RPCs would need to be switched to use the new TLS/TCP connection. This is not ho= w the krpc works now, so I am not exactly volunteering to do this, even if ot= hers think it is a good idea. rick > Can you put all the data that needs to be secured on a separate volume an= d > mount that from /etc/fstab? (I'm sure you have thought of this, but...) > Note that there is overhead in using NFS-over-TLS (mostly CPU overhead, > assuming you do not have hardware offload), so you only want to use it > when there is data that needs to be secured. > > rick > > > > > Does anyone have any idea how to proceed? Maybe something like mfsroot > > with the real root then overlaid over it (though I haven't thought this > > through). (And I realise that protecting the keys is problematic). > > > > [*] It would be nice to secure TFTP and the kernel load but that's less > > feasible. > > -- > > Peter Jeremy