Re: [Iotops] [Secdispatch] I-D: Deploying Publicly Trusted TLS Servers on IoT Devices Using SNI-based End-to-End TLS Forwarding (SNIF)

Jim Zubov <ietf-list@commercebyte.com> Thu, 10 February 2022 23:23 UTC

Return-Path: <ietf-list@commercebyte.com>
X-Original-To: iotops@ietfa.amsl.com
Delivered-To: iotops@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id B82B63A0DF7; Thu, 10 Feb 2022 15:23:31 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -5.09
X-Spam-Level:
X-Spam-Status: No, score=-5.09 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, PDS_OTHER_BAD_TLD=1.999, RCVD_IN_DNSWL_HI=-5, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_PDS_SHORTFWD_URISHRT_QP=0.01, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=commercebyte.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 bTubiHkQlL25; Thu, 10 Feb 2022 15:23:26 -0800 (PST)
Received: from ocean1.commercebyte.com (ocean1.commercebyte.com [104.131.120.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id D61C13A0DE9; Thu, 10 Feb 2022 15:23:23 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=commercebyte.com; s=default; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID:References:In-Reply-To:Subject:To:From:Date; bh=bZaPp/44tVpljoGwOxNHvIPzZcKUxfuoJpQRRxeQSBU=; b=BuRC1otOUmuyvPTPdRcBJt+caU2O6irHTCgKI6C8TT4VLnob5LDzZW1tipwDPlG+LgReA3ZgHVLNAnwMmymtqEzPtiUzyNYRATq8aA+QY9SX2E5BPkjrCaumogj3nN9Go7X8a9fe3v+fc27sh3Y3+edqz8XZ3d5yb5YP5wGnVbw=;
Received: from [172.58.128.19] (port=1644 helo=[IPv6:::1]) by ocean1.commercebyte.com with esmtpsa (UNKNOWN:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.82) (envelope-from <ietf-list@commercebyte.com>) id 1nIImV-0003U9-CD; Thu, 10 Feb 2022 18:23:21 -0500
Received: from [2604:a880:400:d0::1ba9:8001]:7120 (helo=[IPv6:::1]) by [2607:fb90:9037:7ecd:28a5:b9f7:1bd1:2d89]:48022 (localhost) with VESmail ESMTP Proxy 1.59 (encrypt=FALSE mode=FALLBACK); Thu, 10 Feb 2022 18:23:19 -0500
Date: Thu, 10 Feb 2022 18:21:58 -0500
From: Jim Zubov <ietf-list@commercebyte.com>
To: secdispatch@ietf.org, Michael Richardson <mcr+ietf@sandelman.ca>, Jim Zubov <ietf-list@commercebyte.com>, iotops@ietf.org, anima@ietf.org
User-Agent: K-9 Mail for Android
In-Reply-To: <4026.1644516168@localhost>
References: <0075B437-024A-4D84-ABD7-92FE8DAFA59F@commercebyte.com>, <1865.1644434146@localhost> <E1nHwaz-0000LM-I5@ocean1.commercebyte.com> <4026.1644516168@localhost>
Message-ID: <685366A1-01F4-4788-B025-0F5F4CE7947F@commercebyte.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
X-AntiAbuse: This header was added to track abuse, please include it with any abuse report
X-AntiAbuse: Primary Hostname - ocean1.commercebyte.com
X-AntiAbuse: Original Domain - ietf.org
X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12]
X-AntiAbuse: Sender Address Domain - commercebyte.com
X-Get-Message-Sender-Via: ocean1.commercebyte.com: authenticated_id: jz@nixob.com
Archived-At: <https://mailarchive.ietf.org/arch/msg/iotops/w9_BHzTyvbZ_l3e2oHfFrj5Mzc0>
Subject: Re: [Iotops] [Secdispatch] I-D: Deploying Publicly Trusted TLS Servers on IoT Devices Using SNI-based End-to-End TLS Forwarding (SNIF)
X-BeenThere: iotops@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: IOT Operations <iotops.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/iotops>, <mailto:iotops-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/iotops/>
List-Post: <mailto:iotops@ietf.org>
List-Help: <mailto:iotops-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/iotops>, <mailto:iotops-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 10 Feb 2022 23:23:32 -0000

Thanks for the feedback again, my comment are below.
I submitted a new version of the draft to reflect some changes.

On February 10, 2022 1:02:48 PM EST, Michael Richardson <mcr+ietf@sandelman.ca> wrote:
>
>Jim Zubov <ietf-list@commercebyte.com> wrote:
>    >> This was also on the IETF112 IOTOPS WG agenda:
>    >> slides:
>    >> https://datatracker.ietf.org/meeting/112/materials/slides-112-iotops-suib-browsing-local-web-resources-in-a-secure-usable-manner-iot-device-configuration-as-a-special-case-00
>    >> video:  https://youtu.be/OIlJrUvwDcI?t=1649
>    >>
>    >> and we hope to return at IETF113.
>
>    > Right, looks like SUIB is working on a similar problem. Thanks for
>    > pointing this out. In particular, the "Sol #6 Device name DNS" slide
>    > looks quite similar to SNIF CA Proxy (Section 3). However, SUIB pursues
>    > bigger infrastructural goals such as changing the localhost TLS
>    > connection policies (I totally agree and really appreciate the effort),
>    > while SNIF is a functioning solution within the existing
>    > infrastructure, tested and proven to work in pre-production.
>
>The slides may be too vague.  Changing the TLS policies is a possible
>solution, but probably an impractical one.  Nevertheless, many people (not
>steeped in the arts, and often failling into the PHB category) think that it
>is an obvious solution, so we list it in order to explain why it won't work.

Yes, still sad that localhost slipped through the cracks when the original security standards were written.

>
>    >> The SUIB problem addresses the challenge of connecting *locally* to a
>    >> device,
>    >> and doing it securely.  For this to be possible with RFC6125-DNS-ID
>    >> standard
>    >> browser, we need a name for the device, and we need a way to translate
>    >> that
>    >> name into a locally reachable IP address.
>    >>
>    >> The SNIF proposal does not quite solve the above problem.
>
>    > In fact, I originally designed SNIF to solve this specific problem -
>    > local-to-local trusted TLS connections.
>
>Ah, very nice to know.
>
>    > * Issue a wildcard cert through SNIF CA Proxy
>    > (e.g. CN=*.domain.snif.xyz), set a DNS record for
>    > localhost.domain.snif.xyz to point to localhost's IPv4/v6, and use
>    > https://localhost.domain.snif.xyz (or other app protocol - imaps
>    > etc). However, looks like some clients treat the localhost IP as
>    > inherently unsecure, and issue a warning ever is the cert is perfectly
>    > valid. The option is still possible, but the applicability might be
>    > limited.
>
>The process we described at
>   https://specs.manysecured.org/suib/Solutions/dnsname-embedded-solution
>
>also uses a wildcard cert, but has a magic authoritative DNS server that
>translates the left-most label into an A or AAAA record.  It's rather a cute
>hack, but at least:
>  a) it's cachable
>  b) it could even be calculated locally, if one ignores DNSSEC.

Yes, using a local network IP instead of a localhost IP is actually a smart idea.
However, inlining the local IP in the hostname, as SUIB does, means you'll have to change the hostname in your client every time your network is changed.
I have an thought for SNIF improvement - SNIF connector sends a SNIF DNS command to set a dynamic DNS A/AAAA for a certain hostname within the CN wildcard, and the CA proxy updates the DNS accordingly. This way the hostname can be permanent, but with dynamic DNS.
Another problem - most platforms won't let you bind to port < 1024 unless you're a root. Might be ok for a device manufacturer, but is a potential show stopper for any user space app. Relayed SNIF works around this problem since the listening ports are on the relay.


>
>    > * Another option is to override the IP routing rules. It is totally
>    > possible on iOS and Mac through a userspace VPN (only one VPN per
>    > device though - beware of possible conflicts). In fact I have a
>    > functioning solution for it, in beta now -
>
>That doesn't really scale to many different domains.

Totally agreed, I just mentioned that this option works for *some* cases, tun/tap a is possible option too if you're a root.

>
>    >> Still, if SNIF is replacing a manufacturer proprietary call-home protocol,
>    >> there could be advantages from having well reviewed code bases, and
>    >> potentially an ecosystem of SNIF Providers that manufacturers could
>    >> outsource
>
>    >> to.  Azure/Amazon/... could easily run such services.
>
>    > I see two options - a SNIF server implemented by each vendor for their
>    > own devices/services, or a bigger SNIF SaaS implemented by a trusted
>    > provider, used by vendors.
>
>Yes, but what's the financial motive for this provider?

(1) For a vendor to run their own SNIF server: market as a true auditable end-to-end for IoT devices they offer.
(2) For a vendor using SNIF SaaS: market as (1) backed by {TrustedBigName}
(3) For a {TrustedBigName} to run SNIF SaaS: collect fees from (2) for using their service and big name.

As a matter of fact, SNIF relay is light on server resources. I've been running it on a minimum DigitalOcean virtual server for months with more than a dozen connectors,   the server load is a fraction of a percent. Of course if somebody connects IoT cameras they can generate some traffic, but IoT vendors already handle it through their proprietary relays.

>
>    >> SNIF seems very much IPv4 NAT44 focused, and it could benefit from some
>    >> understanding of IPv6 and IPv6-over-IPv4 technologies, particularly
>
>    >> Teredo.
>
>    > SNIF is not exactly focused on v4, it works fine with v6 as well. It's
>    > designed to work around NAT, that's true. However, IPv6 networks may
>    > pose issues too - firewalls etc, which will prevent to directly accept
>    > incoming TCP on IPv6 address.
>
>Teredo could be used instead and allows the relay to be stateless and
>distributed, and devolves to ordinary IPv6 when it is present.

Yes, but Teredo is IPv6 specific, the world is not strictly IPv6 yet. And it's a system level solution, while SNIF works fine in a user space.

>
>    >> It clearly has to speak HTTPS only.
>
>    > I specified HTTP because PKCS#10 and X.509 are inherently secure to be
>    > sent over a plain connection.
>
>Yes, but there are privacy concerns which will become a pain, so better to
>just say HTTPS here.

I respectfully disagree, still think HTTP is an easier answer for SNIF. The problem with HTTPS is - SNIF relay (usually) routes https port to SNIF connectors, and does not serve it within the server. Having a dedicated hostname or an alternate port means than SNIF connectors need additional configuration options, or additional discovery protocols. On the other hand, HTTP allows to derive all API URLs deterministically from the CN.
I addressed the possible security concerns in more details and amended the Security section in the draft.


>
>    > The best option is the manufacturer I believe. The manufacturer can
>    > have either their own SNIF server, or work with a trusted SaaS. This
>    > way it's zero setup for the end user, and doesn't need any
>    > infrastructure additions.
>
>Agreed, the manufacturer has to provision a credential.

Yes I proposed some outlines in the security section, more detailed specs are probably better to describe in a separate draft.

>
>    > Sure, elliptic curves are better, but some old school clients may have
>    > problems with them. It may make sense to not mention the recommended
>    > algorithm in the draft, and just to follow the CA's recommendations.
>
>ECDSA acceleration is pretty much ubiquitous, while RSA is not.

Honestly I don't think acceleration is such a big deal, most of TLS job is symmetric ciphers anyway. But I agree - it's better to follow the CA suggestions and industry practices.

>
>    > I believe there's no security issue, as long as the CN entropy is sufficient.
>
>    > I specified the X-SNIF-CN: as mandatory, and text/plain body as an
>    > optional duplicate of it. To make it cleaner, I can remove the body
>    > from the specs and say the response body is to be ignored.
>
>If both are present, and they don't match, then there is confusion.
>So just go with one.  I think that it should actually be a JSON or CBOR payload return.

Agreed, I removed the response body from the draft, going with the header.


>
>    >> They *aren't* what IANA would call "IP protocols", which would be things
>    >> like
>    >> TCP, UDP, SCTP, ESP, ...
>
>    >> Has IANA *already* registered port 7123 then?
>
>    > It's not an IP protocol. It's a service that listens on TCP 7123, I
>    > registered with IANA based on a previous version of the document,
>    > before I turned it into an I-D.
>
>I think you should drop the "snif-*" sentence as it makes no sense.
>You have already allocated TCP port 7123 to the SNIF *service*, so that's
>great.

It's actually called "Service Names" in IANA terminology, sorry for the confusion. I updated in the draft.



>
>--
>]               Never tell me the odds!                 | ipv6 mesh networks [
>]   Michael Richardson, Sandelman Software Works        |    IoT architect   [
>]     mcr@sandelman.ca  http://www.sandelman.ca/        |   ruby on rails    [
>