idnits 2.17.1 draft-ietf-dane-smtp-with-dane-01.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- ** The document seems to lack an IANA Considerations section. (See Section 2.2 of https://www.ietf.org/id-info/checklist for how to handle the case when there are no actions for IANA.) Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year == Using lowercase 'not' together with uppercase 'MUST', 'SHALL', 'SHOULD', or 'RECOMMENDED' is not an accepted usage according to RFC 2119. Please use uppercase 'NOT' together with RFC 2119 keywords (if that is what you mean). Found 'SHOULD not' in this paragraph: When at least one usable "secure" TLSA record is found, the SMTP client SHOULD use TLSA records to authenticate the next-hop host, mail SHOULD not be delivered via this next-hop host if authentication fails, otherwise the SMTP client is vulnerable to TLS man in the middle attacks. -- The document date (October 21, 2013) is 3837 days in the past. Is this intentional? Checking references for intended status: Experimental ---------------------------------------------------------------------------- == Unused Reference: 'RFC3546' is defined on line 791, but no explicit reference was found in the text == Unused Reference: 'RFC4346' is defined on line 807, but no explicit reference was found in the text == Unused Reference: 'RFC5280' is defined on line 813, but no explicit reference was found in the text == Outdated reference: A later version (-16) exists of draft-ietf-dane-ops-00 ** Obsolete normative reference: RFC 2246 (Obsoleted by RFC 4346) ** Obsolete normative reference: RFC 3546 (Obsoleted by RFC 4366) ** Obsolete normative reference: RFC 4346 (Obsoleted by RFC 5246) ** Obsolete normative reference: RFC 5246 (Obsoleted by RFC 8446) ** Obsolete normative reference: RFC 6125 (Obsoleted by RFC 9525) Summary: 6 errors (**), 0 flaws (~~), 6 warnings (==), 1 comment (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 DANE V. Dukhovni 3 Internet-Draft Unaffiliated 4 Intended status: Experimental W.H. Hardaker 5 Expires: April 24, 2014 Parsons 6 October 21, 2013 8 SMTP security via opportunistic DANE TLS 9 draft-ietf-dane-smtp-with-dane-01 11 Abstract 13 This memo describes a protocol for opportunistic TLS security based 14 on the DANE TLSA DNS record. The protocol is downgrade resistant 15 when the SMTP client supports DANE TLSA and the server domain 16 publishes TLSA records for its MX hosts. This enables an incremental 17 transition of the Internet email backbone (MTA to MTA SMTP traffic) 18 to TLS encrypted and authenticated delivery. 20 Status of This Memo 22 This Internet-Draft is submitted in full conformance with the 23 provisions of BCP 78 and BCP 79. 25 Internet-Drafts are working documents of the Internet Engineering 26 Task Force (IETF). Note that other groups may also distribute 27 working documents as Internet-Drafts. The list of current Internet- 28 Drafts is at http://datatracker.ietf.org/drafts/current/. 30 Internet-Drafts are draft documents valid for a maximum of six months 31 and may be updated, replaced, or obsoleted by other documents at any 32 time. It is inappropriate to use Internet-Drafts as reference 33 material or to cite them other than as "work in progress." 35 This Internet-Draft will expire on April 24, 2014. 37 Copyright Notice 39 Copyright (c) 2013 IETF Trust and the persons identified as the 40 document authors. All rights reserved. 42 This document is subject to BCP 78 and the IETF Trust's Legal 43 Provisions Relating to IETF Documents 44 (http://trustee.ietf.org/license-info) in effect on the date of 45 publication of this document. Please review these documents 46 carefully, as they describe your rights and restrictions with respect 47 to this document. Code Components extracted from this document must 48 include Simplified BSD License text as described in Section 4.e of 49 the Trust Legal Provisions and are provided without warranty as 50 described in the Simplified BSD License. 52 Table of Contents 54 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 55 1.1. Background . . . . . . . . . . . . . . . . . . . . . . . 2 56 1.2. SMTP Channel Security . . . . . . . . . . . . . . . . . . 3 57 1.3. Terminology . . . . . . . . . . . . . . . . . . . . . . . 5 58 2. Hardening Opportunistic TLS . . . . . . . . . . . . . . . . . 5 59 2.1. TLS discovery . . . . . . . . . . . . . . . . . . . . . . 5 60 2.1.1. Non-MX destinations . . . . . . . . . . . . . . . . . 6 61 2.1.2. MX resolution . . . . . . . . . . . . . . . . . . . . 7 62 2.1.3. TLSA record lookup . . . . . . . . . . . . . . . . . 9 63 2.2. DANE authentication . . . . . . . . . . . . . . . . . . . 10 64 2.2.1. TLSA certificate usages . . . . . . . . . . . . . . . 11 65 2.2.2. Certificate matching . . . . . . . . . . . . . . . . 12 66 3. Opportunistic TLS for Submission . . . . . . . . . . . . . . 14 67 4. Mandatory TLS Security . . . . . . . . . . . . . . . . . . . 15 68 5. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 16 69 6. Security Considerations . . . . . . . . . . . . . . . . . . . 17 70 7. Normative References . . . . . . . . . . . . . . . . . . . . 17 71 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 19 73 1. Introduction 75 Lacking verified DNS and "Server Name Indication" (SNI), there has 76 historically been no scalable way for SMTP server operators to deploy 77 certificates with a client-trusted subject name. It's only with the 78 deployment of DNSSEC and DANE that authenticated TLS for SMTP to MX 79 becomes possible between parties that have not already established an 80 identity convention out-of-band. 82 1.1. Background 84 The Domain Name System Security Extensions (DNSSEC) add data origin 85 authentication and data integrity to the Domain Name System. DNSSEC 86 is defined in [RFC4033], [RFC4034] and [RFC4035]. 88 As described in the introduction of [RFC6698], TLS authentication via 89 the existing public Certificate Authority (CA) Public Key 90 Infrastructure (PKI) suffers from an over-abundance of trusted 91 certificate authorities capable of issuing certificates for any 92 domain of their choice. DNS-Based Authentication of Named Entities 93 (DANE) leverages the DNSSEC infrastructure to publish trusted keys 94 and certificates for use with TLS via a new TLSA record type. With 95 DANE, the public CA PKI can be augmented or replaced by DNSSEC 96 validated TLSA records. 98 The Transport Layer Security (TLS [RFC5246]) protocol enables secure 99 TCP communication. In the context of this memo, channel security is 100 assumed to be provided by TLS. Used without authentication, TLS 101 protects only against eavesdropping. With authentication, TLS also 102 protects against man-in-the-middle (MITM) attacks. 104 1.2. SMTP Channel Security 106 The Simple Mail Transport Protocol (SMTP) ([RFC5321]) is multi-hop 107 store & forward, while TLS security is hop-by-hop. The number of 108 hops from the sender's Mail User Agent to the recipient mailbox is 109 rarely less than 2 and is often higher. Some hops may be TLS 110 protected, some may not. The same SMTP TCP endpoint can serve both 111 TLS and non-TLS clients, with TLS negotiated via the SMTP STARTTLS 112 command ([RFC3207]). DNS MX records abstract the next-hop transport 113 end-point. SMTP addresses are not transport addresses and are 114 security agnostic. Unlike HTTP, there is no URI scheme for email 115 addresses to designate whether the SMTP server should be contacted 116 with or without security. 118 A Mail Transport Agent (MTA) may need to forward a message to a 119 particular email recipient . To deliver the 120 message, the MTA needs to retrieve the MX hosts of example.com from 121 DNS, and then deliver the message to one of them. Absent DNSSEC, the 122 MX lookup is vulnerable to man-in-the-middle and cache poisoning 123 attacks. An active attacker can forge DNS replies with fake MX 124 records, and can direct traffic to a server of his choice. 125 Therefore, secure verification of MX host certificates is not 126 possible without DNSSEC. A man in the middle can also suppress the 127 MX host's STARTTLS EHLO response, convincing the client that 128 communication over TLS is unavailable. 130 One might try to harden STARTTLS with SMTP against DNS attacks by 131 requiring each MX host to posess an X.509 certificate for the 132 recipient domain that is obtained from the message envelope and is 133 not subject to DNS reply forgery. Unfortunately, this is 134 impractical, as email for many domains is handled by third parties, 135 which are not in a position to obtain certificates for all the 136 domains they serve. Deployment of SNI (see [RFC6066] Section 3.1) is 137 no panacea, since SNI key management is operationally challenging 138 except when the email service provider is also the domain's registrar 139 and its certificate issuer; this is rarely the case for email. 141 Since the recipient domain name cannot be used as the SMTP server 142 authentication identity, and neither can the MX hostname without 143 DNSSEC, large scale deployment of authenticated TLS for SMTP requires 144 secure DNS. At this time, DNSSEC is not yet widely deployed and MTA 145 to MTA traffic between Internet connected organizations rarely uses 146 TLS at all, or simply uses TLS opportunistically without 147 authentication and protects against only passive eavesdropping 148 attacks. 150 The exceptions are cases in which the sending MTA is statically 151 configured to use TLS for mail sent to specific selected peer domains 152 and is configured with appropriate subject names (or content digests) 153 to expect in the presented MX host certificates of those domains. 154 Such statically configured SMTP secure channels are used rarely, 155 generally between domains that make bilateral arrangements with their 156 business partners. Internet email, on the other hand, requires 157 contacting many new domains for which security configurations can not 158 be established in advance. 160 Note, the above does not apply to mail submission [RFC6409], where a 161 mail user agent is pre-configured to send all email to a fixed Mail 162 Submission Agent (MSA). Submission servers usually offer TLS and the 163 Mail User Agent (MUA) can be statically configured to require TLS 164 with its chosen MSA. The situation changes when submission servers 165 are configured dynamically via SRV records (see [RFC6186] Section 6). 166 Applications to submission via SRV records will be discussed later in 167 this memo. 169 With little opportunity to use TLS authentication, MX hosts that 170 support STARTTLS often use self-signed or private CA issued X.509 171 certificates. Sending systems are rarely configured with a 172 comprehensive list of trusted CAs and do not check CRLs or implement 173 OCSP. In essence, they don't and can't rely on the existing public 174 CA PKI. This is not a result of complacency on the part SMTP server 175 administrators and MTA developers. Nor is it just a consequence of 176 the relative maturity of the SMTP infrastructure at the time that TLS 177 was introduced. Rather, the abstraction of the SMTP transport 178 endpoint via DNS MX records, often across organization boundaries, 179 limits the use of public CA PKI with SMTP to a small set of sender- 180 configured peer domains. 182 This does not mean, however, that the Internet email backbone cannot 183 benefit from TLS. The fact that transport security is not explicitly 184 specified in either the recipient address or the MX record means that 185 new protocols can furnish out-of-band information to SMTP, making it 186 possible to simultaneously discover both which peer domains support 187 secure delivery via TLS and how to verify the authenticity of the 188 associated MX hosts. The first such mechanism that can work an 189 Internet scale is DANE TLSA, but use of DANE TLSA with MTA to MTA 190 SMTP must be cognizant of the lack of any realistic role for the 191 existing public CA PKI. 193 1.3. Terminology 195 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 196 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 197 document are to be interpreted as described in [RFC2119]. 199 2. Hardening Opportunistic TLS 201 This memo describes opportunistic SMTP over TLS security, where 202 traffic from DANE TLSA aware SMTP clients to domains that implement 203 DANE TLSA records in accordance with this memo is secure. Traffic to 204 other domains continues to be sent in the same manner as before 205 (either manually configured for security or unauthenticated and often 206 unencrypted). It is hoped that, over time, more domains will 207 implement DNSSEC and publish DANE TLSA records for their MX hosts. 208 This will enable an incremental transition of the email backbone to 209 authenticated TLS delivery. 211 Since email addresses and MX hostnames (or submission SRV records) 212 neither signal nor deny support for TLS by the receiving domain, it 213 is possible to use DANE TLSA records to securely signal TLS support 214 and simultaneously to provide the means by which SMTP clients can 215 successfully authenticate legitimate SMTP servers. 217 2.1. TLS discovery 219 As noted previously (Section 1.2), opportunistic TLS with SMTP 220 servers that advertise TLS support via STARTTLS is subject to a man 221 in the middle downgrade attack. Some SMTP servers erroneously 222 advertise STARTTLS in default configurations that are not, in fact, 223 TLS capable, and clients need to be prepared to retry plaintext 224 delivery after STARTTLS fails. This memo specifies a downgrade 225 resistant mechanism that allows a server to advertise TLS support 226 based on DANE TLSA records. DNSSEC validated TLSA records are 227 unlikely to be accidentally published for servers that do not in fact 228 support TLS, and thus clients can safely interpret their presence as 229 a commitment by the server operator to implement STARTTLS. 231 SMTP is a store & forward protocol. An MTA that is not the final 232 destination for a message recipient forwards the message one hop 233 closer to the recipient's mailbox. To do so, it must determine the 234 appropriate next-hop destination, and locate one or more associated 235 SMTP servers. When DNSSEC validated TLSA records are available for a 236 given next-hop SMTP server, the TLS connection to that server will be 237 downgrade resistant. If the records in question are "usable" 238 ([RFC6698], Section 4.1) to authenticate the server, the connection 239 will also be authenticated and thus immune to eavesdropping or 240 tampering (unless DNSSEC itself is compromised). 242 Typically, the next-hop destination will be the domain part of the 243 recipient address, which is then subject to MX resolution. The next- 244 hop destination may also be configured by the MTA administrator to be 245 a next-hop destination host (explicitly exempt from MX resolution), 246 or a next-hop destination domain (subject to MX resolution) which 247 takes the place of the domain part of the recipient address. 249 The protocol in this memo is "opportunistic". Absent "secure" 250 (DNSSEC validated) TLSA records, mail delivery should generally fall 251 back to pre-DANE opportunistic TLS. The SMTP client may be 252 configured to require DANE verified delivery for some or all 253 destinations, in which case absent "secure" TLSA records delivery 254 will be deferred. 256 Below we explain how to determine for a given next-hop destination 257 the associated SMTP servers, the TLSA base domain and TLSA records. 259 2.1.1. Non-MX destinations 261 As mentioned above, the next-hop destination domain may in some cases 262 be exempt from MX lookups. In addition, MX lookups for the next-hop 263 domain may yield no results. In either case, the destination server 264 for such a domain is determined by looking up the corresponding A or 265 AAAA records. 267 When "bogus" records are encountered either during CNAME expansion, 268 or when retrieving the associated TLSA RRset, the SMTP client MUST 269 proceed as if the next-hop domain were unreachable. Delivery should 270 either be deferred or may be attempted via any fallback next-hop 271 (which may also employ opportunistic DANE TLS) configured by the SMTP 272 client administrator. Proceeding with the original next-hop despite 273 "bogus" DNS responses would destroy protection against downgrade 274 attacks. 276 Following [RFC5321] Section 5.1, if the A or AAAA lookup of the 277 initial name yields a CNAME, we replace it with the resulting name as 278 if it were the initial name and perform a lookup again using the new 279 name. This replacement is performed recursively, although MTAs 280 typically support only limited recursion in CNAME expansion. We 281 consider the following cases: 283 Non-CNAME: The next-hop destination domain is not a CNAME alias. 284 The lookup key for the DNSSEC validated TLSA records is obtained 285 by prepending service labels ("_._tcp") to the 286 initial next-hop destination domain. If associated "secure" TLSA 287 records are found (see Section 2.1.3) the TLSA base domain is the 288 next-hop domain. If no secure TLSA records are found, 289 opportunistic DANE TLS is not applicable and mail delivery 290 proceeds with pre-DANE opportunistic TLS. 292 Insecure CNAME: The next-hop destination domain is a CNAME alias, 293 but at least one of the CNAME RRs leading to the ultimate target 294 of this alias (during recursive CNAME expansion) is "insecure". 295 We treat this case just like the non-CNAME case above. 297 Secure CNAME, no TLSA: The next-hop destination domain is a CNAME 298 alias, and all the CNAME RRs leading to the ultimate target of 299 this alias (during recursive CNAME expansion) are "secure" (DNSSEC 300 validated), but no "secure" TLSA RRs are found after prefixing the 301 service labels to the CNAME-expanded next-hop domain. This case 302 is also treated just like the non-CNAME case. 304 Secure CNAME, TLSA: The next-hop destination domain is a CNAME 305 alias, all the CNAME RRs leading to the ultimate target of this 306 alias (during recursive CNAME expansion) are "secure", and in 307 addition "secure" TLSA RRs are found after prefixing the service 308 labels to the CNAME-expanded next-hop domain. In this case the 309 CNAME-expanded next-hop domain is taken as the TLSA base domain. 310 The original next-hop domain is (see Section 2.2.2) used only as 311 an alternative name in certificate peername verification if 312 applicable. 314 In summary, if it is possible to securely obtain the full, CNAME- 315 expanded, DNSSEC-validated address records for the non-MX next-hop 316 domain then that name is the preferred TLSA base domain. If that is 317 not possible, then the original next-hop domain is used as the TLSA 318 base domain. When no "secure" TLSA records are found at either the 319 CNAME expanded or original next-hop domain, then opportunistic DANE 320 TLS does not apply for mail delivery to the non-MX destination in 321 question. 323 2.1.2. MX resolution 325 In this section we consider next-hop domains that are subject to MX 326 resolution and have MX records. When DANE TLS is applicable, the 327 TLSA base domain will be associated with the MX host selected for 328 message delivery. Therefore, the MX host names must be determined 329 securely by performing a DNSSEC validated MX lookup to obtain the 330 list of associated MX hosts. If the MX RRset is "insecure", DANE 331 TLSA does not apply and mail delivery proceeds with pre-DANE 332 opportunistic TLS (subject to its various MITM attacks and unecrypted 333 transmission when STARTTLS is not supported by the destination). 335 When "bogus" DNSSEC records are encountered during CNAME expansion of 336 the next-hop domain or when processing the actual MX RRset, delivery 337 MUST either be deferred, or MAY be attempted via any fallback next- 338 hop (which may also employ opportunistic DANE TLS) configured by the 339 SMTP client administrator. Proceeding with the original next-hop 340 despite "bogus" DNS responses would destroy protection against 341 downgrade attacks. When "bogus" DNSSEC records are encountered with 342 CNAME expansion or TLSA RRset lookup for a particular MX host, 343 delivery MUST proceed as if MX host in question were unreachable. 345 MX records MUST be sorted by preference; an MX host with a better 346 preference and no TLSA records MUST NOT be preempted by a host with a 347 worse MX preference but with TLSA records. In other words, avoiding 348 delivery loops by following MX preferences must take place even if it 349 means insecure delivery. 351 In accordance with Section 5.1 of [RFC5321], if the MX lookup of the 352 initial name yields a CNAME, we replace the initial name with the 353 resulting name and perform a new lookup with the new name. MTAs 354 typically support recursion in CNAME expansion, so this replacement 355 is performed repeatedly until the ultimate non-CNAME domain is found 356 (or the limit on the number of CNAMEs to examine is reached). If at 357 any stage of CNAME expansion the DNS result is "bogus", MX resolution 358 fails with a temporary error. In that case, mail delivery MUST 359 either be deferred, or attempted via any alternative delivery channel 360 configured by the MTA administrator. We consider the following 361 cases: 363 Non-CNAME: The next-hop destination domain is not a CNAME alias, 364 that is, it resolves directly to a set of DNSSEC validated 365 ("secure") MX hosts. With each MX host, if MX host CNAME 366 expansion is supported by the MTA, and the full CNAME expansion of 367 the MX host name is "secure", then the CNAME expanded MX host name 368 is the TLSA base domain provided secure TLSA records are found 369 there after prefixing service labels ("_._tcp"). 370 Otherwise, the initial MX host name is the TLSA base domain 371 provided secure TLSA records are found there after prefixing 372 service labels. With the MX hostname (or its CNAME expansion) as 373 the TLSA base domain, the original next-hop domain SHOULD be used 374 only in certificate name checks. If no "secure" TLSA RRs are 375 found, and no "bogus" records encountered, DANE TLSA is not 376 applicable with the MX host in question and delivery proceeds as 377 with pre-DANE opportunistic TLS. 379 CNAME: The next-hop destination domain is a CNAME alias, and 380 resolves via a chain of "secure" CNAME records to a final domain 381 with "secure" MX records. The TLSA base domain for each MX host 382 in this case is the same as in the "Non-CNAME" case above, but now 383 both the initial domain and its CNAME-expansion are candidate 384 names in certificate name checks. If the CNAME chain contains 385 "insecure" elements, DANE TLSA does not apply to the next-hop 386 domain, and delivery proceeds via pre-DANE opportunistic TLS. 388 Note: CNAMEs are not legal in the exchange field of MX records, thus 389 MTAs are not obligated to perform MX exchange CNAME expansion. If an 390 MTA does not perform CNAME expansion, there is potential risk, that 391 the MTA may fail to notice that it is one of the MX hosts for the 392 destination and that it must skip MX records with equal or worse 393 (numerically higher precedence). If an MTA does allow CNAMEs to be 394 used in MX records, it SHOULD process them recursively as described 395 above to determine the most appropriate TLSA RRset base domain. 397 2.1.3. TLSA record lookup 399 Each TLSA base domain obtained above (for a non-MX destination, or 400 for a particular MX host of an MX destination), when prefixed with 401 appropriate service labels leads to associated "secure" TLSA RRs 402 (possibly via a chain of "secure" CNAME RRs). If, for example, the 403 base domain is "mail.example.com", the TLSA RRset is obtained via a 404 DNSSEC query of the form: 406 _25._tcp.mail.example.com. IN TLSA ? 408 Typically, the destination TCP port is 25, but this may be different 409 with custom routes specified by the MTA administrator or when an MUA 410 connects to a submission server on port 587. The SMTP client MUST 411 use the appropriate "_" prefix in place of "_25" when 412 the port number is not equal to 25. The query response may be a 413 CNAME (or a DNAME + CNAME combination), or the TLSA RRset. If the 414 record is a CNAME or DNAME, the SMTP client restarts the TLSA query 415 at the target domain, following CNAMEs as appropriate. 417 CNAMEs encountered during TLSA record lookups can be used to share a 418 single TLSA RRset specifying a common certificate authority or a 419 common leaf certificate for multiple TLS services. Such CNAME 420 expansion does not change the SMTP client's notion of the TLSA base 421 domain, thus when _25._tcp.mail.example.com is a CNAME the base 422 domain remains mail.example.com and is still used in peer certificate 423 name checks. For example: 425 example.com. IN MX 0 mail.example.com. 426 example.com. IN MX 0 mail2.example.com. 427 _25._tcp.mail.example.com. IN CNAME 2.1.1._dane.example.com. 428 _25._tcp.mail2.example.com. IN CNAME 2.1.1._dane.example.com. 429 2.1.1._dane.example.com. IN TLSA 2 1 1 e3b0c44298fc1c14 430 9afbf4c8996fb924 431 27ae41e4649b934c 432 a495991b7852b855 434 Here, mail.example.com and mail2.example.com have certificates issued 435 under a common trust-anchor, but each MX host's TLSA base domain 436 remains its hostname and MUST match the subject name (or subject 437 alternative name) in its certificate. 439 If, after possible CNAME indirection, at least one "secure" TLSA 440 record is found (even if not usable because it is unsupported by the 441 implementation or administratively disabled) the next-hop host has 442 committed to TLS support. The SMTP client SHOULD NOT deliver mail 443 via such a next-hop host unless a TLS session is negotiated via 444 STARTTLS. This avoids man in the middle STARTTLS downgrade attacks. 446 As noted previously (Section 2.1.1, Section 2.1.2), when no TLSA 447 records are found at a CNAME-expanded name (due to an insecure 448 response or a lack of TLSA records verified by DNSSEC's proof-of-non- 449 existence), the unexpanded name MUST be tried instead. This supports 450 clients of hosting providers where the provider's zone is not DNSSEC 451 validated, but the client has shared appropriate key material with 452 the hosting provider to enable TLS via SNI. 454 SMTP clients may deploy opportunistic DANE TLS incrementally by 455 enabling it only for selected sites, or may occasionally need to 456 disable opportunistic DANE TLS for peers that fail to interoperate 457 due to misconfiguration or software defects on either end. Unless 458 local policy specifies that opportunistic DANE TLS is not to be used 459 for a particular destination, client MUST NOT deliver mail via a 460 server whose certificate chain fails to match at least one TLSA 461 record when usable TLSA records are available. 463 SMTP clients employing opportunistic DANE TLS and TLSA record 464 publishers for SMTP servers need to follow the guidance outlined in 465 [I-D.ietf-dane-ops]'s "Certificate Name Check Conventions", "Service 466 Provider and TLSA Publisher Synchronization" and "TLSA Base Domain 467 and CNAMEs" sections. 469 2.2. DANE authentication 470 2.2.1. TLSA certificate usages 472 TLSA Publishers should follow the TLSA publication size guidance 473 found in [I-D.ietf-dane-ops] about "DANE DNS Record Size Guidelines". 475 2.2.1.1. Certificate usage 3 477 Since opportunistic DANE TLS will be used by non-interactive MTAs, 478 with no user to "press OK" when authentication fails, reliability of 479 peer authentication is paramount. TLSA records published for SMTP 480 servers SHOULD be "3 1 1" records to support opportunistic SMTP over 481 TLS with DANE. This record specifies the SHA-256 digest of the 482 server's public key. Since all DANE implementations are required to 483 support SHA-256, this record works for all clients and need not 484 change across certificate renewals with the same key. 486 Authentication via certificate usage "3" TLSA records involves simply 487 checking that the server's leaf certificate matches the TLSA record. 488 Other than extracting the relevant certificate elements for 489 comparison, no other use is made of the certificate content. 490 Authentication via certificate usage "3" TLSA records involves no 491 certificate authority signature checks. It also involves no server 492 name checks, and thus does not impose any new requirements on the 493 names contained in the server certificate (SNI is not required when 494 the TLSA record matches server's default certificate). 496 Two TLSA records will need to be published before updating a server's 497 public key, one matching the currently deployed key and the other 498 matching the new key scheduled to replace it. Once sufficient time 499 has elapsed for all DNS caches to time out the previous TLSA RRset, 500 which contains only the old key, the server may be reconfigured to 501 use the new private key and associated public key certificate. The 502 amount of time a server should wait before using a new key that is 503 referenced by new TLSA records should be at least twice the TTL of 504 the previously published TLSA records. Once the server is using a 505 new key, the obsolete TLSA RR can be removed from DNS, leaving only 506 the RR that matches the new key. 508 2.2.1.2. Certificate usage 2 510 Some domains may prefer to reduce the operational complexity of 511 publishing unique TLSA RRs for each TLS service. If the domain 512 employs a common issuing certificate authority to create certificates 513 for multiple TLS services, it may be simpler to publish the issuing 514 authority's public key as a trust-anchor for the certificate chains 515 of all relevant services. The TLSA RRs for each service issued by 516 the same TA may then be CNAMEs to a common TLSA RRset that matches 517 the TA. In this case, the certificate chain presented in the TLS 518 handshake of each service SHOULD include the TA certificate, as SMTP 519 clients cannot generally be expected to have domain-issued trust- 520 anchor certificates in their trusted certificate store. TLSA 521 Publishers should publish either "2 1 1" or "2 0 1" TLSA parameters, 522 which specify the SHA-256 digest of the trust-anchor public key or 523 certificate respectively. As with leaf certificate rollover 524 discussed in Section 2.2.1.1, two such TLSA RRs need to be published 525 to facilitate TA certificate rollover. 527 The usability of "2 1 1" or "2 0 1" TLSA RRs with SMTP is not 528 assured. If server operators employing these RRs universally ensure 529 that the corresponding TA certificate is included in the SMTP 530 server's TLS handshake certificate chain, clients can safely enable 531 support for these RRs. If sufficiently many server administrators 532 negligently omit the TA certificate from the server's TLS certificate 533 chain, SMTP clients will be hesitant to support usage "2" TLSA RRs, 534 since mail delivery will not work to many destination domains if they 535 do. Server operators are encouraged to implement these RRs, if they 536 are operationally a better fit for their organization, provided they 537 do so with care. It is critical to not forget to include trust- 538 anchor certificates in server trust chains. SMTP client 539 implementations SHOULD support these TLSA RRs, unless, despite the 540 above warning, a non-trivial fraction of server operators fail to 541 publish certificate chains that include the required TA certificate. 543 2.2.1.3. Certificate usages 0 and 1 545 SMTP servers SHOULD NOT publish TLSA RRs with certificate usage "0" 546 or "1". SMTP clients cannot be expected to be configured with a 547 suitably complete set of trusted public CAs. Even with a full set of 548 public CAs, SMTP clients cannot (without relying on DNSSEC for secure 549 MX records) perform [RFC6125] server identity verification. 551 SMTP client treatment of TLSA RRs with certificate usages "0" or "1" 552 is undefined. For example, clients MAY (will likely) treat such TLSA 553 records as unusable. 555 2.2.2. Certificate matching 557 When at least one usable "secure" TLSA record is found, the SMTP 558 client SHOULD use TLSA records to authenticate the next-hop host, 559 mail SHOULD not be delivered via this next-hop host if authentication 560 fails, otherwise the SMTP client is vulnerable to TLS man in the 561 middle attacks. 563 To match a server via a TLSA record with certificate usage "2", the 564 client MUST perform name checks to ensure that it has reached the 565 correct server. In all cases the SMTP client MUST accept the TLSA 566 base domain as a valid DNS name in the server certificate. 568 MX: If the TLSA base domain was obtained indirectly via an MX lookup 569 (it is the name of an MX exchange that may be securely CNAME 570 expanded), then the initial query name used in the MX lookup 571 SHOULD be accepted in the peer certificate. The CNAME-expanded 572 initial query name SHOULD also be accepted if different from the 573 initial query name. 575 Non-MX: If no MX records were found and the TLSA base domain is the 576 CNAME-expanded initial query name, then the initial query name 577 SHOULD also be accepted. 579 Accepting certificates with the next-hop domain in addition to the 580 next-hop MX host allows a domain with multiple MX hosts to field a 581 single certificate bearing the email domain name across all the MX 582 hosts, this is also compatible with pre-DANE SMTP clients that are 583 configured to look for the email domain name in server certificates. 585 The SMTP client MUST NOT perform certificate usage name checks with 586 certificate usage "3", since with usage "3" the server is 587 authenticated directly by matching the TLSA RRset to its certificate 588 or public key without resort to any issuing authority. The 589 certificate content is ignored except in so far as it is used to 590 match the certificate or public key (ASN.1 object or its digest) with 591 the TLSA RRset. 593 To ensure that the server sends the right certificate chain, the SMTP 594 client MUST send the TLS SNI extension containing the TLSA base 595 domain. Since DANE-aware clients are obligated to send SNI 596 information, which requires at least TLS 1.0, SMTP servers for which 597 DANE TLSA records are published MUST support TLS 1.0 or later with 598 any client authorized to use the service. 600 Each SMTP server MUST present a certificate chain (see [RFC2246] 601 Section 7.4.2) that matches at least one of the TLSA records. The 602 server MAY rely on SNI to determine which certificate chain to 603 present to the client. Clients that don't send SNI information may 604 not see the expected certificate chain. 606 If the server's TLSA RRset includes records with a matching type 607 indicating a digest record (i.e., a value other than "0"), the 608 SHA-256 digest of any object SHOULD be provided along with any other 609 digest published, since clients may support only SHA-256. Unless 610 SHA-256 proves vulnerable to a "second preimage" attack, it should be 611 the only digest algorithm used in TLSA records. 613 If the server's TLSA records match the server's default certificate 614 chain, the server need not support SNI. The server need not include 615 the extension in its TLS HELLO, simply returning a matching 616 certificate chain is sufficient. Servers MUST NOT enforce the use of 617 SNI by clients, if the client sends no SNI extension, or sends an SNI 618 extension for an unsupported domain the server MUST simply use its 619 default certificate chain. The client may be using unauthenticated 620 opportunistic TLS and may not expect any particular certificate from 621 the server. 623 The client may even offer to use anonymous TLS ciphersuites and 624 servers SHOULD support these. No security is gained by sending a 625 certificate the client is willing to ignore. Indeed support for 626 anonymous ciphersuites in the server makes audit trails more useful 627 when the chosen ciphersuite is logged, as this will in many cases 628 record which clients did not care to authenticate the server. (The 629 Postfix SMTP server supports anonymous TLS ciphersuites by default, 630 and the Postfix SMTP client offers these at its highest preference 631 when server authentication is not applicable). 633 With opportunistic DANE TLS, both the TLS support implied by the 634 presence of DANE TLSA records and the verification parameters 635 necessary to authenticate the TLS peer are obtained together, 636 therefore authentication via this protocol is expected to be less 637 prone to connection failure caused by incompatible configuration of 638 the client and server. 640 3. Opportunistic TLS for Submission 642 Prior to [RFC6409], the SMTP submission protocol was a poster-child 643 for PKIX TLS. The MUA typically connects to one or more submission 644 servers explicitly configured by the user. There is no indirection 645 via insecure MX records, and unlike web browsers, there is no need to 646 authenticate a large set of TLS servers. Once TLS is enabled for the 647 desired submission server or servers, provided the server certificate 648 is correctly maintained, the MUA is able to reliably use TLS to 649 authenticate the submission server. 651 [RFC6186] aims to simplify the configuration of the MUA submission 652 service by dynamically deriving the submission service from the 653 user's email address. This is done via SRV records, but at the cost 654 of introducing the same TLS security problems faced by MTA to MTA 655 SMTP. Prompting the user when the SRV record domain is different 656 from the email domain is not a robust solution. 658 The protocol defined in this memo can also be used to secure 659 submission service discovery. If the email domain is DNSSEC signed, 660 the SRV records are "secure" and the SRV host publishes secure TLSA 661 records for submission, then the MUA can safely auto-configure to 662 authenticate the submission server via DANE. When DANE TLSA records 663 are not available, the client SHOULD fall back to legacy behavior 664 (this may involve prompting the user to accept the resulting server 665 and perhaps "pin" its certificate). 667 Specifically, MUAs that dynamically determine the submission server 668 via SRV records SHOULD support DNSSEC and DANE TLSA records. They 669 SHOULD use TLSA records to authenticate the server. The processing 670 of usage 2 and 3 TLSA associations by an MUA is the same as by an MTA 671 with SRV records replaced by corresponding MX records. 673 Just as with MX service on port 25, SMTP submission servers SHOULD 674 NOT publish usage 0 or 1 TLSA associations, and MUAs that support 675 DANE TLSA are not expected to trust a full list of public CAs. 676 Server certificate subjectAltNames should include at least the server 677 name. When the server administrator is able to obtain a certificate 678 for the email domain, the server certificate should also include the 679 email domain name. MUAs that are not able to support DNSSEC may then 680 be able to authenticate the server domain. If it is practical to 681 field additional certificates for hosted domains, SNI may be used by 682 the server to select the appropriate domain's certificate. 684 4. Mandatory TLS Security 686 An MTA implementing this protocol may require a stronger security 687 assurance when sending email to selected destinations to which the 688 sending organization sends sensitive email and may have regulatory 689 obligations to protect its content. This protocol is not in conflict 690 with such a requirement, and in fact it can often simplify 691 authenticated delivery to such destinations. 693 Specifically, with domains that publish DANE TLSA records for their 694 MX hosts a sending MTA can be configured to use the receiving 695 domains's DANE TLSA records to authenticate the corresponding MX 696 hosts, thereby obviating the complex manual provisioning process. In 697 anticipation of, or in response to, a failure to obtain the expected 698 TLSA records, the sending system's administrator may choose from a 699 selection of fallback options, if supported by the sending MTA: 701 o Defer mail if no usable TLSA records are found. This is useful 702 when the destination is known to publish TLSA records, and lack of 703 TLSA records is most likely a transient misconfiguration. 705 o Authenticate the peer via a manually configured certificate 706 digest. This may be obtained, for example, after a problem is 707 detected and confirmed to be valid by some out-of-band mechanism. 709 o Authenticate the peer via the existing public CA PKI, if the peer 710 server has usable CA issued certificates. In many cases the 711 sending MTA will need custom certificate name matching rules to 712 match the destination's gateways. And the sending server must 713 explicitly configure policy for the destination to always require 714 TLS to prevent MITM attacks. 716 o Send via unauthenticated mandatory TLS. This is useful if the 717 requirement is merely to always encrypt transmissions to protect 718 against only eavesdropping, and the possibility of MITM attacks is 719 less of a concern than timely email delivery. 721 It should be noted that barring administrator intervention, email 722 SHOULD be deferred when DNSSEC lookups fail, (as distinct from 723 "secure" non-existence of TLSA records, or secure evidence that the 724 domain is no longer signed). In addition to configuring fallback 725 strategies when TLSA records are unexpectedly absent, administrators 726 may, in hopefully rare cases, need to disable DNSSEC lookups for a 727 destination to work around a DNSSEC outage. 729 5. Acknowledgements 731 The authors would like to extend great thanks to Tony Finch, who 732 started the original version of a DANE SMTP document. His work is 733 greatly appreciated and has been incorporated into this document. 734 The authors would like to additionally thank Phil Pennock for his 735 comments and advice on this document. 737 Acknowledgments from Viktor: Thanks to Tony Finch who finally prodded 738 me into participating in DANE working group discussions. Thanks to 739 Paul Hoffman who motivated me to produce this memo and provided 740 feedback on early drafts. Thanks also to Wietse Venema who created 741 Postfix, and patiently guided the Postfix DANE implementation to 742 production quality. 744 6. Security Considerations 746 This protocol leverages DANE TLSA records to implement MITM resistant 747 opportunistic channel security for SMTP. For destination domains 748 that sign their MX records and publish signed TLSA records for their 749 MX hosts, this protocol allows sending MTAs (and perhaps dynamically 750 configured MUAs) to securely discover both the availability of TLS 751 and how to authenticate the destination. 753 This protocol does not aim to secure all SMTP traffic, as that is not 754 practical until DNSSEC and DANE adoption are universal. The 755 incremental deployment provided by following this specification is a 756 best possible path for securing SMTP. This protocol coexists and 757 interoperates with the existing insecure Internet email backbone. 759 The protocol does not preclude existing non-opportunistic SMTP TLS 760 security arrangements, which can continue to be used as before via 761 manual configuration and negotiated out-of-band key and TLS 762 configuration exchanges. 764 Opportunistic SMTP TLS depends critically on DNSSEC for downgrade 765 resistance and secure resolution of the destination name. If DNSSEC 766 is compromised, it is not possible to fall back on the public CA PKI 767 to prevent MITM attacks. A successful breach of DNSSEC enables the 768 attacker to publish TLSA usage 3 certificate associations, and 769 thereby bypass any security benefit the legitimate domain owner might 770 hope to gain by publishing usage 0 or 1 TLSA RRs. Given the lack of 771 public CA PKI support in existing MTA deployments, deprecating 772 certificate usages 0 and 1 in this specifications improves 773 interoperability without degrading security. 775 7. Normative References 777 [I-D.ietf-dane-ops] 778 Dukhovni, V. and W. Hardaker, "DANE TLSA implementation 779 and operational guidance", draft-ietf-dane-ops-00 (work in 780 progress), October 2013. 782 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 783 Requirement Levels", BCP 14, RFC 2119, March 1997. 785 [RFC2246] Dierks, T. and C. Allen, "The TLS Protocol Version 1.0", 786 RFC 2246, January 1999. 788 [RFC3207] Hoffman, P., "SMTP Service Extension for Secure SMTP over 789 Transport Layer Security", RFC 3207, February 2002. 791 [RFC3546] Blake-Wilson, S., Nystrom, M., Hopwood, D., Mikkelsen, J., 792 and T. Wright, "Transport Layer Security (TLS) 793 Extensions", RFC 3546, June 2003. 795 [RFC4033] Arends, R., Austein, R., Larson, M., Massey, D., and S. 796 Rose, "DNS Security Introduction and Requirements", RFC 797 4033, March 2005. 799 [RFC4034] Arends, R., Austein, R., Larson, M., Massey, D., and S. 800 Rose, "Resource Records for the DNS Security Extensions", 801 RFC 4034, March 2005. 803 [RFC4035] Arends, R., Austein, R., Larson, M., Massey, D., and S. 804 Rose, "Protocol Modifications for the DNS Security 805 Extensions", RFC 4035, March 2005. 807 [RFC4346] Dierks, T. and E. Rescorla, "The Transport Layer Security 808 (TLS) Protocol Version 1.1", RFC 4346, April 2006. 810 [RFC5246] Dierks, T. and E. Rescorla, "The Transport Layer Security 811 (TLS) Protocol Version 1.2", RFC 5246, August 2008. 813 [RFC5280] Cooper, D., Santesson, S., Farrell, S., Boeyen, S., 814 Housley, R., and W. Polk, "Internet X.509 Public Key 815 Infrastructure Certificate and Certificate Revocation List 816 (CRL) Profile", RFC 5280, May 2008. 818 [RFC5321] Klensin, J., "Simple Mail Transfer Protocol", RFC 5321, 819 October 2008. 821 [RFC6066] Eastlake, D., "Transport Layer Security (TLS) Extensions: 822 Extension Definitions", RFC 6066, January 2011. 824 [RFC6125] Saint-Andre, P. and J. Hodges, "Representation and 825 Verification of Domain-Based Application Service Identity 826 within Internet Public Key Infrastructure Using X.509 827 (PKIX) Certificates in the Context of Transport Layer 828 Security (TLS)", RFC 6125, March 2011. 830 [RFC6186] Daboo, C., "Use of SRV Records for Locating Email 831 Submission/Access Services", RFC 6186, March 2011. 833 [RFC6409] Gellens, R. and J. Klensin, "Message Submission for Mail", 834 STD 72, RFC 6409, November 2011. 836 [RFC6698] Hoffman, P. and J. Schlyter, "The DNS-Based Authentication 837 of Named Entities (DANE) Transport Layer Security (TLS) 838 Protocol: TLSA", RFC 6698, August 2012. 840 Authors' Addresses 842 Viktor Dukhovni 843 Unaffiliated 845 Email: ietf-dane@dukhovni.org 847 Wes Hardaker 848 Parsons 849 P.O. Box 382 850 Davis, CA 95617 851 US 853 Email: ietf@hardakers.net