[TLS] TLS-in-TLS tunneling use cases (was: SNI Encryption)

Tony Arcieri <bascule@gmail.com> Thu, 10 August 2017 05:55 UTC

Return-Path: <bascule@gmail.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 AD9DF132559 for <tls@ietfa.amsl.com>; Wed, 9 Aug 2017 22:55:11 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.698
X-Spam-Level:
X-Spam-Status: No, score=-2.698 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, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-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=gmail.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 jdzN3CEATcfc for <tls@ietfa.amsl.com>; Wed, 9 Aug 2017 22:55:08 -0700 (PDT)
Received: from mail-yw0-x22e.google.com (mail-yw0-x22e.google.com [IPv6:2607:f8b0:4002:c05::22e]) (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 72AC6132554 for <tls@ietf.org>; Wed, 9 Aug 2017 22:55:08 -0700 (PDT)
Received: by mail-yw0-x22e.google.com with SMTP id s143so52653966ywg.1 for <tls@ietf.org>; Wed, 09 Aug 2017 22:55:08 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=5ASOLWwDH5Cx2vtgpegfJnULtVFtkF++OwKKU11WVqo=; b=eHpWTa2tmP8/LrdT1KzKOM45n01BPhxekM8wwe2UDGZ8wOE5q4rbLNP7jklNEDV0Dm VOZ6CK03f5ZV73Na4idNW1J9bU6tYHz5nKCz9l5nU7AVMfcy/yJRPRHu4AWNzsjJWi2l G97cxiaij2HkG+Y0st5fX8qlXSICNF+0XRAeCeoTgM0+sqxkxVM+x3tu3jCqu+I1IVqc i6GSdrQ0OuSEL6W1NFhOm3679nYJByrvlTO4VbCbSbU9I5fvTILsjMZiobjks3aRolSe mYGjXIXHFEXSEVH3aAJBO3QlAtVo7y2Tv1HD31mZs98XSLCfPDY9G9mxiOKgUh1LmS7B bMIA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=5ASOLWwDH5Cx2vtgpegfJnULtVFtkF++OwKKU11WVqo=; b=h8pGQx+So9dhe/0VW4LL+WbtmZvov6KlE7FyE/aja0iUAh6z2jTWrgjeBIQQVQxGQH aCEebWHrVOV5j01S8GBQkdQ8wQqe9ED8/V73Yzg7FBfrA1AlLguutGMiX/z813EikwGk JE8/Zo8XxWx0+fO5JAFQJVqxZx0H9A3JlkJ46E6MjqwcrSR7hmC2BxNgi3SQkG1kXr93 e+pTrGR22GtnZ8PiOyQIC/f/1DaST1OK2s/NYFeo/ts7N1AJ0BNVZjkHrMHOKsGzdXFg ZjY2EicmCvM+8er8iR9SytAQEb+mfzh0ls4HGXl0x4n4VpxUuehJj86r8nJh08LkMTfe QK1A==
X-Gm-Message-State: AHYfb5geNZcRXScKh7/avYr1qJe0GkaQsytKnrypEkelysE4Ml8flYn8 gQGZ+N5ubo5qiJ4Vi/cDakUJXM7x6J1VCSQ=
X-Received: by 10.129.197.73 with SMTP id o9mr8382272ywj.183.1502344507434; Wed, 09 Aug 2017 22:55:07 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.37.170.132 with HTTP; Wed, 9 Aug 2017 22:54:46 -0700 (PDT)
From: Tony Arcieri <bascule@gmail.com>
Date: Wed, 09 Aug 2017 22:54:46 -0700
Message-ID: <CAHOTMVJczAcn6dEot-nVqN6NQxZt64pq=bKr4p6tz4F3WhJdGw@mail.gmail.com>
To: "<tls@ietf.org>" <tls@ietf.org>
Content-Type: multipart/alternative; boundary="94eb2c1a4f38b2bb3e05565fd611"
Archived-At: <https://mailarchive.ietf.org/arch/msg/tls/7sgc75-GkQ4uIrlWC6z8SneDfPM>
Subject: [TLS] TLS-in-TLS tunneling use cases (was: SNI Encryption)
X-BeenThere: tls@ietf.org
X-Mailman-Version: 2.1.22
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 Aug 2017 05:55:11 -0000

As I look at draft-huitema-tls-sni-encryption[1], I really think it's
putting the cart before the horse. I really like the proposed TLS-in-TLS
tunneling mechanism, but I feel it is a generally useful mechanism, and
this draft relegates it to providing a point solution specifically for the
purposes of SNI encryption and considering only that use case.

One of the things I like the most about TLS 1.3 is how it has harmonized
the sort of chunky stew of ill-conceived features found in previous TLS
versions (with nebulous and overlapping responsibilities) into a smaller
set of clearly-defined parsimonious ones which cover a wide range of use
cases.

In considering the general problem of "SNI encryption", and particularly
within the context of TLS-in-TLS tunneling solution, I humbly ask that
other use cases which would benefit from a TLS-in-TLS tunneling mechanism
are considered. I think any draft about this should have TLS-in-TLS
tunneling itself as the centerpiece, and "SNI encryption" off to the side
as one potential use case.

So, what other use cases are worth considering? Egress proxies!

Consider: a gateway server acting as an external proxy which bridges an
internal network with the Internet, acting as a forward proxy to
authenticated clients (either human-driven apps/tools or backend services).

What I think is particularly interesting about this use case in the context
of the SNI encryption discussion is it is in fact almost entirely the same
problem from a technical perspective. Where it differs is largely in the
framing of the problem: instead of using the gateway to reach a hidden host
from the Internet, we are using the gateway to talk to the Internet from an
internal network which needs to go through a proxy host to reach the
Internet.

More tangibly, I would like the following as the administrator of an
internal network:

- All outbound traffic flows through centrally managed gateway hosts which
act as TCP proxies. Outbound connections to the Internet are otherwise NOT
allowed

- As we're fans of actually using TLS to provide end-to-end transport
security and not "SSL added and removed here ;-)", we want the resulting
connection to be encrypted end-to-end between the internal network TLS
client and the requested destination server. Also, all "setup"
communication to the gateway should also happen over TLS

- The gateway authenticates clients (using e.g. a TLS client certificate)
and authorizes the outbound hostnames against an ACL. This way we can
control which clients are allowed to reach which external endpoints.

There are a few additional things which are different between the cases
beyond some of what I've just mentioned. Ideally the client verifies the
gateway's server cert against an internal-only CA bundle, then verifies the
tunneled destination host against a public CA bundle. We might want a
client to present an internal client certificate to the gateway, but
present no cert/a different cert to the destination host. That said, aside
from minutia like that, the machinery seems largely the same.

What are the real-world "rough consensus and running code" solutions to
this sort of problem in place today? There are all sorts of options that
are sort-of-not-quite like what I just described, e.g. a SOCKS proxy. But
the one I'm thinking of as I write this is CONNECT tunnels:

https://wiki.squid-cache.org/Features/HTTPS

These sorts of tunnels (ab)use a HTTP(S) forward-proxy to establish
outbound TCP connections (which, if you care about security, will carry TLS
encrypted traffic).

This approach is partly described in RFC 2817[2], but to tick all of the
checkboxes on the points I mentioned earlier using this method, you need to
implement features in draft-luotonen-web-proxy-tunneling-01[3], which has
never received an RFC and, as far as I can tell, is only properly
implemented by Squid. Using Squid as a TLS-in-TLS tunneling solution seems
less than ideal to me, and yet in many ways it seems like the "least
friction" option, especially for access control purposes.

I would really love a simple, straightforward approach to this problem with
a published RFC instead of an expired draft that's only implemented by
Squid. I also think TLS-in-TLS tunneling can solve this same problem in a
much more straightforward manner.

tl;dr: when making drafts regarding TLS-in-TLS tunneling, please consider
the forward-proxy use case in addition to the reverse-proxy case

[1]: https://datatracker.ietf.org/doc/draft-huitema-tls-sni-encryption/
[2]: https://www.rfc-editor.org/rfc/rfc2817.txt
[3]: https://tools.ietf.org/html/draft-luotonen-web-proxy-tunneling-01

-- 
Tony Arcieri