Re: [spfbis] RFC6147 and RFC7208 interoperability issues

Klaus Frank <klaus.frank@posteo.de> Mon, 07 February 2022 02:54 UTC

Return-Path: <klaus.frank@posteo.de>
X-Original-To: spfbis@ietfa.amsl.com
Delivered-To: spfbis@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 3D01D3A1220 for <spfbis@ietfa.amsl.com>; Sun, 6 Feb 2022 18:54:35 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.099
X-Spam-Level:
X-Spam-Status: No, score=-2.099 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, SPF_HELO_NONE=0.001, 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=posteo.de
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 QDm41gZ3F1hn for <spfbis@ietfa.amsl.com>; Sun, 6 Feb 2022 18:54:28 -0800 (PST)
Received: from mout01.posteo.de (mout01.posteo.de [185.67.36.65]) (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 0DFA43A1215 for <spfbis@ietf.org>; Sun, 6 Feb 2022 18:54:27 -0800 (PST)
Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 9F26E240026 for <spfbis@ietf.org>; Mon, 7 Feb 2022 03:54:25 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.de; s=2017; t=1644202465; bh=zufe36YGu14D71gHvr87IfNjeo9UGKTXYtW/jLP1cGM=; h=Date:Subject:To:From:From; b=O3uwvIXY/+WYnkZYDQggvmr/qWZE7OpobLIueKv67UM/Jmu2c65gQrpm27kLAOI6Z NeyI6zkjdmt5ZXK3cLqBhPP6jTzj7436FPZm8nyBVhMAG7PQQ4AaK4zh7cJWiIpxbQ os2YTfo73iOuwIn9sSgLjH7U4/8zzpDOiiCHuoVZzAvKMo9wMKFMG7yW/fXHANN/9U R4eMKk5y6oTllpEhietNQL4KtHs45w+UtQw5JtwnRymZUKF3NZsNR0Au+ZcV91P59A bIVA30oQSLptYuuKkN087eJR5I/lHA7qDCqmLUcSyPB3D6T/OJ3hOZZFTjFj1eyUpd MKa73uubHDKZQ==
Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4JsW290x60z9rxD for <spfbis@ietf.org>; Mon, 7 Feb 2022 03:54:24 +0100 (CET)
Message-ID: <c4b7de28-3eca-ee3e-fd8c-4181c91504ed@posteo.de>
Date: Mon, 07 Feb 2022 02:54:22 +0000
MIME-Version: 1.0
Content-Language: en-US
To: spfbis@ietf.org
References: <45e423cc-4095-cca2-bf8c-aa15e977b19c@posteo.de> <8021771.rLJEViv2lv@localhost> <85cb8ec0-4316-c4db-4aed-2d49fda46f49@posteo.de> <45673006.FIhfuaby8d@localhost> <20220206224715.kzynnbwkt5a26wii@crankycanuck.ca> <7ddee9f68efbef4bcf2dbfef69b0766a@leibzon.org> <f2fccd74-355e-12b4-6b8a-539f61561a12@posteo.de> <E633D5D6-AFE1-4BDD-B202-1ED90A1F9CEF@isc.org>
From: Klaus Frank <klaus.frank@posteo.de>
In-Reply-To: <E633D5D6-AFE1-4BDD-B202-1ED90A1F9CEF@isc.org>
Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg="sha-512"; boundary="------------ms020100020800000802080503"
Archived-At: <https://mailarchive.ietf.org/arch/msg/spfbis/sReTrgb85WdxZZ7q3wPFAi2qTkQ>
Subject: Re: [spfbis] RFC6147 and RFC7208 interoperability issues
X-BeenThere: spfbis@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: SPFbis discussion list <spfbis.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/spfbis>, <mailto:spfbis-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/spfbis/>
List-Post: <mailto:spfbis@ietf.org>
List-Help: <mailto:spfbis-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/spfbis>, <mailto:spfbis-request@ietf.org?subject=subscribe>
X-List-Received-Date: Mon, 07 Feb 2022 02:54:35 -0000

Oh dear, it's even worse than I thought. Is there an errata or update 
rfc for that?

On 2022-02-07 02:45, Mark Andrews wrote:
> Despite what you quote here, DNS64 is incompatible with DNSSEC because it hijacked the CD bit for a different purpose.  For a DNSSEC validator to work through another nameserver it needs to be able to send both CD=0 and CD=1
> requests WITHOUT the records being modified.  The DNS64 working group was told this at the time but refused to listen.
>
> CD=1 to handle bad time / bad trust anchors in the upstream nameservers.
> CD=0 to handle spoofed / expired responses being sent to the upstream nameservers.
>
> in BOTH cases the client validates the responses.  If the validation fails the first way, it should attempt the
> request again with the CD bit in the other state.  If the second query fails then you have an actual DNSSEC failure.
>
> Below was just wishful thinking upon behalf of the DNS64 working group.  They wanted a signal that meant the client is performing validation and refused to accept “if DO=1 then you have to assume the client is validating."
>
>     3.  A security-aware and non-validating DNS64 receives a query with
>         the DO bit set and the CD bit clear.  Such a resolver is not
>         validating responses, likely due to local policy (see [RFC4035],
>         Section 4.2).  For that reason, this case amounts to the same as
>         the previous case, and no validation happens.
>
> Making CD into a modify the response signal was/is incompatible with how DNSSEC uses CD.
>
> Mark
>
>> On 7 Feb 2022, at 12:07, Klaus Frank <klaus.frank@posteo.de> wrote:
>>
>>
>> On 2022-02-07 01:42, william@leibzon.org wrote:
>>> Yeah, I wasn't thrilled with the idea of SPF using TXT record way back when. It opened it for quite a few others who followed. Putting ip addresses there though is not something that is done for any other protocol or software I can immediately think of.
>>>
>>> I'm curious, how does DNS64 inter-operates with DNSSEC? Would that not break it and make DNSSEC folks very uncomfortable about what others could decide to do?
>>>
>> Basically by offloading it towards the DNS64 server.
>>
>> https://datatracker.ietf.org/doc/html/rfc6147#section-6.2
>>
>> 6.2.  DNSSEC Validators and DNS64
>>
>>     An existing DNSSEC validator (i.e., one that is unaware of DNS64)
>>     might reject all the data that comes from DNS64 as having been
>>     tampered with (even if it did not set CD when querying). *If it is**
>> **   necessary to have validation behind the DNS64, then the validator**
>> **   must know how to perform the DNS64 function itself*. Alternatively,
>>     the validating host may establish a trusted connection with a DNS64,
>>     and allow the DNS64 recursive resolver to do all validation on its
>>     behalf.
>>
>>> I think it could be helpful to collect various protocol operational and similar issues for those running mail servers (and other servers) behind NAT64 and write informational RFC which would be soft of experimental best practice. I'd expect that some server software would have to add special features to be used in this setup.
>>>
>> "special features" is exactly what I wanted to avoid. Also I don't know if it's strictly necessary to have a dedicated RFC for how to do the migration. Besides this issue with the SPF record it's basically the same as for any other server application. Use stateless NAT64 (aka. IPv4aaS) to have a dedicated public IPv4. Put that IPv4 (prefix) into the SPF record as usual. And for now disable the SPF validation for inbound mails. The only really noteworthy thing is with filtering stuff like SIEVE that these need to be updated to include their mapped IPv6 addresses or similar. Everything else just works because of NAT64 and DNS64...
>>
>>> On 2022-02-06 14:47, Andrew Sullivan wrote:
>>>
>>>> Hi,
>>>>
>>>> I'm one of the primary offenders behind DNS64.  I work for the Internet Society but I am not speaking for them (or anyone eles) right now.
>>>>
>>>> On Sun, Feb 06, 2022 at 02:57:08PM -0500, Scott Kitterman wrote:
>>>>
>>>>> I think your original suggestion that an SPF record be modified by the DNS64
>>>>> server to add ip6: mechanisms with <prefix> + <address> is a reasonable path
>>>>> forward, but I think it's really an RFC 6147 discussion, not so much RFC 7208.
>>>> The problem with this is that it's importing the DNS64 intimate knowledge of this protocol for TXT records, which means in effect that DNS64 needs to start parsing arbitrary data in TXT records.  (There is a reason DNS weenies always got upset about ignoring the strong typing in DNS, and this is an example of it.)
>>>>
>>>> DNS64, to be honest, was always sort of a hack that was intended to make transition to v6 easier.  It really basically depended on the strong data typing of A, AAAA, and PTR records in order to give it clear places to insert itself.  "Look at every TXT record," doesn't really support that plan.  I never thought we were designing it for long life or high degrees of robustness, and I think it is likely to be extremely difficult to operate a modern mail server on v6-only infrastructure and be able to talk to v4-only mail servers.  In any case, I guess it would be _possible_ to teach a DNS64 server to parse and edit TXT records on the fly, but the idea that this is going to be limited to SPF is, I suspect, a false hope.  For that reason, my reaction is that it wouldn't be a great idea to do. I nevertheless sympathize with the desire, even though I am made nervous about the implications.
>>>>
>>>>> It is not, however, without risks.  RFC 7208 Section 3.4 gives advice on SPF
>>>>> record size.  Your proposed approach would increase the record size, which, in
>>>>> theory, could be problematic.  It might be that anything running on an IPv6
>>>>> only network is modern enough that this isn't actually a problem.  I don't
>>>>> know.
>>>> I'd be especially worried about RRset size, because a lot of stuff in contemporary operations is jammed into TXT records (all those application keys, for instance).  I can imagine cases where the change could move the response size across the response size boundary, forcing truncation and TCP fallback.
>>>>
>>>> Best regards,
>>>>
>>>> A
>>> _______________________________________________
>>> spfbis mailing list
>>> spfbis@ietf.org
>>> https://www.ietf.org/mailman/listinfo/spfbis
>> _______________________________________________
>> spfbis mailing list
>> spfbis@ietf.org
>> https://www.ietf.org/mailman/listinfo/spfbis