Re: [kitten] Stating support for HTTP-SASL on the HTTP WG list

Nico Williams <nico@cryptonector.com> Tue, 07 February 2023 16:32 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 E5B44C17CE8F for <kitten@ietfa.amsl.com>; Tue, 7 Feb 2023 08:32:36 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -7.097
X-Spam-Level:
X-Spam-Status: No, score=-7.097 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_BLOCKED=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 eXyUhknEDw-R for <kitten@ietfa.amsl.com>; Tue, 7 Feb 2023 08:32:32 -0800 (PST)
Received: from olivedrab.birch.relay.mailchannels.net (olivedrab.birch.relay.mailchannels.net [23.83.209.135]) (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 D0172C1575A1 for <kitten@ietf.org>; Tue, 7 Feb 2023 08:32:31 -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 79C2E501B78; Tue, 7 Feb 2023 16:32:30 +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 00475501AE2; Tue, 7 Feb 2023 16:32:29 +0000 (UTC)
ARC-Seal: i=1; s=arc-2022; d=mailchannels.net; t=1675787550; a=rsa-sha256; cv=none; b=6O1HlS+HNuG3AsyWDH3eLJmto76AGO8OtHiGN7S6vW2O0V9F3l565lOJPwYyZZVirGUZlT zEyPtACo5VGBUBnv/xtbXXExWCMT9ZAcR1Kh7TtMvwoZveFOlNz3mU3ugVMMDkSbx60vnd oWFQOnFed0N/teyO4tMGDUqUtuHg253EkB4Xaw7Dy9Q8iv7u/R8Ds5JYJBIgQg5IYGq+uz OjswOmWdEwUbVktM+gqyrzl9PiQ/nbvAAs4GOw0EwwsbcEuV/Ipyw3A9CtV34TDDC0DA/Q e4lzew7meyPfZBsQDTbXqtkTi4tiwXsYoE3QHbRBtln+d3/rv8iceFr7WQUjeA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=mailchannels.net; s=arc-2022; t=1675787550; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references:dkim-signature; bh=ryC5hPY6DONbLr43gI060cxZtjams3Gfzju8zADPGNY=; b=8ojJjIdHaI6vkOrF3bEcGXShagjX5W/+v4KnMCFhaAeS0VI3gxSZMRxTx0dX7jNc32cNRg Org3a4hlyzLcpkUIn6PlfCrLEVQalrUldl06CmNud+LQsNrkNPWg1IbIDLDE1qkcXSoPYH 9Ga2ydsSR+eh0/bYVWRlovj3jcy8MgqUInuQmlOtTgVYGciTYf+cLAkUgxcbFTJybZSp48 XR/y2YvmpMFxSnX5QWIMg6yIvEYG9az4VH6ZIoCYbFoAHyGDh1bkmhW1iKgjFlhC7Nn06p 8HUgJJno/RgmE1Q3kMFltzJjzAL0qpRnOJxBjwDDCW2ghHVuQmr4387D8ppdhg==
ARC-Authentication-Results: i=1; rspamd-98dc9695d-wzq6k; 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-Reign-Harmony: 1ead70d70a5513e7_1675787550302_3822437062
X-MC-Loop-Signature: 1675787550302:2396416603
X-MC-Ingress-Time: 1675787550301
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.99.229.28 (trex/6.7.1); Tue, 07 Feb 2023 16:32:30 +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 4PB7vd1rxXz35; Tue, 7 Feb 2023 08:32:29 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cryptonector.com; s=dreamhost; t=1675787549; bh=ryC5hPY6DONbLr43gI060cxZtjams3Gfzju8zADPGNY=; h=Date:From:To:Subject:Content-Type; b=K+msyE9wT9jFQ/ULwWkCsOPVca4R1GBHoc3tzrP/LP43bYNjK8ycAERv9RQmv2wt9 1OQfjX6fkrVPsVotydXHuxOh3BbzLFZwEpagHVPVxjfh1n17eFJYGIZRXzIb62Ooha GmHYfEA1qZFn+MztMK5yNPxn1MsPjJMnJ1HlXuwl7Irksan+Qk3fFa4zJYS9/o/Oi+ 9cXgxMFdxOvyy7IwiI4JGS2TPw0df+TnYTkSpJsqtFC0S+n/hpYlRrU8RAeQRbx8bP 10gMHomTwMvxNbE/35zA0MVX6atR/Jj1ltyP/37paf7auhlgKOuGupts/lDR5UpLwq em8GqxX5/4xGw==
Date: Tue, 07 Feb 2023 10:32:26 -0600
From: Nico Williams <nico@cryptonector.com>
To: kitten@ietf.org
Message-ID: <Y+J9Gj4rrZnbqHs5@gmail.com>
References: <20230127160101.GB635@openfortress.nl> <Y9QOTlS5Pmv47brx@gmail.com> <20230207102348.GA30583@openfortress.nl>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Disposition: inline
In-Reply-To: <20230207102348.GA30583@openfortress.nl>
Archived-At: <https://mailarchive.ietf.org/arch/msg/kitten/-dugSkgYY_HZx03AOjgQzSDvhS0>
Subject: Re: [kitten] Stating support for HTTP-SASL on the HTTP WG list
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: Tue, 07 Feb 2023 16:32:37 -0000

On Tue, Feb 07, 2023 at 10:23:48AM +0000, Rick van Rein wrote:
> > you'd end up
> > with a two-layer negotiation, and we've learned that two-layer
> > negotiations are problematic.
> 
> I can see the problem if the layers require separate messages, because
> you will have made a choice and cannot trace back.  If it is a matter
> of calling a few software stacks, that is a host-local problem.
> 
> The SASL-level mech list is included in the very first 401 message, along
> with the HTTL-level option to use SASL,
> 
> HTTP/1.1 401 Unauthorized
> WWW-Authenticate: SASL realm="members only"
>     mech="SCRAM-SHA-256 SCRAM-SHA-256-PLUS GS2-KRB5-PLUS GS2-KRB5"

This can (but does not necessarily) avoid the two-layer negotiation at
the cost of complicating the HTTP user-agent.  You say that's a local
problem, and it is, but local complexity can kill a protocol.

> [...]
> 
> It is possible to continue with, say, ", Digest ..." and allow the
> HTTP-level choice between SASL and Digest.  I'd be interested to see
> if this option is every used in practice; clients are all abound and
> I doubt they can all parse this variability.  In SASL, it's a given.

And here we have the motivation for advertising SASL mechanisms
together: that SASL APIs generally have a function the implements
mechanism selection given the set of mechanisms advertised by the
server, and not using those APIs means replicating the mechanism
selection complexity at the HTTP user-agent layer.

But the HTTP user-agent still has to be aware of the negotiation
details, else we can still have a two-layer negotiation.  Consider a
case where

 - a server offers Digest, SASL{SCRAM}, Negotiate, Bearer

 - the user-agent decides that SASL is best, then it tries it and SCRAM
   fails because there's no credential that could work, but maybe
   Negotiate would have worked

Maybe that's not fatal if the user-agent can use some mechanism, then
try another if the first fails.  But in some cases determining that an
authentication mechanism failed such that another can be tried is not
possible because the response might be a 403 legitimately due to
authorization being denied as opposed to 403 due to failure to
authenticate.

IMO it would be better to treat every [applicable] SASL authentication
mechanism as a distinct HTTP authentication scheme, consequently putting
the whole burden of mechanism selection on the HTTP user-agent layer
[where it already lies today].

> > Also, more generally, I think HTTP authentication schemes are dead.
> > It's too hard to use them generally, especially new ones.
> 
> I have another opinion, especially for RESTful and other autimation
> interfaces.  [...]

I'd like to hear your opinion on that.

>      [...].  And I want an option where browsers can handle credentials
> in a different environment than the one running ads.

That is a different problem.  We can have redirect-based authentication
for origins while denying it for non-origins, for example.  That's a
local problem :)

> > IMO what's really needed is a generic way to do redirect-for-
> > authentication-and-redirect-back-with-a-token.  I think I've an I-D
> > about that somewhere.
> 
> That is a matter of how you decorate the HTTP name space, orthogonal
> to the mechanism used.  This is how I would use it too, indeed.

What namespace.

Nico
--