Re: [Uta] SMTP TLS reporting (RFC 8460), policy domains and DANE

Viktor Dukhovni <ietf-dane@dukhovni.org> Thu, 16 November 2023 20:02 UTC

Return-Path: <ietf-dane@dukhovni.org>
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 7E9D2C14CE3F for <uta@ietfa.amsl.com>; Thu, 16 Nov 2023 12:02:43 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.095
X-Spam-Level:
X-Spam-Status: No, score=-2.095 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, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01, T_SPF_TEMPERROR=0.01, URIBL_BLOCKED=0.001, URIBL_DBL_BLOCKED_OPENDNS=0.001, URIBL_ZEN_BLOCKED_OPENDNS=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=dukhovni.org
Received: from mail.ietf.org ([50.223.129.194]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id klJ3_ihYCkv8 for <uta@ietfa.amsl.com>; Thu, 16 Nov 2023 12:02:33 -0800 (PST)
Received: from straasha.imrryr.org (straasha.imrryr.org [100.2.39.101]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id B79E5C0900A7 for <uta@ietf.org>; Thu, 16 Nov 2023 12:01:35 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=dukhovni.org; i=@dukhovni.org; q=dns/txt; s=f8320d6e; t=1700164895; h=date : from : to : subject : message-id : reply-to : mime-version : content-type : in-reply-to : from; bh=NsO37eoRx3M0vE7TeWu6EF9/Jn/0JBGcwmpS0xz3QEE=; b=BUal7Y/2PaFYU1gyCjCMJuQZjjA0vWrZL8vhAtA0qP1tTyH1OlspB9fP9rCVp1NsWfVUS f21PJXfJertw0Upa6NZiQE+vIEcwY0+WvNkQOhTUYxJhtQYlCbeYHSXWU1W9VwuCiUTzp/j xmcUQ8aSZSTvpVnW1vH1vl1Mkyr60fc=
Received: by straasha.imrryr.org (Postfix, from userid 1001) id 0A02413B0D9; Thu, 16 Nov 2023 15:01:35 -0500 (EST)
Date: Thu, 16 Nov 2023 15:01:34 -0500
From: Viktor Dukhovni <ietf-dane@dukhovni.org>
To: uta@ietf.org
Message-ID: <ZVZ1HjiF8pFJy9YN@straasha.imrryr.org>
Reply-To: uta@ietf.org
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Disposition: inline
In-Reply-To: <MN2PR11MB4351F7BF452EF3C45C02196AF7B0A@MN2PR11MB4351.namprd11.prod.outlook.com> <f4uAUqwma6dZnvvieVptWA@mail.axillis.nl>
Archived-At: <https://mailarchive.ietf.org/arch/msg/uta/W6kIYw4YVKjX6jAQ8y8KBAD86KM>
Subject: Re: [Uta] SMTP TLS reporting (RFC 8460), policy domains and DANE
X-BeenThere: uta@ietf.org
X-Mailman-Version: 2.1.39
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: Thu, 16 Nov 2023 20:02:43 -0000

On Tue, Nov 14, 2023 at 03:39:21PM +0100, Mechiel Lukkien wrote:

> I'm implementing (outgoing) SMTP TLS reporting (RFC 8460) in my mail
> server (https://github.com/mjl-/mox) and am getting confused by
> TLSRPT's use of "domain"/"recipient domain"/"policy domain",
> especially related to DANE. It seems to me these concepts are getting
> mixed up.

Just failure reports?  Or also success reports in the absence of any
failures?

>    o  Policy Domain: The domain against which a TLSRPT, an MTA-STS, or a
>       DANE policy is defined.  For TLSRPT and MTA-STS, this is typically
>       the same as the envelope recipient domain [RFC5321], but when mail
>       is routed to a "smarthost" gateway by local policy, the
>       "smarthost" domain name is used instead.  For DANE, the Policy
>       Domain is the "TLSA base domain" of the receiving SMTP server as
>       described in Section 2.2.3 of RFC 7672 and Section 3 of RFC 6698.

This is clear to me, the *policy* domain is the one that vends the
policy data, and that (in the form of TLSA records) is the TLSA "base
domain" (TLSA query name, less the "_port._protocol" attleaf labels).

> That approach seems reasonable to me, but most of the RFC seems
> written with the idea that only a recipient domain would have a TLSRPT
> record/policy.

Whoever manages the policy should receive the reports.  If DANE MTA
operators want to receive TLSRPT data, indeed they should publish
the relevant records for each of the MX hosts.

It is also possible for the recipient domain to configure "_smtp._tls"
TXT records, and if there's no reporting address for the affected MX
host, it is reasonable to fall back to the recipient domain as a
potential report destination.  So nobody will fault you for considering
both.

> I haven't had a per-mailhost TLSRPT DNS record for long
> on my mail host, but haven't received a TLS report for it.

DANE TLSRPT support for Postfix is under development at sys4.de I hear,
so some day you might see a report, but perhaps only if there's
something broken on your end.  If your domain is workign normally, I
would not expect success reports.

> I've only received 1 TLSRPT with a "tlsa" policy so far (along with
> the specified "sts" policy), from Microsoft, and it lists my recipient
> domain as the tlsa "policy-domain" (not the mx target which has the
> policy), so it seems they have an interpretation similar to what I
> initially had.

Or the sending MTA is not DANE enabled, or the implementation of TLSRPT
is presently only targetted at MTA-STS.

> I'm left wondering what the correct and/or intended interpration is
> for recipient/policy domain, whether mail hosts should have their own
> TLSRPT policy DNS record, and what the expected "policy-domain" values
> are in TLS reports.

An operator of a multi-tenant MTA who publishes DANE TLSA records, and
is interested in external reports of delivery issues to augment their
own (naturally comprehensive and robust) monitoring should publish
per MX host TXT records.  Since this is not a task that should fall
on each hosted recipient domain.

A recipient domain that manages its own MX hosts, or wants to hear
about delivery issues via their provider, might also publish a TLSRPT
DNS record.  A report sender might notify both if both are published
and specify different notification endpoints.

> - There can also be cases where only some MX targets of a recipient
> domain have a DANE policy.

Sure, and reports would go to the relevant operator when there's a
problem.

> - Since detecting injected MX targets is one of the goals of MTA-STS,
> I would expect a specific result type for when an MX target does not
> match the policy, but it seems missing.

The set of defined error conditions is not necessarily exhaustive,
if, while implementing, you think of compelling additions, propose
additional entires for the IANA registry.

> - A "TLS-Required: No" header from the Require TLS RFC can cause a
> verification failure to be ignored.

And even the policy to not be queried or evaluated, so the "failure"
might not even be observed, and would only have been a "failure" without
the override.

> I think it's still useful to report failure details, but the
> connection would succeed.

Perhaps, if the "failure" is observed, but ignored, though if mail
delivery is successful, I'd be inclined to not report a problem.  Let
the deliveries that actually enforce the policy provide the signal.  If
there are none, then in some sense there's no immediate problem.

Of course not all the senders that are failing will have TLSRPT support,
and perhaps only the bleeding edge server that also supports REQUIRETLS
is capable of TLSRPT as well, so the argument could go either way.

On Thu, Nov 16, 2023 at 01:59:16PM +0000, Brotman, Alex wrote:

> The MX for foo.com could point at mx.example.net.  The TLSRPT will
> look for policy at _smtp._tls.foo.com, but DANE will look at
> _25._tcp.mx.example.net.

Small correction, the TLS policy domain is the TLSA "base domain",
i.e. without the "_25._tcp" attrleaf labels.

-- 
    Viktor.