Re: [nfsv4] Path forward for flex-files

Rick Macklem <rmacklem@uoguelph.ca> Sun, 06 August 2017 21:14 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 BCA61131EDD for <nfsv4@ietfa.amsl.com>; Sun, 6 Aug 2017 14:14:43 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.901
X-Spam-Level:
X-Spam-Status: No, score=-1.901 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-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 sMYaHnx2r_6x for <nfsv4@ietfa.amsl.com>; Sun, 6 Aug 2017 14:14:40 -0700 (PDT)
Received: from CAN01-TO1-obe.outbound.protection.outlook.com (mail-eopbgr670046.outbound.protection.outlook.com [40.107.67.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id B43171320EC for <nfsv4@ietf.org>; Sun, 6 Aug 2017 14:14:22 -0700 (PDT)
Received: from YTXPR01MB0189.CANPRD01.PROD.OUTLOOK.COM (10.165.218.133) by YTXPR01MB0192.CANPRD01.PROD.OUTLOOK.COM (10.165.218.136) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.1.1320.16; Sun, 6 Aug 2017 21:14:20 +0000
Received: from YTXPR01MB0189.CANPRD01.PROD.OUTLOOK.COM ([10.165.218.133]) by YTXPR01MB0189.CANPRD01.PROD.OUTLOOK.COM ([10.165.218.133]) with mapi id 15.01.1320.017; Sun, 6 Aug 2017 21:14:20 +0000
From: Rick Macklem <rmacklem@uoguelph.ca>
To: "nfsv4@ietf.org" <nfsv4@ietf.org>, David Noveck <davenoveck@gmail.com>, Thomas Haynes <loghyr@primarydata.com>
Thread-Topic: [nfsv4] Path forward for flex-files
Thread-Index: AQHTDvcuyDK3wnPfo0qo8KfOQeaI7w==
Date: Sun, 06 Aug 2017 21:14:20 +0000
Message-ID: <YTXPR01MB0189BCC08195A19BB0745A85DDB40@YTXPR01MB0189.CANPRD01.PROD.OUTLOOK.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-microsoft-exchange-diagnostics: 1; YTXPR01MB0192; 6:FyUeA3+Ygswc7ZMjQfxZa6bftAkF/JbpsU7UZZhx1szzWxTx6N/JDhu0R9oBQeicblssZGAzs7qvDDxPhMKW3Ma9fzxwWAQJ8Ha9HQBB79W5ABozDMb2OyVFoAzz77UCqrNPAe+d8yDuVQaEh1J3ptHLMHowFvC/coEdb1HiM7ASZkpqdq4Oq2N8oypnF3q8zfOv8KkMVh50bP/xRSNXhhvL+abX0JS/OFJFpbmvcor34tnoWbLKrNfdwIk89wYVrYPQGJy2P5SFy7f7ScdYZaXRgGYqpgSAK/b8U0s8jU+FMssOh0ULC9+J6TtUtEN7paX1cz+fzDrRcBzBBYMlqA==; 5:bBgJsinY2Jqhr81t1JADoFXQqlQfRW5rudwKzy6Rqg6gy90J/l8F8jLqWzRhYOfpwI82b4/nSqulVqLfw86E+PexX8G0o22IZSMANMOhhCTjd4iK+Aqf648OAGzIbFE0g3ZoPDIz9OYmUgPoR0nkyA==; 24:HS7lPA78nLAlE0cQMyaOCd/2W2sQsSRdMRlQr6wFdwPD6itdBoy9x/VpYfcRKBfbZEc2KxRsR3Gc940C9V0/WxBrLsZhTNM0LmblFsYDlLA=; 7:OH1L49vTIFKCap0J7rSkGSg/45N9ifD1mPAtarlIzM+aMoPbD3VoPXpwzheDX4aQhXF8tXlb9HnBWbASLkuRja2U2RpQ2VYyAQcccfnkwfN/Hpmzo2gDHeiHf5Pdu4YJt3Fa6feblERxYYT8qUUNODVOvBYoNktC7dP+MUlCe6COQTeQ15//Tl2Vng5XBq23QLhr5tNjRUdkYB4A9TzH17Myi6WNYMoLc63QxDDvktg=
x-ms-exchange-antispam-srfa-diagnostics: SSOS;
x-ms-office365-filtering-correlation-id: a3875c34-fc7e-477d-a4bc-08d4dd101b17
x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254152)(300000503095)(300135400095)(2017052603031)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:YTXPR01MB0192;
x-ms-traffictypediagnostic: YTXPR01MB0192:
x-exchange-antispam-report-test: UriScan:;
x-microsoft-antispam-prvs: <YTXPR01MB01926E44FEA48F3FB7A0372FDDB40@YTXPR01MB0192.CANPRD01.PROD.OUTLOOK.COM>
x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(8121501046)(5005006)(3002001)(10201501046)(93006095)(93001095)(100000703101)(100105400095)(6041248)(20161123564025)(20161123560025)(20161123558100)(20161123555025)(20161123562025)(201703131423075)(201702281529075)(201702281528075)(201703061421075)(201703061406153)(6072148)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:YTXPR01MB0192; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:YTXPR01MB0192;
x-forefront-prvs: 039178EF4A
x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(6009001)(39450400003)(39840400002)(39400400002)(39410400002)(189002)(199003)(3660700001)(3280700002)(86362001)(81156014)(81166006)(8936002)(6506006)(8676002)(229853002)(2906002)(6436002)(305945005)(55016002)(74316002)(2501003)(77096006)(106356001)(39060400002)(551544002)(105586002)(9686003)(5660300001)(53936002)(68736007)(6246003)(7696004)(54356999)(25786009)(102836003)(50986999)(101416001)(38730400002)(14454004)(478600001)(189998001)(33656002)(74482002)(2900100001)(97736004); DIR:OUT; SFP:1101; SCL:1; SRVR:YTXPR01MB0192; H:YTXPR01MB0189.CANPRD01.PROD.OUTLOOK.COM; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en;
received-spf: None (protection.outlook.com: uoguelph.ca does not designate permitted sender hosts)
spamdiagnosticoutput: 1:99
spamdiagnosticmetadata: NSPM
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-originalarrivaltime: 06 Aug 2017 21:14:20.8738 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: be62a12b-2cad-49a1-a5fa-85f4f3156a7d
X-MS-Exchange-Transport-CrossTenantHeadersStamped: YTXPR01MB0192
Archived-At: <https://mailarchive.ietf.org/arch/msg/nfsv4/jrLGOGHKtB9SPc44ZSegsICL4Cc>
Subject: Re: [nfsv4] Path forward for flex-files
X-BeenThere: nfsv4@ietf.org
X-Mailman-Version: 2.1.22
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: Sun, 06 Aug 2017 21:14:44 -0000

My Kerberos/RPCSEC_GSS is pretty rusty, but I think the following is a rough
description of something that might work for the "loose coupling" case.
(And now I finally know why the old draft referred to TGTs.;-)

First, I'll note that fattr4_owner and fattr4_owner_group isn't defined anywhere
and, if you just define is a opaque<>, with either "user@domain" or "<numeric-id>"
in it for the AUTH_SYS case, I doubt you will have to rev. the XDR. (Which makes the
path forward easier for us lazy implementors;-)

Anyhow, here goes...
Here's one way I think a "loose coupled" Flexible File Layout pNFS service
could use Kerberos/RPCSEC_GSS.
A few assumptions:
1 - The DS systems are vanilla NFSv3/4 servers that have Kerberos/RPCSEC_GSS
    support in them.
2 - This is Kerberos specific, which seems ok, since all extant servers
    will only support Kerberos mechanism.
3 - The MDS can somehow:
    - Create/delete entries from the password database (assuming DS servers
      implemented using POSIX-like users/uids/gids).
      (I know nothing about LDAP, but I'd guess this is doable?)
    - Create/delete User principals in the KDC with passwords that the
      MDS will know/set when these principals are created.

The MDS would create a synthetic user/uid/gid, adding it to the password
database. It would create an associated User principal of the same name
in the KDC.
- It would then acquire a "forwardable, renewable" TGT for this principal.
It could use this TGT to acquire an RPCSEC_GSS context for the DS, so it
could perform RPCs as this synthetic "user" against the DS.

When a client requests a layout:
- The MDS would reply with the TGT for the synthetic user in fatt4_owner, after
  encrypting it in the key for the RPCSEC_GSS context that the client has against the
  MDS for its LayoutGet RPC. (ie. It would GSS_Wrap() the TGT.)
  --> This is similar to what happens when a Kerberos client does a "kinit",
      except the ticket has been encrypted in the RPCSEC_GSS context key
      (which it knows) instead of a key based on the principal's password
      (which the client does not know).

The client takes the GSS_Wrap()'d TGT. GSS_Unwrap()s it and puts it in a
credential cache for the "synthetic user". (My Kerberos is rusty, so I can't
remember if the principal name is in the TGT? If not, it needs to be sent
along with the TGT to the client in the Layout.)

The client can then do the normal RPCSEC_GSS Init sequence against the DS
to get a context for the synthetic user. It can then use this context for
I/O RPCs against the DS.

If the Kerberos tickets have a short lifetime, but are renewable for a long
time, the RPCSEC_GSS context timeout will normally be set to that short
ticket lifetime and the client will regularily do the RPCSEC_GSS Init sequence again
to get new contexts.
--> This means that, once the MDS deletes the synthetic principal from the KDC,
    it won't work for long against the DSs, I think?
    (Deleting the principal from the KDC may be useful for fencing off, see
     below.)

I think the "gid" can be handled by using a second "synthetic principal" handled
in the same manner. (ie. It would not "own" the file but would have the "gid"
of the group for the file in the password database.)

One problem I see with is that the MDS may need "root" access to
the DS, if it is going to do fencing via a change in ownership.
(I think this is doable using Kerberos, but certainly weakens security.
 Something like putting a "root@REALM" user principal in the KDC and
 generating a keytab entry for it for the MDS. But having a keytab entry for
 "root@REALM" is pretty scary;-)
- An alternative that might be worth considering would be to have the MDS delete
  the synthetic principal in the KDC, so that clients can no longer use it to access
  the file on the DS?

rick