Re: [nfsv4] NFS over TLS for floating clients

Rick Macklem <rmacklem@uoguelph.ca> Wed, 01 April 2020 20:36 UTC

Return-Path: <rmacklem@uoguelph.ca>
X-Original-To: nfsv4@ietfa.amsl.com
Delivered-To: nfsv4@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id B39323A0816 for <nfsv4@ietfa.amsl.com>; Wed, 1 Apr 2020 13:36:12 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.9
X-Spam-Level:
X-Spam-Status: No, score=-1.9 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 2xusNL4069be for <nfsv4@ietfa.amsl.com>; Wed, 1 Apr 2020 13:36:10 -0700 (PDT)
Received: from CAN01-TO1-obe.outbound.protection.outlook.com (mail-eopbgr670082.outbound.protection.outlook.com [40.107.67.82]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 9F7E73A0819 for <nfsv4@ietf.org>; Wed, 1 Apr 2020 13:36:10 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=c35S0tF4adiB9ZhbN47b1olQh2rU5l6YrVkhrLSgFqw3AScmiO8h8uR9btfYE6jBvLYavbsF46IkgGNFrb4cBjXZY/05GNFjNPPWmdT+NMYvLGXGNFH3xA04D82abp75j5ryvw+mGCg04CIJatgFvsIQEX7iBJNpp3npb0ZG2xH5cc6BwvsX2CzwmPazU/X+EzhuMoiLHGkiC60vWGtihi37MjBWxowAbF6uo853ztqrLzLaImUUOb7/bSbB7q4MaaOgk2VxqbLXMmY0/SGPu4KigHrt1LKJqK9OcWOI6vOb5ESKvi4BEar435aJ0LOR2p/gEZLggw+7Y4kOHAgJBg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=JtP8+haAUWASUqhuf7wfbhs/iMDhXfFq4ikvPFaDTEo=; b=hEsmpR+pZ+Vvim9+yurBts5Crk/slbtgKa/92YCmNAY04neo80Ioc9kBUwMhYKzGPU3zlRch1ecVYhrALtga1/hc/cEe+UVY5YMcZWVXIOzV2UQkN7pN0425u6qsd0xw9YLWRK0Pistu2ree2FOdJNyNZp68DDFdrz0liK6S+yHP0xfowxl+zTIkBuJq+SEvkuyuaKHkPqNI1U6D9UCPOOwiLSUeeSE9XM4yw8jD2nOqrRzfIf5i2RNhGlKFTlO1CxUw2gyTv8is7U6stKulBfPmdy8Jr/dtgED8bTgNtO46IfutFoGurWaHusV7cpNTMA20DTqZlVOMMGmtqf1xtw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=uoguelph.ca; dmarc=pass action=none header.from=uoguelph.ca; dkim=pass header.d=uoguelph.ca; arc=none
Received: from QB1PR01MB3649.CANPRD01.PROD.OUTLOOK.COM (52.132.86.26) by QB1PR01MB3075.CANPRD01.PROD.OUTLOOK.COM (52.132.88.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2878.15; Wed, 1 Apr 2020 20:36:08 +0000
Received: from QB1PR01MB3649.CANPRD01.PROD.OUTLOOK.COM ([fe80::ed8c:7662:79ba:5f9f]) by QB1PR01MB3649.CANPRD01.PROD.OUTLOOK.COM ([fe80::ed8c:7662:79ba:5f9f%5]) with mapi id 15.20.2856.019; Wed, 1 Apr 2020 20:36:08 +0000
From: Rick Macklem <rmacklem@uoguelph.ca>
To: Chuck Lever <chuck.lever@oracle.com>
CC: "nfsv4@ietf.org" <nfsv4@ietf.org>
Thread-Topic: [nfsv4] NFS over TLS for floating clients
Thread-Index: AQHV82BAxp9O6fa7qEu4EnWyACrtOKg77jqAgAAISoCAADDgO4Aiyq+AgAGITzuAAP8BAIADVu41
Date: Wed, 01 Apr 2020 20:36:08 +0000
Message-ID: <QB1PR01MB36495316F6F1973CC18BBB55DDC90@QB1PR01MB3649.CANPRD01.PROD.OUTLOOK.COM>
References: <YTBPR01MB337482A9420C1AEF05466D3FDDE30@YTBPR01MB3374.CANPRD01.PROD.OUTLOOK.COM> <CAABAsM7mSfULv974gPQmCSt+Nt2zdH1wMvemwPXw365SeEGTQg@mail.gmail.com> <CAMhwm99ZUf5fshkkOtRyf2u8DjeRLdVk=Q05H8YF4A+ycZi8fA@mail.gmail.com> <YTBPR01MB337418573DE1D692BC029012DDE30@YTBPR01MB3374.CANPRD01.PROD.OUTLOOK.COM> <20200329015025.GK50174@kduck.mit.edu> <QB1PR01MB36490F5BFC5CC7ACCF41D230DDCB0@QB1PR01MB3649.CANPRD01.PROD.OUTLOOK.COM>, <0CB92024-0157-4896-B97D-68CF4B72358D@oracle.com>
In-Reply-To: <0CB92024-0157-4896-B97D-68CF4B72358D@oracle.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
authentication-results: spf=none (sender IP is ) smtp.mailfrom=rmacklem@uoguelph.ca;
x-ms-publictraffictype: Email
x-ms-office365-filtering-correlation-id: f02444ff-e270-4fd7-a59a-08d7d67c4ef2
x-ms-traffictypediagnostic: QB1PR01MB3075:
x-microsoft-antispam-prvs: <QB1PR01MB3075673B0F3157A5AC4F3B17DDC90@QB1PR01MB3075.CANPRD01.PROD.OUTLOOK.COM>
x-ms-oob-tlc-oobclassifiers: OLM:10000;
x-forefront-prvs: 03607C04F0
x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:QB1PR01MB3649.CANPRD01.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFTY:; SFS:(10009020)(366004)(396003)(376002)(136003)(39860400002)(346002)(786003)(316002)(7696005)(55016002)(9686003)(186003)(76116006)(81166006)(66476007)(81156014)(86362001)(2906002)(71200400001)(4326008)(478600001)(66446008)(52536014)(53546011)(6506007)(33656002)(66556008)(8676002)(64756008)(5660300002)(6916009)(66946007)(8936002); DIR:OUT; SFP:1101;
received-spf: None (protection.outlook.com: uoguelph.ca does not designate permitted sender hosts)
x-ms-exchange-senderadcheck: 1
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: IvMxHh5jQUEfJ8r2KDmvTNwJJQSsIFQ9PzE30GoBOahASNXdNHdwXBSYytI+ex5vhQXtHvtD3EveJSX5qWTmdJN8oaxDk6enAK533ydEo5eTTgpkfwhplgLpEEuk7IJWx6H/+iQsVoy3TcP9rDk6zffSSsjsFMcHHsU0iWgRWgn9yWxf9dc+/CNI1DWAICDCNF1pc1aQqZlgVKXK0t4HmOJxSoGymJF134A5LrCrU4f/WsuziFupjk3o7ga+9cUkzTHmAQ718AECUwWllzde/hd/uGIwUAHPCwQqjyx4aUMVykw3Kt+1Bl19gsfSW3oaNOYwz94ifjUrBrAXD+0WgfA0n5M0HdjZllOv8kFhF7Juq7kFGMWipNvU0ehjEBfz59icLE2LlWqdCGuN2/YH9YlEHbkYy9Ix9al6Gv1kLsQcR/AHiR9bRHUWrRvKME7L
x-ms-exchange-antispam-messagedata: ETMmxyncO8Y3y28poJxdEQYlUPMOaiT0iO67/l8aJnZIgvczG5zbc6GiZ5q6iig5JU3Nh8mpsdEcnCB7ZbfbdH4aOy0yPsqWRat58EVHzM5TVrKJiepsMXclcIkZPxmzRYUZ39f1T4NZJUsqvhNUzkf6pf61nN8brXmAqk6B2xER/qYSGdn/VKpsuYVnjd4tCyJ4x+SQKscmujqPLk55Qg==
x-ms-exchange-transport-forked: True
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-OriginatorOrg: uoguelph.ca
X-MS-Exchange-CrossTenant-Network-Message-Id: f02444ff-e270-4fd7-a59a-08d7d67c4ef2
X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Apr 2020 20:36:08.4308 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: be62a12b-2cad-49a1-a5fa-85f4f3156a7d
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: B2Ziri1WL6aGaS27ED0F1waCGnsCfJC2pkvvalJL/CsliJaEEXWbdTfpAn1ZGPhjWcw9r84YPsr54p32M2D9Mg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: QB1PR01MB3075
Archived-At: <https://mailarchive.ietf.org/arch/msg/nfsv4/PZCK8jPrpCUoGHEoPJPJ-k_DUO0>
Subject: Re: [nfsv4] NFS over TLS for floating clients
X-BeenThere: nfsv4@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: NFSv4 Working Group <nfsv4.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/nfsv4>, <mailto:nfsv4-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/nfsv4/>
List-Post: <mailto:nfsv4@ietf.org>
List-Help: <mailto:nfsv4-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/nfsv4>, <mailto:nfsv4-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 01 Apr 2020 20:36:13 -0000

Chuck Lever wrote:
> On Mar 29, 2020, at 10:16 PM, Rick Macklem <rmacklem@uoguelph.ca> wrote:
>>
>> A case I've coded up that may or may not be allowed by the current draft is:
>> - Optionally, if the client presents a certificate to the server that verifies and
>>   where the CN is of the form "user@dns_domain", then this "user" is translated
>>   to a set of credentials used for all RPCs on the TCP connection instead of
>>   what is   provided in the RPC request header. I put "user" in quotes because
>>   I think you can argue that this is the identity of the client host and the server
>>   chooses to assign credentials to that client identity.
>>   (Basically, I'd argue that, for laptops, the line between "user" and "host" is fuzzy
>>    and normally one and the same.)
>>
>> As for the current draft, it says:
>> (end of sec. 4.2)
>> In either of these modes, RPC user authentication is not affected by
>>   the use of transport layer security.  When a client presents a TLS
>>   peer identity to an RPC server, the protocol extension described in
>>   the current document provides no way for the server to know whether
>>   that identity represents one RPC user on that client, or is shared
>>   amongst many RPC users.
>>
>> True, although there is the case where there is only one user on the client
>> and that is known by the server administrator.
>>
>> Therefore, a server implementation must not
>>   utilize the remote TLS peer identity for RPC user authentication.
>>
>> I would argue that this is a server implementation choice and does not
>> affect the protocol.
>
>I don't fully understand this statement, but the protocol described in
>draft-ietf-nfsv4-rpc-tls forces this choice to be "does not utilize
>the TLS peer identity for RPC user authentication."
Btw, when I said "does not affect the protocol" I was referring to what goes
on the wire. The only thing that changes in the content of the client's certificate,
which is not covered by this document (except for where the DNS name goes).
--> Actually I am surprised that Ben and others accept putting the DNS name in
      the CN field of subjectName and aren't insisting it be in the DNS field
      of the subjectAltName. (I, personally, don't care.)

>IMO we cannot
>relax this requirement in this protocol, though it can be revisited if
>RPC is made to handle user authentication with certificates: I will
>be discussing that possibility during our interim meetings in April.
>
As you'll see below, I am not talking about user authentication, I am
referring to what credentials are being used for an RPC, which I believe
is a server configuration issue.
FreeBSD NFS server have had a "-mapall" option which says "use these
credentials for all RPCs for a very long time (since the 1980s, I think?).

>A connection/TLS session uses exactly one pair of certificates for its
>entire lifetime: a server cert and a client cert (let's set aside the
>"no client cert" case for a moment).
>
>After the TLS session has been established, in general a client is free
>to send multiple RPC user identities on that connection. Users have no
>association with the certificate the client used to establish that
>session.
Yes, I understand all of the above.

>
>The certificates here are used to establish secure communication between
>two hosts. They are not intended to be used for authenticating RPC user
>identities, period.
Yes, I understand that you do not want to address user authentication, which
the draft clearly defines as the credentials in the RPC request header.

Another way to put what I am doing is:
- The server derives "machine credentials" from the client's certificate.
  The server then chooses via server configuration what RPCs are performed
  using these machine credentials instead of the user credentials derived from
  the RPC request header.

I know that Sun RPC has never had the concept of machine credentials and
that is one reason why it has not been a great fit for NFSv4, since NFSv4 does
use machine credentials.
- The workaround has been for the NFSv4 server to define the user credentials
   used for the first ExchangeID (SetClientID) operation as the machine credentials
   that must be used.
   For AUTH_SYS, this is typically the infamous uid == 0.
   For RPCSEC_GSS (Kerberos mechanism), it has typically required:
   - host based principal being created on the KDC.
   - keytab entry for this principal being created.
   - this keytab entry being copied to the client via some secure method.
(I won't bother to mention what credentials actually get used for callbacks.
 I'll admit I don't even understand how to do callback user credentials via
 RPCSEC_GSS. I think most just use AUTH_SYS with uid == 0 and clients mostly
 ignore the RPC request credentials for callbacks?)

It might make sense to look at using client certificates to create machine credentials
in the future?

I am fine with this not being allowed by this spec. I will simply document that.
However, you could state:
Creation of machine credentials from peer certificates is out of the scope of
this document.

>We do not want to alter RPC user authentication at this time. If using
>a certificate to identify an RPC user is something we _do_ want to do,
>and we most likely do want to allow it eventually, then that will
>require a different set of changes to the RPC protocol, and not just at
>the transport layer.
I have no idea what you are considering, but if it is along the lines of
clients providing separate X509 certificates for each user,
I think that would require:
- generation of certificates for every user
- copying these certificates into a database on each client in some secure
  manner.
  - You almost have to generate a separate certificate for each user for each
     client (ie. #clients * #users).
--> Too much administrative overhead, in my opinion.
It is easier (and a better fit, imho) to just use Kerberos for this case and it
is already implemented and works.

However, I do think that a certificate is a good fit for machine credentials,
which is not a good fit for Kerberos (the above exercise of host based principal...).
Having a way for clients to do a Kerberos NFSv4 mount without the host based
principal in a keytab on the client, would make Kerberized NFSv4 easier, I think?

>> (in sec. 7.3)
>> In light of the above, it is RECOMMENDED that when AUTH_SYS is used,
>>   every RPC client should present host authentication material to RPC
>>   servers to prove that the client is a known one.  The server can then
>>   determine whether the UIDs and GIDs in AUTH_SYS requests from that
>>   client can be accepted.
>>
>> I would argue this is what the above case does.
>>
>> The use of TLS does not enable RPC clients to detect compromise that
>>   leads to the impersonation of RPC users.  Also, there continues to be
>>   a requirement that the mapping of 32-bit user and group ID values to
>>   user identities is the same on both the RPC client and server.
>>
>> Doing the above solves/avoids this problem.
>>
>> I do feel the above case can be useful (optionally, not always) and I would
>> appreciate comments w.r.t. it.
>> If others think it is a reasonable approach, it would be nice if the draft allowed
>> it, but I can leave it in the FreeBSD code, noting it is "non-RFC conformant".
>
>IMO you should wait until the RPC protocol has a purpose-built mechanism
>for user authentication via certificates, then implement a client that
>presents the same certificate to establish a TLS session as it does to
>identify its only user.
As above, I'm not convinced this is practical.

>However, you can probably make your current proposed implementation a
>little more future proof:
>
>An NFS client should use AUTH_NONE for your use case, since the NFS
>server ignores the client-provided RPC user identities. Maybe the server
>should enforce the use of AUTH_NONE. That would possibly navigate around
>the restriction stated in rpc-tls that the server cannot use the client's
>TLS identity to make RPC user-specific authentication and authorization
>decisions.
I don't believe extant NFSv4 clients can be configured to use AUTH_NONE
for all RPCs. What I am doing should work with an extant NFSv4 client once
it has RPC-over-TLS support (I'm assuming client's will consider the X509
certificate is an opaque blob that is only used for the TLS handshake).

>Add the following per-export controls on your NFS server implementation:
>
>- A control requiring a TLS connection to access the shared filesystem.
Yes, this exists in my implementation as the export option "-tls".

>- A control requiring the client to present a certificate to establish
>a TLS session (ie, the server should prevent TLS with anonymous clients).
Yes, this exists in my implementation as the export option "-tlscert".

>- A control that enables mapping between the client's TLS identity to a
>particular user identity that already exists on your server. The mapping
>should happen via NFSv4 id-mapping. Then the server can map both user-
>specific or client certificates to particular local user identities.
As above, I do not think user specific certificates is practical.
(Of course, feel free to prove me wrong;-)

>
>It's significantly more secure if the server is pre-configured with
>known user/client identities. Then, if the server does not recognize a
>client's certificate, it rejects the attempt to establish a TLS
>session.
I also have the "-h" option on the server side TLS handshake daemon,
which states that the client's certificate must have a DNS name that
matches the reverse DNS name for the client's IP address.
--> This is on the daemon and not in exports, since for this case,
      the IP address presented by the client is not trusted and, as such,
      the exports file cannot be applied to it until it has passed this
      requirement. (With "-h" it follows RFC 6125 style verification, but
      for on the server for a client certificate and not the other way around.)

rick

--
Chuck Lever