Re: [Uta] MTA-STS-03 review

Alberto Bertogli <albertito@blitiri.com.ar> Sun, 26 March 2017 20:52 UTC

Return-Path: <albertito@blitiri.com.ar>
X-Original-To: uta@ietfa.amsl.com
Delivered-To: uta@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 30E941296C6 for <uta@ietfa.amsl.com>; Sun, 26 Mar 2017 13:52:24 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.902
X-Spam-Level:
X-Spam-Status: No, score=-1.902 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RP_MATCHES_RCVD=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, UNPARSEABLE_RELAY=0.001] autolearn=ham autolearn_force=no
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 vagJXjF9mzAQ for <uta@ietfa.amsl.com>; Sun, 26 Mar 2017 13:52:22 -0700 (PDT)
Received: from blitiri.com.ar (cdt.blitiri.com.ar [IPv6:2001:41d0:401:3100::2c1a]) (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 F0EA81296B7 for <uta@ietf.org>; Sun, 26 Mar 2017 13:52:21 -0700 (PDT)
Received: from blitiri.com.ar (authenticated as alb@blitiri.com.ar) by cdt.blitiri.com.ar (chasquid) (over submission TLS-1.2-TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) (envelope from "albertito@blitiri.com.ar") ; Sun, 26 Mar 2017 22:52:19 +0200
Date: Sun, 26 Mar 2017 21:52:18 +0100
From: Alberto Bertogli <albertito@blitiri.com.ar>
To: Daniel Margolis <dmargolis@google.com>
Cc: uta@ietf.org
Message-ID: <20170326205218.GN11426@blitiri.com.ar>
References: <4C0807DA-4852-4DAC-80ED-8A25371CFFAA@dukhovni.org> <CANtKdUfOZYSr_SuGHdDHHgrF8J5VjEWwVw_7KC2xS5DrCKhu-w@mail.gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Disposition: inline
In-Reply-To: <CANtKdUfOZYSr_SuGHdDHHgrF8J5VjEWwVw_7KC2xS5DrCKhu-w@mail.gmail.com>
User-Agent: Mutt/1.5.24 (2015-08-30)
Archived-At: <https://mailarchive.ietf.org/arch/msg/uta/CQc3m8yWiw7eFn_O-oBixNxy5aA>
Subject: Re: [Uta] MTA-STS-03 review
X-BeenThere: uta@ietf.org
X-Mailman-Version: 2.1.22
Precedence: list
List-Id: UTA working group mailing list <uta.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/uta>, <mailto:uta-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/uta/>
List-Post: <mailto:uta@ietf.org>
List-Help: <mailto:uta-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/uta>, <mailto:uta-request@ietf.org?subject=subscribe>
X-List-Received-Date: Sun, 26 Mar 2017 20:52:24 -0000

Hi!  Not sure if it's worth much, but my 0.7 cents inline :)


On Wed, Mar 22, 2017 at 01:39:54PM +0100, Daniel Margolis wrote:
> > Here, as discussed on the list, serious consideration should be given
> > to changing the semantics from validating the MX hostname to specifying
> > the names allowed in the server's certificate.  This simplifies MX
> > processing
> > (which remains unmodified) and merely changes the conditions under which an
> > MX host is considered suitably authenticated per the policy.
> 
> > Which, for example, allows the MX hosts to share a single certificate
> > with the destination domain (and not the MX hostname) as its DNS SAN.
> > If the policy lists that (shared) name as what's expected in the
> > certificate,
> > then authentication succeeds when the MX host's certificate matches one of
> > the allowed names.
> >
> 
> That's interesting. I think it's not actually that big a change--we just
> get rid of the MX host filtering and instead just apply the logic to
> validation.

This would make certificate validation differ from the way it's commonly
done, where the check is against the name used to connect to the server.

I think that would be a mistake.

Certificates are already non trivial to deploy and check, and making
validation work in an unusual way introduces complexity in coding in
some cases, (maybe not for postfix, of course, but most high level
libraries such as Python's or Go's make this more difficult) in a very
sensitive and delicate area.

It also makes deployment and checks more complex, as wildcard
certificates and mentions in the policy don't work in a somewhat
unexpected way (I don't think most folks expect wildcards to be matched
via string comparison).



If it's the filtering that is too much additional complexity, an
alternative would be to consider the "mx" field in the policy as an
alternative source for the mail servers list (no wildcards allowed in
that case, obviously).

This has, I think, the same security benefits of the list for filtering,
and may be easy to use in some cases. Deployment wise, it's probably not
as simple as the filtering, but not terribly more complex, and is easy
to understand and automate.

I'm not terribly convinced about it, but it could be an alternative to
filtering if it's an issue.


> > FWIW, I would have chosen something less fancy than JSON for
> > what is clearly a simple array of attribute/value pairs. ESMTP
> > already encodes such optional A/V pairs as space separated lists
> > of attr=value with xtext encoding as needed (it is not needed for
> > any plausible value of the above attributes).
> >
> 
> I seem to recall that we started with simple key-value pairs and moved to
> JSON because people variously seemed to think this was easier (since
> parsing libraries are common). I would also consider the vague possibility
> that in future iterations we wish to add fields.
> 
> De novo, I myself have no real opinion here, because certainly either work,
> but of course I'm loath to make changes again. I'd appreciate more feedback
> from more readers, though, as these style discussions are always a bit
> subjective.

There are lots of advantages of using JSON for this. It is well defined,
standard and there are lots of well tested and widely used
implementations.

It is used widely, it's familiar to many people, and its shortcomings
(which are not few, admittedly) are well understood and documented.

It support rich types (such as lists), and common libraries already
handle difficult situations like non-ascii content, long integers,
multi-line strings, malformed/malicious input, etc.


Defining an ad-hoc key-value pair format may seem simpler in the short
term, but I think it's not worth it, as many things will have to be
decided an carefully designed (e.g. multi-line lists). Then parsers have
to be implemented with support for a variety of things, and care for
malicious input which is usually not trivial.


Thanks!
		Alberto