Re: [Ietf-dkim] DKIM issues (tag "v=DKIM1", tag "p=")

Jan Dušátko <jan@dusatko.org> Tue, 16 May 2023 16:18 UTC

Return-Path: <jan@dusatko.org>
X-Original-To: ietf-dkim@ietfa.amsl.com
Delivered-To: ietf-dkim@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 18B0AC1527AE for <ietf-dkim@ietfa.amsl.com>; Tue, 16 May 2023 09:18:45 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.097
X-Spam-Level:
X-Spam-Status: No, score=-2.097 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, HTML_MESSAGE=0.001, NICE_REPLY_A=-0.001, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_PASS=-0.001, 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 (2048-bit key) header.d=dusatko.org header.b="sSnPJ6To"; dkim=pass (2048-bit key) header.d=dusatko.org header.b="AxyXkp5P"; dkim=pass (2048-bit key) header.d=dusatko.org header.b="BPS2SfKn"
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 KWwm5quxBSd7 for <ietf-dkim@ietfa.amsl.com>; Tue, 16 May 2023 09:18:40 -0700 (PDT)
Received: from vhost.cz (hermes.vhost.cz [82.208.29.84]) (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 591DEC151547 for <ietf-dkim@ietfa.amsl.com>; Tue, 16 May 2023 09:18:37 -0700 (PDT)
Received: from localhost (localhost [127.0.0.1]) by hermes.vhost.cz (Postfix) with ESMTP id 9CB4F80425 for <ietf-dkim@ietfa.amsl.com>; Tue, 16 May 2023 18:18:35 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=dusatko.org; s=key2048; t=1684253915; bh=1ceTMBBlSa54TLOUIij36uh62e/8SckyZ9NC449TqvA=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=sSnPJ6TojgfHiFNmezYzvJGQyPc9YzEuteP1sXGFLoAAB96O2hn6JHDjQpCCW8Pnd wtOy9MKxCCh3q/uIIpEuDV3wb+0kSMhF1gx4k/19WxxwsrPcoA2QCLKK8Ji0joxNGp dYTElleuruEmQ79lUHPusEk39TT7QwHsjd4KIfDh11MuYNM99XUtesRso6UUhbit76 hBceJBXj6T7anvs+zfS8/MKBKCTiOPZ5eM78XnicjxphhNBvf1uDE0ihSnDvqGXPyl pm1BbzKKMnLPSO/thS92cquXEfkal0muLY+/1vtEiTlTcuXaq3ToIwgYa+PxOVlvV4 kI4XrD7eFJOIA==
X-Virus-Scanned: Debian amavisd-new at hermes.vhost.cz
Received: from vhost.cz ([127.0.0.1]) by localhost (hermes.vhost.cz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 9aKQT3rFg8L7 for <ietf-dkim@ietfa.amsl.com>; Tue, 16 May 2023 18:18:34 +0200 (CEST)
Received: by hermes.vhost.cz (Postfix, from userid 115) id 2D71880433; Tue, 16 May 2023 18:18:34 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=dusatko.org; s=key2048; t=1684253914; bh=1ceTMBBlSa54TLOUIij36uh62e/8SckyZ9NC449TqvA=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=AxyXkp5P052Bmgm4g1gy2IpXMrrfp1EMAD3q6ZyA+iD/uEoka8U6SMCGVGNttWxs6 4MorO+v+bZ9OFQhnyadm+QTQzkwBoWzx8j5Kqmdskb6Bhfs0pCqGf+flpGdKBhDk1S LjqNUPpvh3ve3a8I22vwIVK0v/v+Z7ZfDNkXjty5dwpaVBc91HFI9FtauuJKwPDk4g cEYGFwKeY6TndC6mG8Dz5Afv3gt3xGOd9EWdf9hLCdRDzD7XqFidt/ijNfiWuXhjiG j2ZIqRIvk80yM8F0iBpWM0UXkxShPTfnKgz7AhRKhl5WZ7k5lIEQmlPg8DUt0GL20r R3TE2oIdg5zKA==
X-Spam-Virus: Error (Cannot connect to unix socket '/var/run/clamdav/clamd.ctl': connect: No such file or directory)
X-Spam-Pyzor: Reported 0 times.
X-Spam-DCC: :
Received: from [192.168.1.50] (static-84-242-66-51.bb.vodafone.cz [84.242.66.51]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange ECDHE (P-256) server-signature ECDSA (P-384) server-digest SHA384) (Client did not present a certificate) by hermes.vhost.cz (Postfix) with ESMTPSA id B68CF80425; Tue, 16 May 2023 18:18:29 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=dusatko.org; s=key2048; t=1684253910; bh=1ceTMBBlSa54TLOUIij36uh62e/8SckyZ9NC449TqvA=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=BPS2SfKnQkK/bp7xaRZF2WnTAbYnE6iXYTdBQ7VV31OTAoc1uV1oNeRPKAzILo3B+ YzEwxwC/uWpUnNvN0r2u7cIZwdbhepUtF54uTp2ejdZyke611jlNavhyX5ORvX/I/z yv6UAWG9djf4k6/nJ6wrFevrUow2p0rrZI42lV1fWD8UK3/31PhvL8Mt2kuu9zjxAB ivD0TBS2cOAgqvuGp6KtYYCKQjULYRqU1ZgCyVFCsoqsvF+v95Au4rZZP4+MwwBdiJ 5ZGi/4g8PX63YH4eMluiTWEN0XvvSfXrKfh9z8ZMHZ2t9kdoKE52k+/4bYQOF3ZUGR QVYa+4hZF/yBA==
Content-Type: multipart/alternative; boundary="------------ODETpbisbHxiIWgq5bNRGMux"
Message-ID: <9992ad8c-9676-1780-58f9-d45703719503@dusatko.org>
Date: Tue, 16 May 2023 18:18:27 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Windows NT 6.3; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.10.1
Content-Language: en-GB
To: "Murray S. Kucherawy" <superuser@gmail.com>
Cc: ietf-dkim@ietfa.amsl.com
References: <e2afdc9b-3c71-a045-8fff-0cd9095a8464@dusatko.org> <CAL0qLwbDufOOKrVSj4zwKvAgpmUNU7c0sWGjS-V380q1E0X1tA@mail.gmail.com>
From: Jan Dušátko <jan@dusatko.org>
In-Reply-To: <CAL0qLwbDufOOKrVSj4zwKvAgpmUNU7c0sWGjS-V380q1E0X1tA@mail.gmail.com>
Archived-At: <https://mailarchive.ietf.org/arch/msg/ietf-dkim/YnE_pSt40yImB49Zn-0ZHuRTFhg>
Subject: Re: [Ietf-dkim] DKIM issues (tag "v=DKIM1", tag "p=")
X-BeenThere: ietf-dkim@ietf.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: IETF DKIM List <ietf-dkim.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/ietf-dkim>, <mailto:ietf-dkim-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/ietf-dkim/>
List-Post: <mailto:ietf-dkim@ietf.org>
List-Help: <mailto:ietf-dkim-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/ietf-dkim>, <mailto:ietf-dkim-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 16 May 2023 16:18:45 -0000

Hi
thank you for answers. Seems that I overlooked some details inside RFCs 
and my idea are not needed as I think

Murray S. Kucherawy wrote:
 > if it's a TXT record and it is in a DKIM DNS naming path, it better 
be a DKIM record.
You are right. I trying to do strict syntax check, but I also looking 
for arguments, which let me to remove invalid keys.

Dne 16. 5. 2023 v 17:52 Murray S. Kucherawy napsal(a):
> On Tue, May 16, 2023 at 7:00 AM Jan Dušátko <jan=
> 40dusatko.org@dmarc.ietf.org> wrote:
>
>> 1) At this moment, the use of the tag "v=DKIM1;" is only RECOMMENDED and
>> if this tag is used, it must be the first. Unlike, for example, SPF and
>> DMARC, this is not a REQUIRED (MANDATORY) record. In case of an attempt
>> to identify DKIM records, then there is a situation where it is not
>> possible to determine which records are DKIM keys. Often, these keys are
>> in other places where they allow to create CNAME to the expected
>> location of the selector. These locations may be application dependent
>> or may be with third parties configuration. From my perspective,
>> MANDATORY record "v=DKIM1;" could help to identify DKIM keys much easily.
>>
> I don't get the impression that identifying a record that contains a valid
> DKIM key record is hard.  The ABNF is pretty clear.  It's certainly easier
> to say "does this start v=DKIM1;?" than it is to run a full parser on it,
> but I imagine if you try to stuff a random string through a DKIM key
> parser, it'll know pretty quickly most of the time that the record isn't
> valid given the second character pretty much has to be "=" which is going
> to trim a lot of cruft right away.
>
> Also, a change to make this REQUIRED would take forever for the world to
> adapt.  There's a great deal of inertia out there, and the benefit of such
> a change isn't going to be obvious to the broader community, so you're
> going to find records in the current format for years to come, and
> implementations would justifiably accept the old format for some long
> transition period.
I understand and accept this approach, but I would like to make a few 
comments based on the timeline. Domainkey was standardized in 2007, in 
the same year it was replaced by DKIM. This standard was replaced in 
2011 by a newer one, which continues to expand. In my opinion, for the 
sake of interoperability, it is also necessary to address the gradual 
transition to more complex technologies, as well as to prepare these 
technologies for possible replacement. In my opinion, this is the 
purpose of header records. Then the question is, is 16 years enough 
time, given the age of email 50 years? Currently, technologies like DKIM 
are used to protect the domain (brand) from misuse, and the importance 
of these technologies will continue to grow.

Dave Crocker wrote:

> If a version change marks a change to the basic standard -- ie, a change 
> that is incompatible with the previous version -- then it is not a 
> version change.  It is creation of a new protocol.

I understand. I did not take proper care about former DomainKey, which can make everything worse. Simple backward compatibility and I forget it.

> Are you talking about DKIM records out in the general Internet, or only
> within domains you control?
I talking about domains under my control. But part of records has been 
provided by 3rd party, I would like to enforce strict compliance with 
current RFCs (SPF, DKIM, DMARC ...)
>
>> 2) Is it possible to specify precisely under which conditions the DKIM
>> key is valid? Some third party records contain only an empty record "",
>> others contain only revoked key like "p=" or it is a reference to a
>> non-existent record. Unfortunately, RFCs do not provide unambiguous
>> information on under which conditions this record is invalid. From my
>> perspective, use of non-existing records or empty strings can draw that
>> key useless, but rules specifying that in RFC or BCP will be welcome.
>>
> I disagree that this is ambiguous.  An empty string isn't a valid DKIM key
> record.  An empty "p=" value is a valid DKIM key record indicating "there
> was a key here, but it's been revoked".
>
Steve Aktins wrote:

> Section 3.6.1 of RFC 6376 describes the p= value as REQUIRED.

I overlooked that before, which make negotiation about compliance harder.

>> 3) The "p=key" information containing the key material information
>> encoded by Base64 should occur in the key exactly once. I did not find a
>> condition in RFC for the existence of this record. I found only
>> information on implementation behavior, when "p=", i.e. an empty key
>> material, is considered revoked. However, it is not unambiguous whether
>> this approach is acceptable. Also specification of that rules can make
>> my life much easier.
>>
> I also disagree that this is ambiguous.  The RFC is pretty clear about what
> an empty "p=" means.
>
> -MSK
>
Regards

Jan

-- 
-- --- ----- -
Jan Dušátko

Tracker number:	+420 602 427 840
e-mail:		jan@dusatko.org
GPG Signature:	https://keys.dusatko.org/E535B585.asc
GPG Encrypt:	https://keys.dusatko.org/B76A1587.asc