Re: [TLS] SNI from CDN to Origin (was I-D Action: draft-ietf-tls-sni-encryption-08.txt)

Eric Rescorla <ekr@rtfm.com> Thu, 10 October 2019 18:45 UTC

Return-Path: <ekr@rtfm.com>
X-Original-To: tls@ietfa.amsl.com
Delivered-To: tls@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id ABB89120125 for <tls@ietfa.amsl.com>; Thu, 10 Oct 2019 11:45:43 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.896
X-Spam-Level:
X-Spam-Status: No, score=-1.896 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=rtfm-com.20150623.gappssmtp.com
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 g9ANXU811vPB for <tls@ietfa.amsl.com>; Thu, 10 Oct 2019 11:45:41 -0700 (PDT)
Received: from mail-lf1-x134.google.com (mail-lf1-x134.google.com [IPv6:2a00:1450:4864:20::134]) (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 D8B41120089 for <tls@ietf.org>; Thu, 10 Oct 2019 11:45:40 -0700 (PDT)
Received: by mail-lf1-x134.google.com with SMTP id x80so5187906lff.3 for <tls@ietf.org>; Thu, 10 Oct 2019 11:45:40 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rtfm-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=oHgvRSOSqIdv9U6dXlsVWRwQEHdTDstEin4SvRaP6YA=; b=LQYbURCHi9l1VZ8DXI0d4bArXzBwPflfDSUhob8VYDNnDucbqgyGVqegXVsID1p6mD phnf9nX6fzj002rWETvhGnwjRgJQpjCC2XCwqdI0gPEHh7AA/OLg2aTQAV89G5XBKqRl UnOtE0jXNKeH6WHiJPxfK/WRcfEGR7xktUeqA44k9tMgbSpxkixWzUeBICkXvOCajlks 2goobA1ysRN4sCakZmOgkEApGoHfQV23KlgZvwaW0TnskCYGRz0dztjJcwoad6npDTcT Lmyh/zfjHVv6w8ZqcJ4lfV5vyopPdi7mHotnisjMItcCJxaPHAiILgrSRtaB7RxjVhns 3jCQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=oHgvRSOSqIdv9U6dXlsVWRwQEHdTDstEin4SvRaP6YA=; b=hxUjAdCm5fo7lu/WjvDSIuSpCD5I28/1uqDQhepZwl+A3rbZ4N6OAceipNiYmhMjif Ewibj+HNVTXe3mi5np8+w7yi+oAZfeKCMhNIYDLAZZMBsalUNj1lNCFaWvy4zZvUkMKn ng7J5bzqmD+nyh1rmQw4u6WSE5oXaa6E/CWaW8ClKOia7PqAMS5axVODGRva27hJ9nnB Q3/5vCXN3CSVEAF26ULtODM9T08JF4sgRInTwaYqy7tH4vBi0/A7AY8K3inleIliWwFD 9PZ+KstGQZ6eT5FmbBnHGW9M2GGPgpr4gAy5/gJ+yCGIAl6s/4sSaSNac/p61DsEeOJb OP9g==
X-Gm-Message-State: APjAAAWsPj1cr78a1x+6Qj6xuKB6LD9k8XbB38Pz9Uez0gIG/EjQGg3b sMRZ68ThfsEywlxy0PaOqXLt+bA+QB/VNyx4DJwgSA==
X-Google-Smtp-Source: APXvYqyooZkEWpUnCq9BTVSBOcT0eAjdX4wrHjiQ6YTMIzOdIXAdLQz86w02NwOD0ena3QHBj9J7txNmq7c6NPp+RD0=
X-Received: by 2002:ac2:4a75:: with SMTP id q21mr6667182lfp.94.1570733139035; Thu, 10 Oct 2019 11:45:39 -0700 (PDT)
MIME-Version: 1.0
References: <157048178892.4743.5417505225884589066@ietfa.amsl.com> <CAChr6Sy9=GbUO19X0vc0Dz7c565iPAj=uWVujLV5P3_QL5_srw@mail.gmail.com> <28C7A74D-5F9D-4E1A-A2D2-155417DA51C0@akamai.com> <CAChr6Szay7j=czCaYhKGp9bHHmZiArU440hSnvNqNaL+hX2wKA@mail.gmail.com> <F932C81B-95E9-4044-B975-9AFCD09CF7FA@akamai.com> <CAChr6Sy=+qt=KYKfXEkWhBBev88-XEcB4tOZLz9cBf76wsUo2g@mail.gmail.com> <80F168B0-7F30-4FDA-BD0F-4C787802F0D5@akamai.com> <CAChr6SyV+qMFs56THZzBxNv5vkQTeBJdG9GtutvVMcyP2CxN7w@mail.gmail.com> <CABcZeBNtv-4=dtrArZwnJHSohrbsrtG53_ynSZdcMp=YeWc9iA@mail.gmail.com> <CAChr6SzCONU2yA87QGNhsx7=5Zn82v1_euBJ-kbRci4vJ32oUw@mail.gmail.com> <83192EC8-6A24-4638-80AC-6D2AF9C68BBB@akamai.com> <CAChr6SwdP7iA=ZYg+xa3Ye-b97sekw6=qwJZu2w0n1ZZC9wG+Q@mail.gmail.com> <CABcZeBMLaiPuXhgrExTkdhfaOU_m4g-c+Lq-YmHsKiHyB0jDRw@mail.gmail.com> <CAChr6SznAYZDHFPNHX8Uoyo-Fnx8_uMxCOda1zf37Cxnb5A4WQ@mail.gmail.com> <CABcZeBPoyb5sF+ddH8OU_78eJF5sD2df-+ScHRb1xTYhHRHS0w@mail.gmail.com> <CAChr6SyM_yX36p2W_-seE-9kuJ99RTYEHY_vCRNFjLx3utjogw@mail.gmail.com>
In-Reply-To: <CAChr6SyM_yX36p2W_-seE-9kuJ99RTYEHY_vCRNFjLx3utjogw@mail.gmail.com>
From: Eric Rescorla <ekr@rtfm.com>
Date: Thu, 10 Oct 2019 11:45:00 -0700
Message-ID: <CABcZeBPkQjsRr83PYyvhGF8ByeC1gGFWQgofrf=dZmfAfm7UJg@mail.gmail.com>
To: Rob Sayre <sayrer@gmail.com>
Cc: "Salz, Rich" <rsalz@akamai.com>, "TLS@ietf.org" <tls@ietf.org>
Content-Type: multipart/alternative; boundary="000000000000ca1af8059492ce3d"
Archived-At: <https://mailarchive.ietf.org/arch/msg/tls/B8MHmldsHTVZ_D4lTTsoysA_rPA>
Subject: Re: [TLS] SNI from CDN to Origin (was I-D Action: draft-ietf-tls-sni-encryption-08.txt)
X-BeenThere: tls@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: "This is the mailing list for the Transport Layer Security working group of the IETF." <tls.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/tls>, <mailto:tls-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/tls/>
List-Post: <mailto:tls@ietf.org>
List-Help: <mailto:tls-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/tls>, <mailto:tls-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 10 Oct 2019 18:45:44 -0000

On Thu, Oct 10, 2019 at 11:19 AM Rob Sayre <sayrer@gmail.com> wrote:

>
>
> On Fri, Oct 11, 2019 at 1:08 AM Eric Rescorla <ekr@rtfm.com> wrote:
>
>>
>>
>> On Wed, Oct 9, 2019 at 10:16 PM Rob Sayre <sayrer@gmail.com> wrote:
>>
>>> On Wed, Oct 9, 2019 at 8:06 PM Eric Rescorla <ekr@rtfm.com> wrote:
>>>
>>>>
>>>>> I don't think that's quite what I'm proposing. I'm proposing
>>>>> (optionally) sending the SNI with a client certificate.
>>>>>
>>>>
>>>> What are you trying to accomplish by doing that?
>>>>
>>>
>>> I want to keep the SNI encrypted in TLS hops that use client
>>> certificates, but where ESNI won't work.
>>>
>>> For example, how is the SNI transmitted in the parens here:
>>>
>>> [ Client ] -----> (ESNI) -----> [ CDN ] -----> (???) -----> [ Origin ]
>>>
>>> I don't think a DNS-based solution like ESNI will work for that second
>>> hop, because the origin tends to be identified by an IP address rather than
>>> a domain name.
>>>
>>
>> I feel like we're perhaps talking past each other, so I'm going to start
>> back at the beginning.
>>
>> In the ordinary case of Client -> Origin or Client -> CDN, the SNI
>> principally serves to tell the server which origin the client wants and
>> thus which certificate to serve. For this reason, it has to go in the CH.
>>
>
> In general, I agree with you. But only because client certificates are
> relatively rare for end users.
>

> If a client certificate is required, the server probably can't send
> application data in its first response.
>

OK, I think we've now reached where we are talking past each other.

At a very high level, here's the TLS 1.3 handshake:

C->S: CH (w/ SNI)
S->C: SH, CERT, CV, FIN
C->S: [CERT, CV], FIN

In order for the server to send the certificate, which, as you can see, is
in its first flight, it has to have the SNI available. This means that it
has to go in the client's first flight. But the client's certificate is in
the client's second flight. And the client has to have the server's
certificate before it sends its certificate, because otherwise it can't
authenticate the server and so an active attacker can get the client's cert.

If you still disagree, maybe you could show me the ladder diagram you have
in mind?

-Ekr


>
>>
>> In the case of CDN -> Origin, it seems like SNI could serve the same
>> purpose (say that the origin server is hosting multiple servers), in which
>> case it seems like the same requirements apply. OTOH, if the origin server
>> just hosts one origin, then you could potentially have the SNI delivered
>> later (as you suggest), but then why have SNI delivered at all?
>>
>
> Two reasons:
>
> 1) the SNI could contain subdomain data, like "username.example.com"
> 2) if there is a client certificate, the SNI might be relevant in deciding
> whether to accept it
>
> I understand that the intermediary (CDN, etc) will be able to observe the
> SNI, but it's not clear why it's ok that any passive observer to the origin
> should be able to.
>
> thanks,
> Rob
>
>
>