RFC 7929

DNS-Based Authentication of Named Entities (DANE) Bindings for OpenPGP

๐Ÿ“… published August 2016, from ietf

DNS-Based Authentication of Named Entities (DANE) Bindings for OpenPGP ๐Ÿ’œ

This one is RFC 7929, published by the Internet Engineering Task Force (IETF) in August 2016 ๐ŸŽ€. The author is P. Wouters from Red Hat, and the category is Experimental ๐Ÿงช. The ISSN is 2070-1721. The header doesn't list anything it obsoletes or updates.

Abstract ๐ŸŒธ

OpenPGP is the message format people use to encrypt email (and files) ๐Ÿ’Œ, but it doesn't have a standard way to securely look up OpenPGP public keys ๐Ÿ˜ญ. DANE is a method for publishing public keys in DNS. This document specifies a DANE method for publishing and locating OpenPGP public keys in DNS for a specific email address, using a brand-new OPENPGPKEY DNS resource record ๐Ÿฆ‹. Security comes from Secure DNS, but the OPENPGPKEY record is not a replacement for checking authenticity via the "web of trust" or manual verification ๐Ÿ”. The OPENPGPKEY record can be used to encrypt an email that would otherwise have to be sent unencrypted ๐Ÿ”.

Status of This Memo ๐Ÿ“œ

This document isn't an Internet Standards Track specification. It's published for examination, experimental implementation, and evaluation ๐Ÿง.

It defines an Experimental Protocol for the Internet community ๐Ÿงช. It's a product of the IETF and represents the consensus of the IETF community. It got public review and was approved for publication by the Internet Engineering Steering Group (IESG). Not every document the IESG approves is a candidate for any level of Internet Standard; see Section 2 of RFC 7841 ๐Ÿ“š.

You can find info about this document's current status, any errata, and how to send feedback at http://www.rfc-editor.org/info/rfc7929 โœจ.

Copyright (c) 2016 IETF Trust and the persons identified as the document authors. All rights reserved ๐Ÿ’–.

This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (http://trustee.ietf.org/license-info) as in effect on the date of publication. Please read these documents carefully, bestie, because they spell out your rights and restrictions for this document ๐Ÿ“‘. Code Components extracted from this document must include Simplified BSD License text, as described in Section 4.e of the Trust Legal Provisions, and they come without warranty as described in the Simplified BSD License โš–๏ธ.

Table of Contents ๐Ÿ—บ๏ธ

   1.  Introduction  . . . . . . . . . . . . . . . . . . . . . . . .   4
     1.1.  Experiment Goal . . . . . . . . . . . . . . . . . . . . .   4
     1.2.  Terminology . . . . . . . . . . . . . . . . . . . . . . .   5
   2.  The OPENPGPKEY Resource Record  . . . . . . . . . . . . . . .   5
     2.1.  The OPENPGPKEY RDATA Component  . . . . . . . . . . . . .   6
       2.1.1.  The OPENPGPKEY RDATA Content  . . . . . . . . . . . .   6
       2.1.2.  Reducing the Transferable Public Key Size . . . . . .   7
     2.2.  The OPENPGPKEY RDATA Wire Format  . . . . . . . . . . . .   7
     2.3.  The OPENPGPKEY RDATA Presentation Format  . . . . . . . .   7
   3.  Location of the OPENPGPKEY Record . . . . . . . . . . . . . .   8
   4.  Email Address Variants and Internationalization
       Considerations  . . . . . . . . . . . . . . . . . . . . . . .   9
   5.  Application Use of OPENPGPKEY . . . . . . . . . . . . . . . .  10
     5.1.  Obtaining an OpenPGP Key for a Specific Email Address . .  10
     5.2.  Confirming that an OpenPGP Key is Current . . . . . . . .  10
     5.3.  Public Key UIDs and Query Names . . . . . . . . . . . . .  10
   6.  OpenPGP Key Size and DNS  . . . . . . . . . . . . . . . . . .  11
   7.  Security Considerations . . . . . . . . . . . . . . . . . . .  11
     7.1.  MTA Behavior  . . . . . . . . . . . . . . . . . . . . . .  12
     7.2.  MUA Behavior  . . . . . . . . . . . . . . . . . . . . . .  13
     7.3.  Response Size . . . . . . . . . . . . . . . . . . . . . .  14
     7.4.  Email Address Information Leak  . . . . . . . . . . . . .  14
     7.5.  Storage of OPENPGPKEY Data  . . . . . . . . . . . . . . .  14
     7.6.  Security of OpenPGP versus DNSSEC . . . . . . . . . . . .  15
   8.  IANA Considerations . . . . . . . . . . . . . . . . . . . . .  15
     8.1.  OPENPGPKEY RRtype . . . . . . . . . . . . . . . . . . . .  15
   9.  References  . . . . . . . . . . . . . . . . . . . . . . . . .  15
     9.1.  Normative References  . . . . . . . . . . . . . . . . . .  15
     9.2.  Informative References  . . . . . . . . . . . . . . . . .  16
   Appendix A.  Generating OPENPGPKEY Records  . . . . . . . . . . .  18
   Appendix B.  OPENPGPKEY IANA Template . . . . . . . . . . . . . .  19
   Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . .  20
   Author's Address  . . . . . . . . . . . . . . . . . . . . . . . .  20

1. Introduction โœจ

OpenPGP [RFC4880] public keys are what people use to encrypt or sign email messages and files ๐Ÿ’Œ. To encrypt an email message, or verify a sender's OpenPGP signature, the email client (the Mail User Agent, or MUA) or the email server (the Mail Transfer Agent, or MTA) needs to find the recipient's OpenPGP public key ๐Ÿ”.

OpenPGP clients have relied on centralized "well-known" key servers that are reached with the HTTP Keyserver Protocol [HKP] ๐ŸŒ. The other option is for users to manually browse a bunch of different front-end websites ๐Ÿ™„. These key servers don't require confirmation of the email address used in the User ID (UID) of an uploaded OpenPGP public key ๐Ÿšฉ. Attackers can -- and have -- uploaded rogue public keys with other people's email addresses to these servers ๐Ÿ’€.

Once uploaded, public keys can't be deleted ๐Ÿ˜ฉ. People who didn't pre-sign a key revocation can never remove their OpenPGP public key from these key servers once they've lost their private key. That means they end up receiving encrypted email they can't decrypt ๐Ÿ’”.

So these key servers aren't well suited to helping MUAs and MTAs automatically encrypt email, especially when there's no interactive user around ๐Ÿค–.

This document describes a mechanism for linking a user's OpenPGP public key to their email address, using the OPENPGPKEY DNS RRtype ๐ŸŽ€. These records are published in the DNS zone of the user's email address. If a user loses their private key, the OPENPGPKEY DNS record can simply be updated or removed from the zone ๐Ÿงน.

The OPENPGPKEY data is secured using Secure DNS [RFC4035] ๐Ÿ”’.

The main goal of the OPENPGPKEY resource record is to stop passive attacks against plaintext emails ๐Ÿ›‘. It can also thwart some active attacks (like people uploading rogue keys to key servers in the hopes that others will encrypt to them). Still, this resource record is not a replacement for verifying OpenPGP public keys via "web of trust" signatures, or manually via a fingerprint verification ๐Ÿ’….

1.1. Experiment Goal ๐Ÿงช

This specification is one experiment in improving access to public keys for end-to-end email security ๐Ÿ”. There's a range of ways this can reasonably be done for OpenPGP or S/MIME, for example using the DNS, or SMTP, or HTTP. Proposals for each of these have been made, with various levels of support in terms of implementation and deployment. For each such experiment, specifications like this one let experiments be carried out that may succeed, or that may uncover technical or other impediments to large- or small-scale deployments. The IETF encourages people implementing and deploying these experiments to publicly document their experiences, so future specifications in this space can benefit ๐Ÿ“.

This document defines an RRtype whose use is Experimental. The goal of the experiment is to see whether encrypted email usage increases if an automated discovery method is available to MTAs and MUAs, helping end users with email encryption key management ๐Ÿ“ˆ.

It's unclear whether this RRtype will scale to some of the larger email service deployments. People have raised concerns about the size of the OPENPGPKEY record and the size of the resulting DNS zone files ๐Ÿ˜ฌ. This experiment will hopefully give the working group some insight into whether or not that's a problem ๐Ÿ•ต๏ธ.

If the experiment is successful, the findings are expected to result in an updated document for standards track approval ๐Ÿ†.

The OPENPGPKEY RRtype somewhat resembles the generic CERT record defined in [RFC4398]. However, the CERT record uses sub-typing with many different types of keys and certificates. It's suspected that its general application to very different protocols (PKIX versus OpenPGP) is the reason for the lack of implementation and deployment ๐Ÿคท. Furthermore, the CERT record uses sub-typing, which is now considered a bad idea for DNS ๐Ÿ™….

1.2. Terminology ๐Ÿ“–

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119 [RFC2119] ๐ŸŽฏ.

This document also uses standard DNSSEC and DANE terminology. See DNSSEC [RFC4033], [RFC4034], [RFC4035], and DANE [RFC6698] for these terms ๐Ÿง .

2. The OPENPGPKEY Resource Record ๐Ÿ“

The OPENPGPKEY DNS resource record (RR) is used to link an end entity OpenPGP Transferable Public Key (see Section 11.1 of [RFC4880]) to an email address, forming an "OpenPGP public key association" ๐Ÿ”—. Someone who wants more than one OpenPGP key, for example because they're transitioning to a newer, stronger key, can do that by adding multiple OPENPGPKEY records. A single OPENPGPKEY DNS record MUST only contain one OpenPGP key ๐Ÿ”‘.

The type value allocated for the OPENPGPKEY RR type is 61. The OPENPGPKEY RR is class independent ๐Ÿ”ข.

2.1. The OPENPGPKEY RDATA Component ๐ŸŽ

The RDATA portion of an OPENPGPKEY resource record contains a single value, which is a Transferable Public Key formatted as specified in [RFC4880] ๐Ÿ“ฆ.

2.1.1. The OPENPGPKEY RDATA Content ๐Ÿ’Ž

An OpenPGP Transferable Public Key can be arbitrarily large, but DNS records are limited in size ๐Ÿ“. So when creating OPENPGPKEY DNS records, the OpenPGP Transferable Public Key should be filtered to only contain appropriate and useful data. At a minimum, an OPENPGPKEY Transferable Public Key for the user hugh@example.com should contain:

             o The primary key X
               o One User ID Y, which SHOULD match 'hugh@example.com'
                 o Self-signature from X, binding X to Y

If the primary key is not encryption-capable, at least one relevant subkey should be included, resulting in an OPENPGPKEY Transferable Public Key containing:

           o The primary key X
             o One User ID Y, which SHOULD match 'hugh@example.com'
               o Self-signature from X, binding X to Y
             o Encryption-capable subkey Z
               o Self-signature from X, binding Z to X
             o (Other subkeys, if relevant)

The user can also choose to add a few third-party certifications, which they believe would help with validation in the traditional "web of trust" ๐Ÿ•ธ๏ธ. The resulting OPENPGPKEY Transferable Public Key would then look like this ๐Ÿ‘‘:

           o The primary key X
             o One User ID Y, which SHOULD match 'hugh@example.com'
               o Self-signature from X, binding X to Y
               o Third-party certification from V, binding Y to X
               o (Other third-party certifications, if relevant)
             o Encryption-capable subkey Z
               o Self-signature from X, binding Z to X
             o (Other subkeys, if relevant)

2.1.2. Reducing the Transferable Public Key Size ๐Ÿ’…โœจ

okay bestie, so say you're prepping a Transferable Public Key for one of these OPENPGPKEY RDATA formats and your goal is to make the certificate as small as possible ๐Ÿซถ you'd usually wanna do a few things:

  • Where one User ID from the certifications matches the looked-up address, strip away the non-matching User IDs and any certifications attached to them (self-signatures or third-party certifications). ๐ŸŽ€
  • Strip away all User Attribute packets and their associated certifications. ๐Ÿงš
  • Strip away all expired subkeys. ๐Ÿ’€ You might wanna keep revoked subkeys if they were revoked before their preferred expiration time, so correspondents actually know about those earlier-than-expected revocations. ๐Ÿ‘‘
  • Strip away all but the most recent self-signature for the remaining User IDs and subkeys. ๐Ÿ“
  • Optionally strip away any uninteresting or unimportant third-party User ID certifications. This is a value judgment by the user and it's lowkey hard to automate ๐Ÿ™ˆ At the very least, expired and superseded third-party certifications should be stripped out. ๐Ÿ˜ญ The user should try to keep the most recent and most well-connected certifications in the "web of trust" in their Transferable Public Key. ๐ŸŒˆ

2.2. The OPENPGPKEY RDATA Wire Format ๐Ÿฆ‹

ngl this one is simple: the RDATA Wire Format is a single OpenPGP Transferable Public Key as defined in Section 11.1 of [RFC4880]. No ASCII armor, no base64 encoding, just the raw key ๐Ÿ’œ

2.3. The OPENPGPKEY RDATA Presentation Format ๐ŸŒธ

The RDATA Presentation Format, the one you see in master files [RFC1035], is a single OpenPGP Transferable Public Key as defined in Section 11.1 of [RFC4880], encoded in base64 as defined in Section 4 of [RFC4648]. It's giving "same key, different outfit" ๐Ÿ’…


3. Location of the OPENPGPKEY Record ๐Ÿ—บ๏ธ

okay so the DNS doesn't allow every character that email addresses support in the "local-part" (the bit before the @) as defined in [RFC5322] and [RFC6530]. ๐Ÿ˜ญ So email addresses get mapped into DNS with the following method:

  1. The "left-hand side" of the email address, called the "local-part" in both the mail message format definition [RFC5322] and the internationalized email spec [RFC6530], gets encoded in UTF-8 (or its ASCII subset). If the local-part is written in another charset, it MUST be converted to UTF-8. ๐Ÿซง
  2. The local-part gets canonicalized first using these rules. If the local-part is unquoted, any comments and/or folding whitespace (CFWS) around dots (".") gets removed. Any enclosing double quotes get removed. Any literal quoting gets removed too. โœจ
  3. If the local-part has any non-ASCII characters, it SHOULD be normalized using Unicode Normalization Form C from [Unicode90]. The recommended normalization rules are in Section 10.1 of [RFC6530]. ๐ŸŒธ
  4. The local-part gets hashed with SHA2-256 [RFC5754], truncated to 28 octets and written in hexadecimal. This becomes the left-most label in the prepared domain name. ๐Ÿ”
  5. The string "_openpgpkey" becomes the second left-most label. ๐ŸŽ€
  6. The domain (the "right-hand side" of the email address, called the "domain" in [RFC5322]) gets appended to the result of step 4 to finish the prepared domain name. ๐Ÿฆ‹

For example, if you wanna request an OPENPGPKEY record for a user with the email address "hugh@example.com", you'd place an OPENPGPKEY query for this QNAME:

"c93f1e400f26708f98cb19d936620da35
eec8f72e57f9eec01c1afd6._openpgpkey.example.com"

And the corresponding RR in the example.com zone might look like this (key shortened for formatting ๐Ÿ™ˆ):

c9[..]d6._openpgpkey.example.com. IN OPENPGPKEY <base64 public key>

4. Email Address Variants and Internationalization Considerations ๐ŸŒ

Mail systems usually handle variant forms of local-parts. ๐Ÿซ  The most common variants are upper- and lowercase, often auto-corrected when a name gets recognized as such. Other variants are systems that ignore "noise" characters like dots, so the local-parts 'johnsmith' and 'John.Smith' would be equivalent. Many systems also allow "extensions" like 'john-ext' or 'mary+ext', where 'john' or 'mary' is treated as the effective local-part and 'ext' gets passed to the recipient for further handling. This can complicate finding the OPENPGPKEY record for the dynamically created email address. ๐Ÿ˜ตโ€๐Ÿ’ซ

[RFC5321] and its predecessors have always made it clear that only the recipient MTA is allowed to interpret the local-part of an address. ๐Ÿ›‘ So sending MUAs and MTAs that support OPENPGPKEY MUST NOT perform any kind of mapping rules based on the email address. ๐Ÿ™…โ€โ™€๏ธ To improve the chances of finding OPENPGP RRs for a particular local-part, domains that allow variant forms (like treating local-parts as case-insensitive) might publish OPENPGP RRs for all variants of local-parts, might publish variants on first use (for example, a webmail provider that also controls DNS for a domain can publish variants as used by the owner of a particular local-part), or just publish OPENPGP RRs for the most common variants. ๐Ÿง

Section 3 above defines how the local-part gets used to figure out where to look for an OPENPGPKEY record. ๐Ÿ” Given the variety of local-parts out there, designing a good experiment for this is hard, because: a) some current implementations are known to lowercase at least US-ASCII local-parts, b) we know from (many) other situations that any strategy based on guessing and making multiple DNS queries is not going to achieve consensus for good reasons, and c) the underlying issues are just hard. See Section 10.1 of [RFC6530] for discussion of just some of the issues that would need to be tackled to fully address this problem. ๐Ÿฅฒ

Still, while this specification is not the place to try to fix these local-part issues, doing so is also not required to determine the outcome of this experiment. ๐Ÿคทโ€โ™€๏ธ If this experiment succeeds, further work on email addresses with non-ASCII local-parts will be needed. Based on the findings from this experiment, that work would be better than doing nothing, or than starting this experiment on a speculative approach to what is a very complex topic. ๐Ÿง 


5. Application Use of OPENPGPKEY ๐Ÿ”

The OPENPGPKEY record lets an application or service get an OpenPGP public key and use it to verify a digital signature or encrypt a message to that public key. ๐Ÿ’Œ The DNS answer MUST pass DNSSEC validation. If DNSSEC validation reaches any state other than "Secure" (as specified in [RFC4035]), the DNSSEC validation MUST be treated as a failure. ๐Ÿšซ

5.1. Obtaining an OpenPGP Key for a Specific Email Address ๐Ÿ“ฌ

If no OpenPGP public keys are known for an email address, an OPENPGPKEY DNS lookup MAY be performed to seek the OpenPGP public key that matches that email address. ๐Ÿ”Ž This public key can then be used to verify a received signed message, or to send out an encrypted email message. An application whose attempt fails to retrieve a DNSSEC-verified OPENPGPKEY RR from the DNS should remember that failure for some time, so it doesn't send out a DNS request for every email message it sends. Those DNS requests would constitute a privacy leak. ๐Ÿ•ต๏ธโ€โ™€๏ธ

5.2. Confirming that an OpenPGP Key is Current โฐ

Locally stored OpenPGP public keys don't get refreshed automatically. ๐Ÿ˜ฌ If the owner of a key creates a new OpenPGP public key, that owner can't securely notify every user and application holding the old one. Applications and users can do an OPENPGPKEY lookup to confirm that the locally stored OpenPGP public key is still the correct one to use. If the locally stored key is different from the DNSSEC-validated OpenPGP public key currently published in DNS, the confirmation MUST be treated as a failure, unless the locally stored OpenPGP key signed the newly published OpenPGP public key found in DNS. ๐Ÿ’” An application that can interact with the user MAY ask the user for guidance. Otherwise, the application has to apply local policy. For privacy reasons, an application MUST NOT look up an OpenPGP key from DNSSEC at every use of that key. ๐Ÿ™ˆ

5.3. Public Key UIDs and Query Names ๐Ÿชช

An OpenPGP public key can be associated with multiple email addresses by specifying multiple key UIDs. โœจ The OpenPGP public key obtained from an OPENPGPKEY RR can be used as long as the query and the resulting data form a proper email to UID identity association. ๐Ÿ’–

CNAMEs (see [RFC2181]) and DNAMEs (see [RFC6672]) can be followed to get an OPENPGPKEY RR, as long as the original recipient's email address appears as one of the OpenPGP public key UIDs. For example, say the OPENPGPKEY RR query for hugh@example.com (8d57[...]b7._openpgpkey.example.com) yields a CNAME to 8d57[...]b7._openpgpkey.example.net, and an OPENPGPKEY RR for 8d57[...]b7._openpgpkey.example.net exists. Then this OpenPGP public key can be used, provided one of the key UIDs contains "hugh@example.com". This public key cannot be used if it would only contain the key UID "hugh@example.net". ๐Ÿ”€

If one of the OpenPGP key UIDs contains only a single wildcard as the left-hand side of the email address, such as "@example.com", the OpenPGP public key may be used for any email address within that domain. ๐ŸŒ Wildcards in other spots (e.g., "hugh@.com") or regular expressions in key UIDs are not allowed, and any OPENPGPKEY RR containing these MUST be ignored. ๐Ÿšท


6. OpenPGP Key Size and DNS ๐Ÿ“

Because the OPENPGPKEY record can be pretty big, applications SHOULD use TCP (not UDP) to perform queries for the OPENPGPKEY resource record. ๐Ÿ›œ

Although the reliability of large DNS resource record transport has improved over the last few years, it's still recommended to keep DNS records as small as possible without sacrificing the security properties of the public key. ๐Ÿ’ช The algorithm type and key size of OpenPGP keys should not be modified to make this section fit. ๐Ÿ™…โ€โ™€๏ธ

OpenPGP supports various attributes that don't contribute to a key's security, such as an embedded image file. ๐Ÿ–ผ๏ธ It's recommended that these properties not be exported to OpenPGP public keyrings that are used to create OPENPGPKEY resource records. Some OpenPGP software (for example, GnuPG) supports a "minimal key export" that's well suited to use as OPENPGPKEY RDATA. See Appendix A. ๐ŸŽ

7. Security Considerations โœจ

Okay bestie, this part is serious, so let's get real ๐Ÿซถ DNSSEC is not a replacement for the "web of trust" or for checking fingerprints by hand ๐Ÿ” DANE for OpenPGP, the way this document describes it, is all about making it easier to grab someone's public key ๐Ÿ”‘ Without manually verifying the OpenPGP key you fetched through DANE, you should only use that key for encryption if the only other option is sending the message in plaintext ๐Ÿ˜ฌ That does block every passive attack that just captures and logs plaintext email content, but it does nothing against active attacks ๐Ÿ’€ A person who publishes an OPENPGPKEY record still expects senders to do their homework with extra, non-DNSSEC checks through other out-of-band methods before they send anything confidential or sensitive ๐Ÿ“ฌ

So, to say it plainly: the OPENPGPKEY record MUST NOT be used to send sensitive information without additional verification or confirmation that the OpenPGP key actually belongs to the target recipient ๐Ÿšซ

DNSSEC doesn't protect your queries from Pervasive Monitoring as defined in [RFC7258] ๐Ÿ‘€ Since most DNS queries are currently unencrypted, a lookup for a target's OPENPGPKEY record could reveal that a user of a monitored recursive DNS server is trying to send encrypted email to someone ๐Ÿ˜ญ MUAs and MTAs usually protect this info by using Transport Layer Security (TLS) encryption through STARTTLS ๐Ÿ” The DNS can help with privacy too, but the user has to pick a trusted DNS server that supports these privacy-enhancing features ๐ŸŒธ Recursive DNS servers can support DNS Query Name Minimalisation [RFC7816], which keeps the QNAME from leaking beyond the recursive DNS server and the nameservers of the actual zone being queried ๐Ÿงš Recursive DNS servers can also support TLS [RFC7858] so the path between the end user and the recursive DNS server is encrypted ๐Ÿฆ‹

Lots of different components could be in charge of encrypting an email to a recipient ๐Ÿ’Œ It could be the sender's MUA, a MUA plug-in, or the sender's MTA, and each one has its own vibe ๐ŸŽ€ A MUA can ask the user to make a decision before continuing, and it can either accept or refuse a message ๐Ÿ™‹โ€โ™€๏ธ The MTA must deliver the message as-is, or encrypt it before delivering ๐Ÿ“จ Each of these components should try to encrypt an unencrypted outgoing message whenever it's possible ๐Ÿ’–

In theory, two different local-parts could hash to the same value ๐Ÿคฏ This document assumes that a hash collision like that has a negligible chance of happening โœจ

Organizations that are required to be able to read everyone's encrypted email should publish the escrow key as the OPENPGPKEY record ๐Ÿ—๏ธ Mail servers at those organizations MAY optionally re-encrypt the message to the individual's OpenPGP key ๐ŸŒˆ

7.1. MTA Behavior

An MTA could be running in stand-alone mode, without access to the sender's OpenPGP public keyring, or it could be set up so it can access the user's OpenPGP public keyring ๐Ÿ—‚๏ธ Either way, the MTA MUST NOT modify the user's OpenPGP keyring ๐Ÿ™…โ€โ™€๏ธ

An MTA sending an email MUST NOT add the public key it got from an OPENPGPKEY resource record to a permanent public keyring for future use beyond the TTL ๐Ÿšซ๐Ÿ’œ

If the obtained public key is revoked, the MTA MUST NOT use that key for encryption, even if the result would be sending the message in plaintext ๐Ÿ’€

If a message is already encrypted, the MTA SHOULD NOT re-encrypt it, even if different encryption schemes or different encryption keys would be used ๐Ÿ”’

If the DNS request for an OPENPGPKEY record returned an Indeterminate or Bogus answer as specified in [RFC4035], the MTA MUST NOT send the message and queue the plaintext message for encrypted delivery at a later time ๐Ÿ˜ค If the problem keeps going, the email should be returned through the regular bounce methods ๐Ÿ“ฎ

If multiple non-revoked OPENPGPKEY resource records are found, the MTA SHOULD pick the most secure RR based on its local policy ๐Ÿ‘‘

7.2. MUA Behavior

If the public key for a recipient taken from the sender's locally stored public keyring differs from the recipient's OPENPGPKEY RR, the MUA SHOULD halt processing the message and check in with the user to sort out the conflict before going any further ๐Ÿ›‘

If the public key for a recipient taken from the sender's locally stored public keyring has properties that contradict the same key from an OPENPGPKEY RR, the MUA SHOULD NOT accept the message for delivery ๐Ÿ™…โ€โ™€๏ธ

If multiple non-revoked OPENPGPKEY resource records are found, the MUA SHOULD pick the most secure OpenPGP public key based on its local policy ๐Ÿ’…

The MUA MAY interact with the user to resolve any conflicts between locally stored keyrings and OPENPGPKEY RRdata ๐Ÿ™‹โ€โ™€๏ธ

A MUA that is encrypting a message SHOULD clearly show the user the difference between encrypting to a locally stored, previously user-verified public key and encrypting to a public key from an OPENPGPKEY resource record that the user never verified by hand ๐Ÿ‘€ This is a big deal, babe ๐Ÿ”ฅ

7.3. Response Size

To stop amplification attacks, an Authoritative DNS server MAY wish to prevent returning OPENPGPKEY records over UDP unless the source IP address has been confirmed with [RFC7873] ๐Ÿ›ก๏ธ Servers like that MUST NOT return REFUSED. Instead, they answer the query with an empty answer section and the truncation flag set (TC=1) ๐Ÿฆ‹

7.4. Email Address Information Leak

Hashing the local-part in this document is not a security feature, so don't get it twisted ๐Ÿ™ˆ Publishing OPENPGPKEY records creates a list of hashes of valid email addresses, which could make it easier to collect a list of valid email addresses for a particular domain ๐Ÿ“‹ It's better not to make email harvesting easier wherever possible ๐ŸŒธ

The domain name part of the email address isn't part of the hash, so hashes can be used across multiple zones deployed using DNAME [RFC6672] ๐Ÿงš That does make it slightly easier and cheaper to brute-force the SHA2-256 hashes into common and short local-parts, since single rainbow tables can be reused across domains ๐Ÿ˜ฉ Using NextSECure version 3 (NSEC3) can help counter this a bit ๐Ÿ› ๏ธ

DNS zones signed with DNSSEC that use NSEC for denial of existence are open to zone walking, which lets someone enumerate all the OPENPGPKEY hashes in a zone ๐Ÿšถโ€โ™€๏ธ Combine that with previously hashed common or short local-parts from rainbow tables, and someone can work out valid email addresses ๐Ÿ’€ DNSSEC-signed zones that use NSEC3 for denial of existence instead of NSEC are significantly harder to brute-force after a zone walk ๐Ÿ’ช

7.5. Storage of OPENPGPKEY Data

Users may have a local key store with OpenPGP public keys ๐Ÿ” An application that supports OPENPGPKEY DNS records MUST NOT modify the local key store without the user's explicit confirmation, because the app doesn't know the user's personal policy for adding, removing, or updating their key store ๐Ÿ™…โ€โ™€๏ธ An application MAY warn the user if an OPENPGPKEY record doesn't match the OpenPGP public key in the local key store โš ๏ธ

Applications that can't interact with users, like daemon processes, SHOULD store OpenPGP public keys obtained via OPENPGPKEY up to their DNS TTL value โณ That way they avoid repeated DNS lookups that third parties could monitor to figure out when an email is being sent to a particular user ๐Ÿ‘๏ธ

7.6. Security of OpenPGP versus DNSSEC

Anyone who gets a domain's DNSSEC private key through coercion, theft, or brute-force calculations can replace any OPENPGPKEY record in that zone and in all of the delegated child zones ๐Ÿ˜ฑ Any future messages encrypted with the malicious OpenPGP key could then be read ๐Ÿ’”

So an OpenPGP key obtained from a DNSSEC-validated OPENPGPKEY record can only be trusted as much as the DNS domain can be trusted ๐Ÿซ  It's no substitute for in-person OpenPGP key verification, or for extra OpenPGP verification through "web of trust" signatures on that OpenPGP key ๐Ÿค


8. IANA Considerations ๐Ÿฆ‹

8.1. OPENPGPKEY RRtype

This document uses a brand-new DNS RR type, OPENPGPKEY ๐ŸŽ‰ IANA allocated it the value 61 from the "Resource Record (RR) TYPEs" subregistry of the "Domain Name System (DNS) Parameters" registry ๐Ÿ’œ

The IANA template for OPENPGPKEY is listed in Appendix B ๐Ÿ“„ It was submitted to IANA for review on July 23, 2014, and approved on August 12, 2014 โœจ


9. References ๐Ÿ“š

9.1. Normative References

9.2. Informative References

okay so these are the "good to know" references ๐Ÿ“š๐ŸŽ€ they aren't required reading to implement this, but they're the receipts for everything the doc name-drops. bestie, the list is long, so grab a snack ๐Ÿ“


Appendix A. Generating OPENPGPKEY Records โœจ

okay this appendix is the hands-on bit ๐Ÿ’… the commonly available GnuPG software can make a minimum Transferable Public Key for the RRdata part of an OPENPGPKEY record:

gpg --export --export-options export-minimal,no-export-attributes \
    hugh@example.com | base64

heads up: the --armor or -a option of the gpg command should not be used, because it adds extra markers around the armored key ๐Ÿ™ˆ

when your DNS software reading or signing the zone file doesn't support the OPENPGPKEY RRtype yet, the Generic Record Syntax of [RFC3597] can be used to make the RDATA instead. you need to count the octets and dump the actual data in hexadecimal:

gpg --export --export-options export-minimal,no-export-attributes \
    hugh@example.com | wc -c
gpg --export --export-options export-minimal,no-export-attributes \
    hugh@example.com | hexdump -e \
       '"\t" /1 "%.2x"' -e '/32 "\n"'

then you can use those values to build a generic record (a line break has been added for formatting):

<SHA2-256-trunc(hugh)>._openpgpkey.example.com. IN TYPE61 \# \
    <numOctets> <keydata in hex>

and the openpgpkey command in the hash-slinger software can generate complete OPENPGPKEY records for you, which is honestly so convenient ๐Ÿงš

~> openpgpkey --output rfc hugh@example.com
c9[..]d6._openpgpkey.example.com. IN OPENPGPKEY mQCNAzIG[...]

~> openpgpkey --output generic hugh@example.com
c9[..]d6._openpgpkey.example.com. IN TYPE61 \# 2313 99008d03[...]

Appendix B. OPENPGPKEY IANA Template ๐ŸŽ€

this is a copy of the original registration template that went to IANA. the text (including the references) hasn't been updated, so it's a little time-capsule ๐Ÿ•ฐ๏ธ it's giving 2014 ๐Ÿ’€

  A. Submission Date: 23-07-2014

  B.1 Submission Type: [x] New RRTYPE [ ] Modification to RRTYPE
  B.2 Kind of RR: [x] Data RR [ ] Meta-RR

  C. Contact Information for submitter (will be publicly posted):
     Name: Paul Wouters         Email Address: pwouters@redhat.com
     International telephone number: +1-647-896-3464
     Other contact handles: paul@nohats.ca

  D. Motivation for the new RRTYPE application.

     Publishing RFC-4880 OpenPGP formatted keys in DNS with DNSSEC
     protection to faciliate automatic encryption of emails in
     defense against pervasive monitoring.

  E. Description of the proposed RR type.

  http://tools.ietf.org/html/draft-ietf-dane-openpgpkey-00#section-2

  F. What existing RRTYPE or RRTYPEs come closest to filling that need
     and why are they unsatisfactory?

     The CERT RRtype is the closest match. It unfortunately depends on
     subtyping, and its use in general is no longer recommended. It
     also has no human usable presentation format. Some usage types of
     CERT require external URI's which complicates the security model.
     This was discussed in the dane working group.

  G. What mnemonic is requested for the new RRTYPE (optional)?

     OPENPGPKEY

  H. Does the requested RRTYPE make use of any existing IANA registry
     or require the creation of a new IANA subregistry in DNS
     Parameters? If so, please indicate which registry is to be used
     or created. If a new subregistry is needed, specify the
     allocation policy for it and its initial contents. Also include
     what the modification procedures will be.

     The RDATA part uses the key format specified in RFC-4880, which
     itself use
     https://www.iana.org/assignments/pgp-parameters/pgp-parameters.xhtm
     This RRcode just uses the formats specified in those registries for
     its RRdata part.

  I. Does the proposal require/expect any changes in DNS
     servers/resolvers that prevent the new type from being processed
     as an unknown RRTYPE (see [RFC3597])?

     No.

  J. Comments:

     Currently, three software implementations of
     draft-ietf-dane-openpgpkey are using a private number.

Acknowledgments ๐Ÿซถ

this doc is built on [RFC4255] and [SMIME], whose authors are Paul Hoffman, Jakob Schlyter, and W. Griffin. Olafur Gudmundsson gave feedback and suggested a bunch of improvements ๐Ÿ™Œ Willem Toorop contributed the gpg and hexdump command options. Daniel Kahn Gillmor wrote the text describing the OpenPGP packet formats and filtering options ๐Ÿ”ฅ Edwin Taylor helped with language improvements across the different versions of this document ๐Ÿ’œ and the text about email mappings was taken from [MAILBOX], whose author is John Levine. the real MVPs ๐Ÿ‘‘

Author's Address ๐Ÿ’–

Paul Wouters

Red Hat

Email: pwouters@redhat.com

๐Ÿ“ฆ where this page comes from