idnits 2.17.1 draft-vesely-authmethod-dnswl-12.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 : ---------------------------------------------------------------------------- == There are 3 instances of lines with non-RFC6890-compliant IPv4 addresses in the document. If these are example addresses, they should be changed. -- The document has examples using IPv4 documentation addresses according to RFC6890, but does not use any IPv6 documentation addresses. Maybe there should be IPv6 examples, too? ** The document seems to lack a both a reference to RFC 2119 and the recommended RFC 2119 boilerplate, even if it appears to use RFC 2119 keywords. RFC 2119 keyword, line 329: '...h the DO bit set MUST NOT be taken to ...' Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (November 16, 2019) is 1622 days in the past. Is this intentional? Checking references for intended status: Informational ---------------------------------------------------------------------------- No issues found here. Summary: 1 error (**), 0 flaws (~~), 2 warnings (==), 2 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 IETF A. Vesely 3 Internet-Draft November 16, 2019 4 Intended status: Informational 5 Expires: May 19, 2020 7 DNSWL Email Authentication Method Extension 8 draft-vesely-authmethod-dnswl-12 10 Abstract 12 This document describes an additional Email Authentication Method 13 compliant with RFC 8601. The method consists in looking up the 14 sender's IP address in a DNS whitelist. This document is provided 15 for information in case the method is seen in the field, as well as 16 to suggest a useful practice and register the relevant keywords. 18 This document does not consider black lists. 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 May 19, 2020. 37 Copyright Notice 39 Copyright (c) 2019 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 2. Method Details . . . . . . . . . . . . . . . . . . . . . . . 3 56 3. TXT Record Contents . . . . . . . . . . . . . . . . . . . . . 5 57 4. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 5 58 4.1. Email Authentication Methods . . . . . . . . . . . . . . 6 59 4.2. Email Authentication Property Type . . . . . . . . . . . 6 60 4.3. Email Authentication Result Names . . . . . . . . . . . . 6 61 5. Security Considerations . . . . . . . . . . . . . . . . . . . 7 62 5.1. Over Quota Signaling . . . . . . . . . . . . . . . . . . 7 63 5.2. Security of DNSSEC Validation . . . . . . . . . . . . . . 7 64 5.3. Inherited Security Considerations . . . . . . . . . . . . 8 65 6. References . . . . . . . . . . . . . . . . . . . . . . . . . 8 66 6.1. Normative References . . . . . . . . . . . . . . . . . . 8 67 6.2. Informative References . . . . . . . . . . . . . . . . . 9 68 Appendix A. Example . . . . . . . . . . . . . . . . . . . . . . 10 69 Appendix B. Known Implementation . . . . . . . . . . . . . . . . 11 70 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 12 72 1. Introduction 74 One of the many checks that mail servers carry out is to query domain 75 name system whitelists (DNSWL). The DNS [RFC1034] lookup is based on 76 the connecting client's IP address, IPv4 or IPv6, and returns zero or 77 more A records. The latter are IPv4 IP addresses in the range 127/8. 78 Depending on the query, TXT records with varying content can also be 79 retrieved. See query details in [RFC5782]. 81 Since the IP address is known as soon as the connection is accepted, 82 this check can occur very early in an SMTP transaction. Its result 83 can be used to counterweight policies that typically occur at early 84 stages too, such as the Sender Policy Framework (SPF, the last 85 paragraph of Appendix D.3 of [RFC7208] is illustrated in Appendix A). 86 In addition, the result of a DNSWL lookup can also be used at later 87 stages; for example, a delivery agent can use it to learn the 88 trustworthiness of a mail relay in order to estimate the spamminess 89 of an email message. The latter possibility needs a place to collect 90 query results for downstream use, which is precisely what the 91 Authentication-Results header field aims at providing. 93 Results often contain additional data, encoded according to DNSWL- 94 specific criteria. The method described in this document considers 95 only whitelists --one of the major branches described by [RFC5782]. 96 There are also black/block lists, DNSBL, and combined lists. Since 97 they all have the same structure, the abbreviation DNSxL is used to 98 mean any. Now, the core procedures of a mail transfer agent (MTA) 99 tend to be quite general, leaving particular cases to be handled by 100 add-on modules. In the case of combined lists, the boundary MTA (see 101 [RFC5598]) which carries out the check and possibly stores the 102 result, has to be able to discern at least the color of each entry, 103 as that is required to make accept/reject decisions. This document 104 provides for storing the result when the DNSxL record to be reported 105 is a whitelisting one. 107 Data conveyed in A and TXT records can be stored as method's 108 properties. In effect, they are tantamount to local policies, albeit 109 outsourced. Downstream agents who know DNSWL-specific encoding can 110 understand the meaning of that data, and use it to make delivery 111 decisions. For example, a mail filter which detected heuristic 112 evidence of scam, can counterweight such data with the 113 trustworthiness score encoded in the A response, so as to protect 114 agains false positives. 116 This document describes a usage of TXT fields consistent with other 117 authentication methods. Namely, to serve the domain name in the TXT 118 record. That way, a downstream filter could also consider whether 119 the sending agent is aligned with the author domain, with semantics 120 similar to [RFC7489]. 122 At the time of this writing, this method is implemented by 123 [Courier-MTA], an outline of the implementation is given in 124 Appendix B. 126 2. Method Details 128 The result of the method states how the query did, up to the 129 interpretation of the returned data. 131 The method has four possible results: 133 pass: The query successfully returned applicable records. This 134 result is usually accompanied by one or both the policy 135 properties described below. Agents unable to interpret 136 those properties can still derive a positive value from 137 the fact that the sender is whitelisted. 138 none: The query worked but yielded no A record, or returned 139 NXDOMAIN, so the sender is not whitelisted. 140 temperror: The DNS evaluation could not be completed due to some 141 error that is likely transient in nature, such as a 142 temporary DNS error, e.g., a DNS RCODE of 2, commonly 143 known as SERVFAIL, or other error condition. A later 144 attempt may produce a final result. 146 permerror: The DNS evaluation cannot work because test entries don't 147 work, that is, DNSWL is broken, or because queries are 148 over quota, e.g., a DNS RCODE of 5, commonly known as 149 REFUSED, or a DNSWL-specific policy.ip with the same 150 meaning. A later attempt is unlikely to produce a final 151 result. Human intervention is required. 153 Note that there is no fail result. 155 The following ptype.property items define how the data provided by 156 the whitelist lookup can be saved. 158 dns.zone: DNSWL query root domain, which defines the meaning of the 159 policy.ip property below. Note that an MTA can use a 160 local mirror with a different name. The name stored here 161 has to be the best available reference for all 162 foreseeable downstream consumers. If the message is 163 handed outside the internal network, dns.zone had better 164 be the global zone. 165 policy.ip: The bit mask value received in type A response, in dotted 166 quad. Multiple entries can be arranged in a comma- 167 separated list. 168 policy.txt: The TXT record, if any. Multiple records are 169 concatenated in the usual way (explained, for example, in 170 Section 3.3 of [RFC7208]). See Section 3 for the 171 resulting content and query options. 172 dns.sec: This is a generic property stating whether the relevant 173 data was validated using DNSSEC ([RFC4033]). For the 174 present method, the relevant data consists of the 175 reported policy properties above, or, if the method 176 result is "none", their non-existence. This property has 177 three possible values: 179 yes: DNSSEC validation confirms the integrity of data. 180 Section 5.2 considers how that is related to the DNS 181 response. 182 no: The data is not signed. See Section 5.2. 183 na: Not applicable. No DNSSEC validation can be 184 performed, possibly because the lookup is run 185 through a different means than a security-aware DNS 186 resolver. This does not necessarily imply less 187 security. In particular, "na" is used if the data 188 was downloaded in bulk and then loaded on a local 189 nameserver --which is the case of an MTA querying a 190 local zone different from the reported dns.zone. 191 DNS errors, including validation errors, can also 192 report "na". This is also the value assumed by 193 default. 195 3. TXT Record Contents 197 According to [RFC5782], TXT records describe the reason why IP 198 addresses are listed in a DNSWL. The TXT record is useful if it 199 contains the domain names. The domain name would correspond to the 200 DNS domain name used by or within the administrative domain (ADMD) 201 operating the relevant MTA, sometimes called the "organizational 202 domain". In that case, the authentication provided by this method is 203 equivalent to a DKIM signature ([RFC6376]) or an SPF check host 204 ([RFC7208]), if the DNSWL is trusted. 206 According to a DNSWL's policy, attributing responsibility of an IP 207 address to an organization may require something more than a mere PTR 208 record consistency. If no domain names can be responsibly associated 209 to a given IP address, for example because the IP address was added 210 without direct involvement of the organization concerned, DNSWLs can 211 use a subdomain of .INVALID ([RFC2606]) where the leftmost label 212 hints at why an address is whitelisted. For example, if the address 213 192.0.2.38 was added by the list managers solely based on their 214 knowledge, the corresponding TXT record might be 215 AUTOPROMOTED.INVALID, so as to avoid to explicitly identify an entity 216 who didn't opt-in. 218 Following the example of Multicast DNS (see the second paragraph of 219 Section 16 of [RFC6762]) names containing non-ASCII characters can be 220 encoded in UTF-8 [RFC3629] using the normalization form canonical 221 composition (NFC) as described in Unicode Format for Network 222 Interchange ([RFC5198]). Inclusion of unaltered UTF-8 TXT values in 223 the header entails an environment compatible with EAI [RFC6530]. 225 DNS queries with a QTYPE of ANY may lead to inconsistent replies, 226 depending on the cache status. In addition, ANY is not "all", and 227 the provisions for queries that have QTYPE=ANY ([RFC8482]) don't 228 cover DNSxLs. A mail server can issue two simultaneous queries, A 229 and TXT. Otherwise, a downstream filter can issue a TXT query on its 230 own, if it knows that an A query was successful and that the DNSWL 231 serves useful TXT records. It is unlikely that TXT records exist if 232 a query for QTYPE A brought a result of none. 234 4. IANA Considerations 236 IANA maintains the "Email Authentication Parameters" registry with 237 several subregistries. IANA is requested to make assignments as set 238 out in the following sections. 240 4.1. Email Authentication Methods 242 IANA is requested to create four new entries in the "Email 243 Authentication Methods" registry as follows. 245 ------+----------+------+--------+-------------------+------+------- 246 Method|Definition|ptype |property| Value |Status|Version 247 ------+----------+------+--------+-------------------+------+------- 248 dnswl |[This.I-D]|dns |zone | DNSWL publicly |active| 1 249 | | | | accessible query | | 250 | | | | root domain | | 251 dnswl |[This.I-D]|policy|ip | type A response |active| 1 252 | | | | received (or | | 253 | | | | comma-separated | | 254 | | | | list thereof) | | 255 dnswl |[This.I-D]|policy|txt | type TXT query |active| 1 256 | | | | response | | 257 dnswl |[This.I-D]|dns |sec | one of "yes" for |active| 1 258 | | | | DNSSEC | | 259 | | | | authenticated | | 260 | | | | data, "no" for | | 261 | | | | not signed, or | | 262 | | | | "na" for not | | 263 | | | | applicable | | 264 ------+----------+------+--------+-------------------+------+------- 266 4.2. Email Authentication Property Type 268 IANA is requested to create a new entry in the "Email Authentication 269 Property Types" registry as follows. 271 +-------+------------+----------------------------------------------+ 272 | ptype | Definition | Description | 273 +-------+------------+----------------------------------------------+ 274 | dns | [This.I-D] | The property being reported belongs to the | 275 | | | Domain Name System | 276 +-------+------------+----------------------------------------------+ 278 4.3. Email Authentication Result Names 280 IANA is requested to create four new entries in the "Email 281 Authentication Result Names" registry as follows. 283 +-------------+-----------+---------------+--------+ 284 | Auth Method | Code | Specification | Status | 285 +-------------+-----------+---------------+--------+ 286 | dnswl | pass | [This.I-D] | active | 287 | | | | | 288 | dnswl | none | [This.I-D] | active | 289 | | | | | 290 | dnswl | temperror | [This.I-D] | active | 291 | | | | | 292 | dnswl | permerror | [This.I-D] | active | 293 +-------------+-----------+---------------+--------+ 295 5. Security Considerations 297 5.1. Over Quota Signaling 299 Some DNSWLs which provide for free access below a given quota, are 300 known to return special codes to signal over quota, for example 301 127.0.0.255. If the MTA cannot interpret that value, that case 302 results in a false positive. It will accept messages having spf=fail 303 if configured to do so. A DNSWL-specific module would realize the 304 fact and call for human intervention. 306 Returning an RCODE 5 (REFUSED) conveys the concept that the query is 307 "unauthorized", and human intervention required. 309 5.2. Security of DNSSEC Validation 311 The dns.sec property is meant to be as secure as DNSSEC results. It 312 makes sense to use it in an environment where the DNSSEC validation 313 can succeed. 315 Section 7 of [RFC4033] examines various ways of setting up a stub 316 resolver which either validates DNSSEC locally or trusts the 317 validation provided through a secure channel. For a different class, 318 it is possible to set up a dedicated, caching, dnssec-enabled 319 resolver reachable by the mail server through interprocess 320 communication on 127.0.0.1. In such cases, the property dns.sec=yes 321 corresponds to the Authenticated Data (AD) bit in the DNS response 322 header. 324 When the response contains no DNSSEC data, a security-aware resolver 325 seeks a signed proof of the non-existence of a DS record, at some 326 delegation point. If no error is returned, the zone is unsigned and 327 dns.sec=no can be set. Quoting the Security Considerations 328 Section of [RFC3225]: The absence of DNSSEC data in response to a 329 query with the DO bit set MUST NOT be taken to mean no security 330 information is available for that zone as the response may be forged 331 or a non-forged response of an altered (DO bit cleared) query. 333 If the application verifies the DNSSEC signatures on its own, it 334 effectively behaves like a validating stub resolver, and hence can 335 set dns.sec correspondingly. 337 When the data is downloaded in bulk and made available on a trusted 338 channel without using DNSSEC, set dns.sec=na or not at all. DNSWL 339 who publish bulk versions of their data can also sign that data, for 340 example using OpenPGP ([RFC4880]). It is the responsibility of 341 system administrators to authenticate the data by downloading and 342 validating the signature. The result of such validation is not 343 reported using dns.sec. 345 5.3. Inherited Security Considerations 347 For DNSSEC, the considerations of Section 12 of [RFC4033] apply. 349 All of the considerations described in Section 7 of [RFC8601] apply. 350 That includes securing against tampering all the channels after the 351 production of this Authentication-Results header field. 353 In addition, the usual caveats apply about importing text from 354 external online sources. Although queried DNSWLs are well known, 355 trusted entities, it is suggested that TXT records be reported only 356 if, upon inspection, their content is deemed actually actionable, and 357 their format compatible with the computing environment. 359 6. References 361 6.1. Normative References 363 [RFC2606] Eastlake 3rd, D. and A. Panitz, "Reserved Top Level DNS 364 Names", BCP 32, RFC 2606, DOI 10.17487/RFC2606, June 1999, 365 . 367 [RFC5782] Levine, J., "DNS Blacklists and Whitelists", RFC 5782, 368 DOI 10.17487/RFC5782, February 2010, . 371 [RFC8601] Kucherawy, M., "Message Header Field for Indicating 372 Message Authentication Status", RFC 8601, 373 DOI 10.17487/RFC8601, May 2019, . 376 6.2. Informative References 378 [RFC1034] Mockapetris, P., "Domain names - concepts and facilities", 379 STD 13, RFC 1034, DOI 10.17487/RFC1034, November 1987, 380 . 382 [RFC3225] Conrad, D., "Indicating Resolver Support of DNSSEC", 383 RFC 3225, DOI 10.17487/RFC3225, December 2001, 384 . 386 [RFC3629] Yergeau, F., "UTF-8, a transformation format of ISO 387 10646", STD 63, RFC 3629, DOI 10.17487/RFC3629, November 388 2003, . 390 [RFC4033] Arends, R., Austein, R., Larson, M., Massey, D., and S. 391 Rose, "DNS Security Introduction and Requirements", 392 RFC 4033, DOI 10.17487/RFC4033, March 2005, 393 . 395 [RFC4880] Callas, J., Donnerhacke, L., Finney, H., Shaw, D., and R. 396 Thayer, "OpenPGP Message Format", RFC 4880, 397 DOI 10.17487/RFC4880, November 2007, . 400 [RFC5198] Klensin, J. and M. Padlipsky, "Unicode Format for Network 401 Interchange", RFC 5198, DOI 10.17487/RFC5198, March 2008, 402 . 404 [RFC5598] Crocker, D., "Internet Mail Architecture", RFC 5598, 405 DOI 10.17487/RFC5598, July 2009, . 408 [RFC6376] Crocker, D., Ed., Hansen, T., Ed., and M. Kucherawy, Ed., 409 "DomainKeys Identified Mail (DKIM) Signatures", STD 76, 410 RFC 6376, DOI 10.17487/RFC6376, September 2011, 411 . 413 [RFC6530] Klensin, J. and Y. Ko, "Overview and Framework for 414 Internationalized Email", RFC 6530, DOI 10.17487/RFC6530, 415 February 2012, . 417 [RFC6762] Cheshire, S. and M. Krochmal, "Multicast DNS", RFC 6762, 418 DOI 10.17487/RFC6762, February 2013, . 421 [RFC7208] Kitterman, S., "Sender Policy Framework (SPF) for 422 Authorizing Use of Domains in Email, Version 1", RFC 7208, 423 DOI 10.17487/RFC7208, April 2014, . 426 [RFC7489] Kucherawy, M., Ed. and E. Zwicky, Ed., "Domain-based 427 Message Authentication, Reporting, and Conformance 428 (DMARC)", RFC 7489, DOI 10.17487/RFC7489, March 2015, 429 . 431 [RFC8482] Abley, J., Gudmundsson, O., Majkowski, M., and E. Hunt, 432 "Providing Minimal-Sized Responses to DNS Queries That 433 Have QTYPE=ANY", RFC 8482, DOI 10.17487/RFC8482, January 434 2019, . 436 [Courier-MTA] 437 "Courier Mail Server", . 439 [dnswl.org] 440 "DNSWL.ORG", . 442 Appendix A. Example 444 Delivered-To: recipient@example.org 445 Return-Path: 446 Authentication-Results: mta.example.org; 447 dkim=pass (whitelisted) header.i=@example.com 448 Authentication-Results: mta.example.org; 449 dnswl=pass dns.zone=list.dnswl.example dns.sec=na 450 policy.ip=127.0.10.1 451 policy.txt="fwd.example https://dnswl.example/?d=fwd.example" 452 Received-SPF: fail (Address does not pass Sender Policy Framework) 453 client-ip=192.0.2.1; 454 envelope-from="sender@example.com"; 455 helo=mailout.fwd.example; 456 receiver=mta.example.org; 457 Received: from mailout.fwd.example (mailout.fwd.example [192.0.2.1]) 458 (TLS: TLSv1/SSLv3,128bits,ECDHE-RSA-AES128-GCM-SHA256) 459 by mta.example.org with ESMTPS; Thu, 03 Ocy 2019 19:23:11 +0200 460 id 00000000005DC044.000000005702D87C.000007FC 462 Trace fields at the top of the header 464 The message went through a third party, fwd.example, which forwarded 465 it to the final MTA. Such mail path was not arranged beforehand with 466 the involved MTAs, it emerged spontaneously. This message would not 467 have made it to the target without whitelisting, because: 469 o the author domain published a strict SPF policy (-all), 470 o the forwarder did not alter the bounce address, and 471 o the target usually honors reject-on-fail, according to Section 8.4 472 of [RFC7208]. 474 However, the target also implemented the last paragraph of 475 Appendix D.3 of [RFC7208]. Rather than rejecting the message 476 outright before DATA, the MTA received it, recorded the SPF fail 477 result, and indicated the local policy mechanism which was applied in 478 order to override that result. Subsequent filtering detected no 479 malware and verified DKIM [RFC6376]. It would still have been 480 possible to reject the message, based on its content. It is at these 481 later stages, after receiving the body and also during delivery, that 482 a deeper knowledge of the policy values obtained from dnswl.example 483 can allow weighting that score against other factors. 485 Appendix B. Known Implementation 487 Implementation details mentioned in this section have been stable for 488 several years. Yet, this description is necessarily superficial, 489 version dependent, and subject to change. 491 [Courier-MTA] can be configured to lookup DNSBL and DNSWL, with 492 similar command line switches: 494 -block=zone[=displayzone][,var[/n.n.n.n][,msg]] 495 -allow=zone[=displayzone][,var[/n.n.n.n[,]]] 497 zone is the zone to be queried. 499 displayzone is only used for -allow, it is the value to be set in the 500 dns.zone property. 502 var stands for the environment variable whose existence triggers a 503 special action. The default variable names result in a conventional 504 behavior implemented by Courier-MTA. By setting different 505 environment variables, users can customize the behavior. 506 Conventional behavior differs widely between -block and -allow. The 507 former rejects the message, the latter produces Authentication- 508 Results header fields. 510 The n.n.n.n IP address requires a precise A record response. If not 511 given, any response results in setting the corresponding variable. 512 If given, variables are set only if the response matches exactly. 513 Such syntax provides for a very limited interpretation the 514 information encoded in A records. However, it is considered to be 515 too complicated already. Even specifying a range or an enumeration 516 of values would require something beyond what a normal user would be 517 willing to manage. 519 Finally, the trailing message, which overrides the 5xx SMTP reply for 520 -block, is not used for -allow, except that its mere presence 521 requires to query TXT records to be registered in policy.txt. 523 SPF is part of Courier-MTA's core. It is configured separately, and 524 provides for an "allowok" keyword to indicate to override rejection 525 in case of SPF failure and -allow whitelisting. 527 A customary whitelist is [dnswl.org]. It serves A records encoded as 528 follows: 530 1st octect: 127. 531 2nd octect: 0. 532 3rd octect: Category of business, 15 values. 533 4th octect: Trusworthiness/score, 4 values. 535 They also serve TXT records containing the domain name followed by an 536 URL pointing to further info about the relevant organization, such as 537 what other IP addresses of theirs are being whitelisted. They don't 538 use UTF-8. 540 dnswl.org provides for free registration and free access below 541 100,000 queries per day. They use the special return code 542 127.0.0.255 exemplified above to signal over quota. Although 543 Courier-MTA itself does not recognize it, it has a mail filter 544 (zdkimfilter, named after its main usage) where recognition of that 545 code, as well as that of trusworthiness in the 4th octect are hard- 546 coded. 548 Author's Address 550 Alessandro Vesely 551 v. L. Anelli 13 552 Milano, MI 20122 553 IT 555 Email: vesely@tana.it