Re: [Webpush] Application server authentication new years edition

Costin Manolache <costin@gmail.com> Fri, 08 January 2016 08:06 UTC

Return-Path: <costin@gmail.com>
X-Original-To: webpush@ietfa.amsl.com
Delivered-To: webpush@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 886A21ACE98 for <webpush@ietfa.amsl.com>; Fri, 8 Jan 2016 00:06:59 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.999
X-Spam-Level:
X-Spam-Status: No, score=-1.999 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, SPF_PASS=-0.001] autolearn=ham
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 Zctd6Nl4X7UD for <webpush@ietfa.amsl.com>; Fri, 8 Jan 2016 00:06:57 -0800 (PST)
Received: from mail-ob0-x233.google.com (mail-ob0-x233.google.com [IPv6:2607:f8b0:4003:c01::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 27DD91ACE97 for <webpush@ietf.org>; Fri, 8 Jan 2016 00:06:57 -0800 (PST)
Received: by mail-ob0-x233.google.com with SMTP id bx1so321140282obb.0 for <webpush@ietf.org>; Fri, 08 Jan 2016 00:06:57 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=xNx0UMrXUDz9/zdCNTPbAETgGtWv86ay0nHoFqSJfKU=; b=Vw8A64DKNFDNtXpAPCQ1fH3tkK5GRIdJQlnY350Y7mbz21pBSulkISXNo8ZXSuqbur 5Y+sGg+YrinE1f4Ghhs5u5YOXpweeyvur1uJ/bWLUKdCoROrlAHbxYnMHoiNwrNT372E Pscjnr8YWuWxXBkYWhDhF38+Cv3vh9hY2h15+shB+r34wTHuIBD79mH/OREKflacEsj/ prmpEnq8y8gSsZ4RZcoSlSLoRzDHx4fhrr+m+CFZ1Pe+rn2YrZrmf3zqNt0PlYMzKUAE dWRQv9TnAuZQc8DNXAW/a1iEr2du4D3kPbayvHY+GXjl5eNpbJsBxtPXgBKWNOOLry8F ohtg==
MIME-Version: 1.0
X-Received: by 10.60.135.98 with SMTP id pr2mr71323742oeb.65.1452240416521; Fri, 08 Jan 2016 00:06:56 -0800 (PST)
Received: by 10.76.8.74 with HTTP; Fri, 8 Jan 2016 00:06:56 -0800 (PST)
In-Reply-To: <CABkgnnVwCSmu8zJ3vZa=5wgQ9K49GHMJsov6L8MWBsZJ41-sQg@mail.gmail.com>
References: <CABkgnnXBHXfY6Gz-FKGVUUoOwyJo9zaw1rWceSqVp94FypDbJA@mail.gmail.com> <CAP8-Fq=PhUcj5aaE6dvF2_+-HmVrGDyk41QBzkVxiNMxUakoag@mail.gmail.com> <CABkgnnUYkuu9pjuqLDhiWLNWzkr9ZfYRNny4ZvSKRTWie2bQyA@mail.gmail.com> <CAP8-FqnSqtMb5bT14tkycYXOOP+Xmoa9SMjuP5KkeN_ri+_NVQ@mail.gmail.com> <CABkgnnU0CP-fGpEfqLo01ZVdjT3dNVeb3MSufO1P8T2W63dNVw@mail.gmail.com> <CAP8-FqkF9X+_CjSyXB10621L0=b756REjXsbRfsL8rT6nuh9pw@mail.gmail.com> <CABkgnnW7oRTZRKDQcxf9=0f-mxKfctQQTrR5zY6q4qJtL_cPjw@mail.gmail.com> <CAP8-Fqnage13JQiz8Qkvrho-e8DWcw8p_NLd_xux+uQALwD7og@mail.gmail.com> <CABkgnnVwCSmu8zJ3vZa=5wgQ9K49GHMJsov6L8MWBsZJ41-sQg@mail.gmail.com>
Date: Fri, 8 Jan 2016 00:06:56 -0800
Message-ID: <CAP8-FqkFuqrGtH8CWgOEBvYUMCN=BUVp1LEKig9ADOwLEkcLXQ@mail.gmail.com>
From: Costin Manolache <costin@gmail.com>
To: Martin Thomson <martin.thomson@gmail.com>
Content-Type: multipart/alternative; boundary=047d7b41792127c6a00528ce1288
Archived-At: <http://mailarchive.ietf.org/arch/msg/webpush/-E0S_F-zJLbyYkZ2mC-OOQqVWfg>
Cc: Ben Bangert <bbangert@mozilla.com>, Costin Manolache <costin@google.com>, "webpush@ietf.org" <webpush@ietf.org>
Subject: Re: [Webpush] Application server authentication new years edition
X-BeenThere: webpush@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: Discussion of potential IETF work on a web push protocol <webpush.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/webpush>, <mailto:webpush-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/webpush/>
List-Post: <mailto:webpush@ietf.org>
List-Help: <mailto:webpush-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/webpush>, <mailto:webpush-request@ietf.org?subject=subscribe>
X-List-Received-Date: Fri, 08 Jan 2016 08:06:59 -0000

On Thu, Jan 7, 2016 at 1:57 PM, Martin Thomson <martin.thomson@gmail.com>;
wrote:

> On 8 January 2016 at 05:59, Costin Manolache <costin@gmail.com>; wrote:
> > 1. Key identifiers ('kid') - for normal JWT, the key is known from the
> > issuer or
> > 'sub'. Since in our case we'll have self-generated keys, and we want to
> > avoid
> > having each key registered with all providers - all that a push service
> will
> > know
> > when seeing a JWT token the first time will be the content of the token.
> > So we need a way to find the public key needed to verify the content -
> and
> > the only one I know is to use something like the SHA of the public key.
> > On subscribe - the provider can store the public key, with the kid as
> lookup
> > key, than
> > on send it can verify. For example kid == (SHA1 or SHA256 truncated to
> > 64bits) would work.
>
> The push service is going to need the public key, so that means
> including a JWK in the message, I think.  Knowing a hash of the public
> key isn't enough.
>

The push service can store the key when subscribe() is called.

I think we can make it work without a key ID - the send URL will decode
to the registration, which would include the authorized public key. But
I think it would still be a bit cleaner and simpler if the JWT key could be
verified
without having to use the URL.



>
> I think that we can avoid using key identifiers.  We could include one
> and use that to reference another header field, but it is easier to
> say that there is exactly one JWT and exactly one JWK and that one
> depends on the other.
>

That would work too, but the push service still need to verify that the
key in subscribe is the same as the key in JWT. If you load the
subscription -
using either the URL or the key id - there is no need to send the JWK.



> > 2. 'aud' field - not sure what would be the right value, maybe the
> domain of
> > the push provider ?
>
> I specified URL at the suggestion of Chris, but I had the same thought
> you did.  Maybe we can trim it to origin.  That reduces portability
> considerably and also shortens the token somewhat.
>
> > 3. Going back to the 'voluntary'/optional part: I'm not sure if
> encryption
> > is going to be required or
> > optional in the final version ?
>
> The protocol won't absolutely require it, though it will strongly
> recommend it.  (I'd prefer to require it, but there you have it.)  The
> W3C API will require encryption.  Does that make sense?
>

Yes.


> > 4. I think we can have the sender key optional in the subscribe
> operation,
> > in particular for cases
> > like low end IOT - not including it would give permission to anyone with
> the
> > URL and pubkey
> > of the device to send messages. There is another case where it helps -
> > pairing, in cases of D2D -
> > but with restrictions ( either time, or binding the subscription to the
> > sender at first use ).
> > In other words: I'm not opposed to having 'optional' on the subscribe
> (and
> > on contact info).
>
> I agree.  Making the JWT mandatory on the subscription would introduce
> some operational problems for the cases where one endpoint has to be
> used by several different application servers too.
>
>
It shouldn't be mandatory - just recommended that subscribe indicates who
is authorized
to send.

A push service that doesn't require authentication can just ignore it.



> > 5. This may be a bit controversial :-), if we require the developers to
> use
> > a JOSE library to
> > generate JWT tokens, signed with a ES256 - wouldn't make sense to also
> allow
> > them to use
> > the same library to encrypt the payload for the e2e ? There is already a
> > content type defined, so easy to
> > differentiate.
>
> I don't know of any way to do that without also massively inflating
> the size of the payload.  There is a mapping to JWE already in the
> encryption draft for those who would prefer to reuse their library.
> The tricky part is key derivation, but I think that's largely
> unavoidable in this case.
>

Yes, it doesn't seem possible to convert from JWE to the binary format,
so UAs would need to support both, I don't think this would work. And it
may be
more confusing in the end.

Costin