Re: [kitten] [EXTERNAL] Re: Windows Intent to revive and implement IAKerb draft-ietf-kitten-iakerb-03

Nico Williams <nico@cryptonector.com> Sat, 18 February 2023 06:07 UTC

Return-Path: <nico@cryptonector.com>
X-Original-To: kitten@ietfa.amsl.com
Delivered-To: kitten@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id A96D8C15DD44 for <kitten@ietfa.amsl.com>; Fri, 17 Feb 2023 22:07:11 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -7.098
X-Spam-Level:
X-Spam-Status: No, score=-7.098 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H2=-0.001, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_DBL_BLOCKED_OPENDNS=0.001, URIBL_ZEN_BLOCKED_OPENDNS=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=cryptonector.com
Received: from mail.ietf.org ([50.223.129.194]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 3IypY13RCElb for <kitten@ietfa.amsl.com>; Fri, 17 Feb 2023 22:07:07 -0800 (PST)
Received: from buffalo.birch.relay.mailchannels.net (buffalo.birch.relay.mailchannels.net [23.83.209.24]) (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 8C64EC151531 for <kitten@ietf.org>; Fri, 17 Feb 2023 22:07:07 -0800 (PST)
X-Sender-Id: dreamhost|x-authsender|nico@cryptonector.com
Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 7524E5414AF; Sat, 18 Feb 2023 06:07:06 +0000 (UTC)
Received: from pdx1-sub0-mail-a299.dreamhost.com (unknown [127.0.0.6]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id E4EE454136D; Sat, 18 Feb 2023 06:07:05 +0000 (UTC)
ARC-Seal: i=1; s=arc-2022; d=mailchannels.net; t=1676700426; a=rsa-sha256; cv=none; b=QU6mMfpGT3YyEcPo27Di8Bk5uVfbjMu/TFkq85xue2WEA17xiPQSc0hLgZi5z4JBikcSd9 z7/WG2nn9AKYtCwWNJfoyOhv3qzVwVtsfCB6PWSGhOY8qgeId31go/skBqnJE+l8gPzQEk MKIYPzI9XwUvXcpxH5RaN2SZ/v2vU6cveBD39SxDaW64weoMnrBXJgTqCagZredwEl4SZR TcO7zlfuuw7ssQTLLciV0frmUpDeuduTZLnhm334YELX2lpphu8oyVycQytiuVkiCtdN69 d+q33b6HLXwxKT3Bx9Ol3O3lWnUiWaRzXUKVqve4kMrrvD8l0GDwSVptYF6Yfw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=mailchannels.net; s=arc-2022; t=1676700425; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references:dkim-signature; bh=6g8Ys+B+b370sHeG9W9L4D4SYPB5bJuDgfqHylGEoWk=; b=lzlMnj5g7+q5kpRtK3vp5WvDP1I4a6tH5vCyrwQlvcGn+WfUt9xVQkzFY1+yFukhjIO/m/ 1p8kNXwhb9pqucdaWTWx4lAXWTUOKb3mNueV2fhRP4d6HsKjiy+HVpVuepItBGoTKibI/S 5ZyHaoEx3EVgdMH5O75gLelvZrfGuhmhAwRrbx8OkVpnIWMwdk6jO5rCRwK/nZTZQS9oXc +kxtSoIxF/Im9IpC6WIXhfBMZTbEEaaajimUdvfLwgxSd7FkY2AYENp5yclLmk2SeR6Wxx 7OpsZL5TndMUaQ7I5Q2NC3mLAkQ2AWfZWVHWtkW4KLKcvBqkylvFKaAvgzxQTQ==
ARC-Authentication-Results: i=1; rspamd-5db48964c-ckdrb; auth=pass smtp.auth=dreamhost smtp.mailfrom=nico@cryptonector.com
X-Sender-Id: dreamhost|x-authsender|nico@cryptonector.com
X-MC-Relay: Neutral
X-MailChannels-SenderId: dreamhost|x-authsender|nico@cryptonector.com
X-MailChannels-Auth-Id: dreamhost
X-Squirrel-Eyes: 04e7e50964f64b60_1676700426204_1168671769
X-MC-Loop-Signature: 1676700426203:2331350579
X-MC-Ingress-Time: 1676700426203
Received: from pdx1-sub0-mail-a299.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384) by 100.103.24.47 (trex/6.7.1); Sat, 18 Feb 2023 06:07:06 +0000
Received: from gmail.com (075-081-095-064.res.spectrum.com [75.81.95.64]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: nico@cryptonector.com) by pdx1-sub0-mail-a299.dreamhost.com (Postfix) with ESMTPSA id 4PJdVx0cs7zJG; Fri, 17 Feb 2023 22:07:04 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cryptonector.com; s=dreamhost; t=1676700425; bh=6g8Ys+B+b370sHeG9W9L4D4SYPB5bJuDgfqHylGEoWk=; h=Date:From:To:Cc:Subject:Content-Type; b=ldr4URLKrYTTqu9FfMKeZOf1Sfuyd4czG4/6Tfz7VB6odyufMjk/+za8+Maf0+Dkm bPqwnZpzOG7p5AgRbWyYZkGVvqV4fulCY+bzWNSC0excYrMWZQ3dmj1vHWYa0jgKRk md5iLKpFNZ8l6tbaDx+P33bZ7Xdb0GqaqnzsSEFiss1nNIytukgY8Qxk+SeCCglpXV E+5emioRUyyJZzmKVKD7upD5U/lZ2ReLPGq3BNL9WfXSAGRxGC6j5pa7kpUpv/9F73 lKRbMLpv+a+KmdkI9tlKO1rB76p4mpwcEPi4VnNnsriA+itut1+bSjaEwNZAuIwhSa C66eFk3Oww4+w==
Date: Sat, 18 Feb 2023 00:07:02 -0600
From: Nico Williams <nico@cryptonector.com>
To: "Steve Syfuhs (AP)" <Steve.Syfuhs@microsoft.com>
Cc: Luke Howard Bentata <lukeh@padl.com>, "kitten@ietf.org" <kitten@ietf.org>
Message-ID: <Y/BrBlD9NjduwyiE@gmail.com>
References: <MW4PR21MB1970A9D254B943A1763C55FF9CA09@MW4PR21MB1970.namprd21.prod.outlook.com> <de4cbe7b-85b5-7001-3a8c-74787990c6e0@secure-endpoints.com> <eb9fa7a4-a00d-f388-27aa-3624df8ce4f2@secure-endpoints.com> <MW4PR21MB197060FB388E7922FAADEB079CA19@MW4PR21MB1970.namprd21.prod.outlook.com> <Y/AYFbD6wCrszskG@gmail.com> <Y/AamL5pPJW1sYrv@gmail.com> <MW4PR21MB1970AEAB4ABD68C0059A2AB99CA69@MW4PR21MB1970.namprd21.prod.outlook.com> <Y/A4eirujnDjO+46@gmail.com> <E1A16BAA-9B3D-4D63-96F5-6DD150DB0D6F@padl.com> <MW4PR21MB19709BF16824B097019F5EC19CA69@MW4PR21MB1970.namprd21.prod.outlook.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Disposition: inline
In-Reply-To: <MW4PR21MB19709BF16824B097019F5EC19CA69@MW4PR21MB1970.namprd21.prod.outlook.com>
Archived-At: <https://mailarchive.ietf.org/arch/msg/kitten/F8eKpW10jkJ3WriFoRtmH2ql6YI>
Subject: Re: [kitten] [EXTERNAL] Re: Windows Intent to revive and implement IAKerb draft-ietf-kitten-iakerb-03
X-BeenThere: kitten@ietf.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: Common Authentication Technologies - Next Generation <kitten.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/kitten>, <mailto:kitten-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/kitten/>
List-Post: <mailto:kitten@ietf.org>
List-Help: <mailto:kitten-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/kitten>, <mailto:kitten-request@ietf.org?subject=subscribe>
X-List-Received-Date: Sat, 18 Feb 2023 06:07:11 -0000

On Sat, Feb 18, 2023 at 04:56:24AM +0000, Steve Syfuhs (AP) wrote:
> Ah, I think I follow the failure case now Nico. I'll have to think
> about this in the generic case. In Windows our implementation [...]
>                                                          [...]. This
> doesn't help with non-Windows clients though.

We can do a non-generic thing if need be, and we can find a way to stash
the information we need in a way that related mechanisms can see, much
like what you're doing.

> For single shot I just mean encapsulation protocols that can't
> round-trip. [...]

Right.  About that.  There's two important sub-cases:

 - mechanisms that can generate session keys for wrap/unwrap ("security
   layers" in SASL speak),

 - and ones that can't.

For the latter the JWT pattern is practically canonical -- we could do
PKIX-oriented variations and who knows what, but at the end of the day
we get a bearer token of some sort that can be validated and which
carries metadata we want (e.g., the presenter's name, claims, etc.).

For the former the common patterns are:

 - Kerberos -- we're all familiar with it here

 - mech_dh

In mech_dh the initiator looks up the target's public [EC]DH key in a
directory, then it computes a shared key given the initiator's private
key and the target's public key, then it constructs an authenticator
(like the one in AP-REQ) and sends that and stuff that lets the target
know and validate the initiator's public key.

mech_dh looks and feels a lot like Kerberos, except it's actually dead.
mech_dh has a "single-shot" mode, and a mutual mode just like Kerberos.

JWT enriched with an ECDH public key for the user and a way for the
client to find the audience's public key would... look a lot like
mech_dh: you get to have a session key if you want it, but also you
don't have to use it if you don't want it, and you get to do it with a
half round trip (single shot).  You can even do channel binding in a
half round trip mechanism since there's always a way for the server to
reject auth.

Enrich that further with Kerberos style names and what not (PAC,
whatever) (for backwards-compatibility), and you have something that can
function as a drop-in replacement for Kerberos.

(Mind you, the PAC should be replaced with a URI for the PAC.  Ticket
bloat is a serious problem.)

Things about Kerberos that are fairly good and worth keeping

 - naming

 - in a PQ world, maybe, Needham-Schroeder as an optimization for
   expensive PQ PK

Things about Kerberos that suck:

 - that the client has to have heavy, bloaty libraries

   (Well, I have implemented a Negotiate-token-issuer service, so it's
   possible to do Kerberos with dumber clients that don't even implement
   a single Kerberos enctype.  But this would have to become widely
   used.)

 - that the claims are encrypted (in the Ticket)

   This is both awesome for security (servers can't fail to validate the
   token) and terrible (hard to observe for diagnostics, etc.).

   (Confidentiality of the ticket/token contents is not that important
   in a world where every application protocol runs over TLS, so I don't
   count that feature as a win.)

   I've also build an HTTP-based service for fetching keytabs, and a
   feature where service principals in a namespace can exist no matter
   what, with their keys being derived from the namespace's keys, the
   principal's name, and the "current epoch".  Servers have to keep
   fetching keytabs the way they also have to keep fetching JWKs for
   validating JWTs.  So Kerberos can be easier to deal with than it
   usually is, but few if any sites make it as easy to deal with as JWT.

 - that it's not JSON-based

   It's not that I love JSON, but the thing is that even with
   now-defined GSS functions for accessing authorization data: it's a
   lot of work just even to _use_ those functions, and even more work to
   implement them.  With JSON there's nothing special to do besides
   define bits of schema.

   It's not that DER is awful -- it is, but protocol buffers is also a
   TLV encoding, so that's not the issue.  _All_ TLV encoding are
   terrible, of course, but the real issue is that ASN.1/DER tooling
   does not exist for _every_ programming language.

   Practically every language has at least one JSON library.  Where a
   language doesn't then the average programmer can figure out how to
   build or port one -- as dangerous as that can be, doing the same for
   DER is far more dangerous and a far larger cognitive load.

> You have captured the exact problem with unknown names. We can extend
> the protocol to solicit an SPN, and it turns out if you're willing to
> look the other way on good protocol manners, this can work today
> within spec. We just lose server auth. This *is* a net-win for
> security still, just not much of one.

Makes me wince hard.  You can mitigate the problems with this by having
the client tell the KDC that it's doing this so that the KDC can refuse
if the target is not trusted for this.

Eventually you'll have to break apps that do the insecure thing.

> One other thing I was thinking about. We came across a fun
> fragmentation bug in SPNego that's probably been around forever. When
> one party has a limited buffer size and we aren't allowed to allocate,
> we will fragment the message, where the other party sends an empty
> message to indicate gimme-more until full. The client->server flow has
> always worked, but the server->client flow was never implemented (when
> is the REP ever bigger than the REQ? Now any time it's not an AP). The

Ooof.  You can also have large replies when doing user-to-user auth.
Also if we had a reverse mode mechanism, or if we had some sort of more
symmetric mechanism (where the reply to an AP-REQ is also an AP-REQ so
both peers can see each other's PAC).

> bug, aside from lack of implementation, is that callers tend to assume
> responses with continuation are not empty and fail if they are. I've
> fixed it by always sending a specific value to indicate more is
> requested, but who knows how that plays with interop. Frankly I
> haven't done my research within all the RFCs to see if there's already
> an answer for this, but figured I'd include it here if folks have
> thoughts.

The fragmentation thing is a hack, but oddly it's a hack that Heimdal
has too (in master).

Nico
--