Re: [TLS] About encrypting SNI

Andy Lutomirski <luto@amacapital.net> Thu, 17 April 2014 03:08 UTC

Return-Path: <luto@amacapital.net>
X-Original-To: tls@ietfa.amsl.com
Delivered-To: tls@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id BD3981A0052 for <tls@ietfa.amsl.com>; Wed, 16 Apr 2014 20:08:54 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.979
X-Spam-Level:
X-Spam-Status: No, score=-1.979 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, FM_FORGED_GMAIL=0.622, RCVD_IN_DNSWL_LOW=-0.7, 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 cbU7-3h_C2NN for <tls@ietfa.amsl.com>; Wed, 16 Apr 2014 20:08:49 -0700 (PDT)
Received: from mail-la0-f41.google.com (mail-la0-f41.google.com [209.85.215.41]) by ietfa.amsl.com (Postfix) with ESMTP id 4F4921A0039 for <tls@ietf.org>; Wed, 16 Apr 2014 20:08:49 -0700 (PDT)
Received: by mail-la0-f41.google.com with SMTP id gl10so9055674lab.28 for <tls@ietf.org>; Wed, 16 Apr 2014 20:08:45 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=YTvvCtPEbMJYQwNUp78rFFuJgUnrOG8EuJJvbR5cQg8=; b=hDr+n/dorlb8dgMDMznz0TkY0xAcYuO9REvUl6qXh/jm75TqOsoPc7UqxodZaX/HiX 0TISX80eFLdlN7tPvmjiRyNqAOcivrE/b62gi/Uf1Qe8ZQeu5kLzcQGApL5Gh/2IQNBK tL++fn5YOAUj/4pXp3yRIhadNaZgjEON72dTjXmRRPJq5/dIJILyZzU0GcwejmySAwcY 75162XZRZX3B+BJgFx6HbXXYGjnGpb6C3crFHZZd2VwN2u9qV974iTX7aTbO+mZFo53e bVFOTqdzhVrcJL/lH9xAijFm8zOi7HDgFm/RCaLo2pM642topIWTsQIHbm5jIqmOyaix M63w==
X-Gm-Message-State: ALoCoQnIWxri0EAHmC2t1cF4Q6ywKjgPN1RAZPXX2FcT9eagifKV9XHD1kipWbT2+fVq1enCdpwI
X-Received: by 10.152.6.2 with SMTP id w2mr7865335law.28.1397704125059; Wed, 16 Apr 2014 20:08:45 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.152.21.7 with HTTP; Wed, 16 Apr 2014 20:08:24 -0700 (PDT)
In-Reply-To: <CAKC-DJg6kRLezM+Q60VLY=dBU9C_Q9hb_0u7WD-HHWVJ5Y6tRQ@mail.gmail.com>
References: <2A0EFB9C05D0164E98F19BB0AF3708C7120A04ED40@USMBX1.msg.corp.akamai.com> <534C3D5A.3020406@fifthhorseman.net> <474FAE5F-DE7D-4140-931E-409325168487@akamai.com> <D2CB0B72-A548-414C-A926-A9AA45B962DA@gmail.com> <2A0EFB9C05D0164E98F19BB0AF3708C7120B490162@USMBX1.msg.corp.akamai.com> <CACsn0cmusUc3Rsb2Wof+dn0PEg3P0bPC3ZdJ75b9kkZ5LDGu_A@mail.gmail.com> <534DB18A.4060408@mit.edu> <CABcZeBOJ7k8Hb9QqCAxJ_uev9g_cb4j361dp7ANvnhOOKsT7NA@mail.gmail.com> <CA+cU71kFo6EihTVUrRRtBYEHbZwCa9nZo-awt4Sub2qXcKHC7g@mail.gmail.com> <m2k3apmjk2.fsf@usma1mc-0csx92.kendall.corp.akamai.com> <CALCETrU6zn52yX=Q-_h4epR6W9+f2oTr3yfyK1sxiwGa2dvWGw@mail.gmail.com> <CAKC-DJgNvF=hhwoyRNkJ3vKz9EZ_JpoM84bCip6eProLwsQsEg@mail.gmail.com> <CALCETrWY_-N+nM9N0_gbeffkX5Jo8vn7XKeFCezGiwq2A74Wjw@mail.gmail.com> <CAKC-DJg6kRLezM+Q60VLY=dBU9C_Q9hb_0u7WD-HHWVJ5Y6tRQ@mail.gmail.com>
From: Andy Lutomirski <luto@amacapital.net>
Date: Wed, 16 Apr 2014 20:08:24 -0700
Message-ID: <CALCETrX7Dv9_+uM7VqotHGurS+k6K5wKzeXEj7zuekd8+0qOJQ@mail.gmail.com>
To: Erik Nygren <erik+ietf@nygren.org>
Content-Type: text/plain; charset="UTF-8"
Archived-At: http://mailarchive.ietf.org/arch/msg/tls/jB2Ku5P_Jv2Lrjzc7q22kfPOHcs
Cc: "tls@ietf.org" <tls@ietf.org>
Subject: Re: [TLS] About encrypting SNI
X-BeenThere: tls@ietf.org
X-Mailman-Version: 2.1.15
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: <http://www.ietf.org/mail-archive/web/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, 17 Apr 2014 03:08:55 -0000

On Wed, Apr 16, 2014 at 7:46 PM, Erik Nygren <erik+ietf@nygren.org> wrote:
>
> On Wed, Apr 16, 2014 at 3:09 PM, Andy Lutomirski <luto@amacapital.net>
> wrote:
>>
>> On Wed, Apr 16, 2014 at 11:56 AM, Erik Nygren <erik+ietf@nygren.org>
>> wrote:
>> > If we do anything with DNS, we need to be very conscious that individual
>> > records change asynchronously from other records.  For example, we can't
>> > assume that an A/AAAA record and a DANE record refer to the same
>> > operator
>> > (webserver, hosting provider, CDN, etc).   In order for anything along
>> > these
>> > lines to be deployable, it must be possible for everything associated
>> > with a
>> > particular name->service binding to change together.  In addition,
>> > browser
>> > vendors are extremely wary of doing extra DNS lookups synchronous to a
>> > request which is one reason that SRV records aren't in-use today for
>> > HTTP(S).
>>
>> You can hack around this by temporarily turning off hello encryption
>> when switching providers.  This is unfortunate, though.
>
>
> In my experience, anything of this form not designed to be easy to operate,
> reliably support rotation, and robustly move between providers is likely to
> fail to be deployable.  Errors in this world seems to be a top cause of
> outages and this sort of thing can be very hard to reason about.  Sadly,
> anything that requires "hack around" as part of its normal operating regime
> just isn't going to work.
>

I agree.  Using "bindings" as you suggested is better.  It also adds
no extra round trips.

>
>
>> I'm not sure exactly what you mean by handshake_token.  Do you mean
>> the anti-replay token?
>>
>> The handshake token as a way of identifying the service binding in use
>> seems problematic to me.  Wouldn't it be better to just leave it out
>> entirely?  As long as each IP only accepts one or two handshake keys,
>> then figuring out which one is in use by trial decryption should be
>> fine.  I think that something is wrong if you have an IP with lots of
>> handshake keys.
>>
>> Realistically, you may need up to four handshake keys: old FIPS, new
>> FIPS, old non-FIPS, new non-FIPS.
>
>
> Perhaps handshake_key_label would have been a better term.
> I was referring to what is in PredictedParameters.server_key_label in ekr's
> tls13-new-flows
> (which has the same problem if not handled properly, and even if used
> properly still
> has risks here which may not have good answers).
>
> There are plenty of valid scenarios where you may need considerably more
> than four.
> An example given earlier on the list is for VM/cloud hosting providers who
> need to demultiplex
> from a small number of IPv4 addresses to different backend servers being run
> by different
> entities without mutual trust, each of which having independent different
> sets of keys.
>

You still only need four.  Remember that my ClientHello key is
completely independent of the key associated with the server
certificate, and that it can be stripped.

Suppose that there are a thousand domains, all sharing a few IPv4
addresses, but actually served by 100 mutually distrustful backend
servers.  You would configure all thousand domains to share the same
ClientHello key.  The devices that own the IPv4 addresses would know
the private key.  Whenever a connection comes in, they decrypt the
ClientHello, read the SNI, and forward the decrypted ClientHello to
the appropriate backend.  That backend server does not know the
ClientHello private key, but it doesn't need to.  Similarly, the thing
that owns the IPv4 address does not need to know the backend server's
private key.

So you still only need one or two keys under normal circumstances and
two or four while rotating ClientHello keys.

--Andy