Subject: Re: something something certificate --- boiling a small lake

From: Brian Campbell <[email-masked]>
Date: Thu, 25 Jun 2020 15:31:10 -0600

My aim with something-something-
<https://datatracker.ietf.org/doc/draft-bdc-something-something-certificate/>
certificate
<https://datatracker.ietf.org/doc/draft-bdc-something-something-certificate/>
is/was to address a narrow but existing need by documenting current
practice while introducing enough commonality to the header name and its
content/encoding so as to facilitate relatively simple interoperability
between independently developed systems. I see where you are going with
this boiling of a small lake but it's well beyond the scope of the kind of
solution I'd envisioned or think would be practically deployed and useful
in any meaningful numbers.

On Fri, Jun 19, 2020 at 10:50 AM Michael Richardson <[email-masked]>
wrote:

>
> Brian,
> {I have been on the httpbis list, but I'm not right now, and I know that
> w3 and IETF do not share their whitelists, so this might not work}
>
> I was thinking about something-something-certificate yesterday while
> cleaning/swimming
> my pool.  (A long thankless task, as the pool is not heated, we've been
> getting very a-seasonal *snow*, and nobody in my family but me will swim
> in it
> until it's "perfect".  Also we have many many trees, which we won't cut
> down.
> You can see how my mind might wander)
>
> [This discussion would be better done with beer and napkins.]
>
> So I am thinking that we need to create a "digital twin" in the back-end
> server for the front-end TLS state machine.  It needs to reflect the
> current
> state at a level of detail appropriate for the application.
>
> Thus, a single header isn't enough, although there could be some
> degeneration
> that results in a single header.  We need a few variables to update.
>
> I think we have a choice between:
>
> 1) sending the state (possibly a few kb) on every transaction, which keeps
>    the protocol stateless.  We could explore ways to encode it: CDDL+CBOR
>    seems like a good thing.  TLS structures are another obvious choice, but
>    that's a detail.
>
> 2) assuming that state will be maintained by both ends, and simply updating
>    the state appropriately.   When it comes to this, I think of the
>    HTTP PATCH methods, but I'm not sure I mean this literally.
>
> It's the model of having a few objects per-connection that the TLS
> front-end
> might update on the backend, and making the management of the TLS
> connections explicit.
>
> Alternately, the TLS front-end could maintain a RESTful interface on a
> per-connection basis that the back-end could interrogate.  The header
> would just provide the right reference to that.  The RESTful interface
> could even be pushed/updated into some other CPU on the TLS terminator.
>
> This is cleaner, but this has read-latency round trip issues, while pushing
> the state out on each HTTP request (or uwsgi, fastcgi, ...) seems a lot
> more
> pipelined.  Or MQTT :-)
>
> To this, I think we'd have to look at the RFC8446 Appendix A.2 state
> machine
> and figure out how to express this.   I don't really see re-auth in that
> diagram.  Maybe I'm overthinking here, but given the opportunities in TLS
> 1.2 and 1.3 for newer states, and the review from TLS experts on the
> header,
> this might be cleaner and less of a hack to get the additional things in.
>
> This data model mechanism also better accomodates the split between those
> who
> need the entire certificate chain (w/ and w/o trust anchor used), and those
> that just care about the EE involved.
>
> ---
>
> I don't know, in a HTTP/3(QUIC) world, what the TLS front-end/backend
> connection looks like.  I haven't entered such a world personally.
>
> TLS front-end systems *are* collecting/storing state on a per-client
> connection basis, whether the transport is QUIC or not.  I don't think it
> scales well to try to spread that state across load balancers, you want to
> split the traffic before the TLS terminators in order to horizontally scale
> them.
>
> A thought that I have is that with a move to HTTP/3, that the need for
> something-something-certificate declines.
> A model that I could see in such a situation is that since the bulk of the
> transport is via QUIC, it could be that it makes less sense to have TLS
> hardware terminators; by careful use of port numbers to demux upon, and/or
> IPv6 addresses, it might be easier to load balance directly to application
> servers, and just horizontally scale them wider.
>
> The hardware TLS offload box then is only important for adapting HTTP 1
> and HTTP/2 connections to HTTP/3.
>
> --
> ]               Never tell me the odds!                 | ipv6 mesh
> networks [
> ]   Michael Richardson, Sandelman Software Works        |    IoT
> architect   [
> ]     [email-masked]  http://www.sandelman.ca/        |   ruby on
> rails    [
>
>
>
>
>
>
> --
> Michael Richardson <[email-masked]>, Sandelman Software Works
>  -= IPv6 IoT consulting =-
>
>
>
>

-- 
_CONFIDENTIALITY NOTICE: This email may contain confidential and privileged 
material for the sole use of the intended recipient(s). Any review, use, 
distribution or disclosure by others is strictly prohibited.  If you have 
received this communication in error, please notify the sender immediately 
by e-mail and delete the message and any file attachments from your 
computer. Thank you._

---

From: Nico Williams <[email-masked]>
Date: Thu, 25 Jun 2020 18:42:14 -0500

BTW, thanks for the something-something-certificate work.  Looking at
the I-D, draft-bdc-something-something-certificate-04, I see there's no
way to send the certificate chain on.  I understand the motivation
(compression), but it really would be best to send on the full chain
sent by the client.  More on this below:

On Fri, Jun 19, 2020 at 12:50:17PM -0400, Michael Richardson wrote:
> Thus, a single header isn't enough, although there could be some degeneration

HTTP/2 and, I imagine, /3, does header compression of the right sort
here.

If the backend is HTTP/1, then... that sucks, but maybe this is a good
way to encourage migration to /2 or /3.  That said, I think we can
compress in the /1 case by first sending the certificate (and chain,
please) and in subsequent requests in the same connection sending only a
hash of the certificate.  This would force a /1 backend to keep the kind
of state that a /2 backend would for header compression.

>    seems like a good thing.  TLS structures are another obvious choice, but

There's no need.  HTTP/2 already does header compression.

>    HTTP PATCH methods, but I'm not sure I mean this literally.

Can TLS let a client authenticate multiple times?

> could even be pushed/updated into some other CPU on the TLS terminator.

Yes, this would also work.  In this case Client-Cert: would carry just a
URI.  This is nice because the backend can validate that the origin of
that URL is one it trusts.

Nico
--

---

From: Nico Williams <[email-masked]>
Date: Fri, 26 Jun 2020 17:43:37 -0500

On Fri, Jun 26, 2020 at 10:41:02PM +0000, Salz, Rich wrote:
> >    What has been pointed out is that TLS can renegotiate client
> >    authentication.
> 
> Not in TLS 1.3.  And with TLS 1.0 and TLS 1.1 on their way out the
> door ... 

That's what I thought.  So there's just the header compression issue.

BTW, this also comes up with cookies, tokens, etc.

Nico
--

---

From: Nico Williams <[email-masked]>
Date: Sat, 27 Jun 2020 17:50:35 -0500

On Sat, Jun 27, 2020 at 06:17:18PM +0000, Salz, Rich wrote:
> >    Ah - Post-Handshake Authentication?
> 
> Yeah, that.  

There's no limit to how many of those there can be, correct?