idnits 2.17.1 draft-ietf-uta-smtp-tlsrpt-07.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 6 instances of too long lines in the document, the longest one being 54 characters in excess of 72. ** The abstract seems to contain references ([RFC6698], [RFC3207]), which it shouldn't. Please replace those with straight textual mentions of the documents in question. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year == The document seems to lack the recommended RFC 2119 boilerplate, even if it appears to use RFC 2119 keywords. (The document does seem to have the reference to RFC 2119 which the ID-Checklist requires). -- The document date (July 31, 2017) is 2461 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) == Missing Reference: 'TODO' is mentioned on line 146, but not defined == Missing Reference: 'RFC5280' is mentioned on line 328, but not defined == Missing Reference: 'CFWS' is mentioned on line 582, but not defined ** Obsolete normative reference: RFC 2818 (Obsoleted by RFC 9110) ** Obsolete normative reference: RFC 3501 (Obsoleted by RFC 9051) ** Obsolete normative reference: RFC 6125 (Obsoleted by RFC 9525) ** Obsolete normative reference: RFC 7159 (Obsoleted by RFC 8259) ** Downref: Normative reference to an Informational RFC: RFC 7435 ** Downref: Normative reference to an Informational RFC: RFC 7489 Summary: 8 errors (**), 0 flaws (~~), 5 warnings (==), 1 comment (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Using TLS in Applications D. Margolis 3 Internet-Draft Google, Inc 4 Intended status: Standards Track A. Brotman 5 Expires: February 1, 2018 Comcast, Inc 6 B. Ramakrishnan 7 Yahoo!, Inc 8 J. Jones 9 Microsoft, Inc 10 M. Risher 11 Google, Inc 12 July 31, 2017 14 SMTP TLS Reporting 15 draft-ietf-uta-smtp-tlsrpt-07 17 Abstract 19 A number of protocols exist for establishing encrypted channels 20 between SMTP Mail Transfer Agents, including STARTTLS [RFC3207], DANE 21 [RFC6698], and MTA-STS (TODO: Add ref). These protocols can fail due 22 to misconfiguration or active attack, leading to undelivered messages 23 or delivery over unencrypted or unauthenticated channels. This 24 document describes a reporting mechanism and format by which sending 25 systems can share statistics and specific information about potential 26 failures with recipient domains. Recipient domains can then use this 27 information to both detect potential attackers and diagnose 28 unintentional misconfigurations. 30 Status of This Memo 32 This Internet-Draft is submitted in full conformance with the 33 provisions of BCP 78 and BCP 79. 35 Internet-Drafts are working documents of the Internet Engineering 36 Task Force (IETF). Note that other groups may also distribute 37 working documents as Internet-Drafts. The list of current Internet- 38 Drafts is at http://datatracker.ietf.org/drafts/current/. 40 Internet-Drafts are draft documents valid for a maximum of six months 41 and may be updated, replaced, or obsoleted by other documents at any 42 time. It is inappropriate to use Internet-Drafts as reference 43 material or to cite them other than as "work in progress." 45 This Internet-Draft will expire on February 1, 2018. 47 Copyright Notice 49 Copyright (c) 2017 IETF Trust and the persons identified as the 50 document authors. All rights reserved. 52 This document is subject to BCP 78 and the IETF Trust's Legal 53 Provisions Relating to IETF Documents 54 (http://trustee.ietf.org/license-info) in effect on the date of 55 publication of this document. Please review these documents 56 carefully, as they describe your rights and restrictions with respect 57 to this document. Code Components extracted from this document must 58 include Simplified BSD License text as described in Section 4.e of 59 the Trust Legal Provisions and are provided without warranty as 60 described in the Simplified BSD License. 62 Table of Contents 64 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 65 1.1. Terminology . . . . . . . . . . . . . . . . . . . . . . . 3 66 2. Related Technologies . . . . . . . . . . . . . . . . . . . . 4 67 3. Reporting Policy . . . . . . . . . . . . . . . . . . . . . . 4 68 3.1. Example Reporting Policy . . . . . . . . . . . . . . . . 6 69 3.1.1. Report using MAILTO . . . . . . . . . . . . . . . . . 6 70 3.1.2. Report using HTTPS . . . . . . . . . . . . . . . . . 6 71 4. Reporting Schema . . . . . . . . . . . . . . . . . . . . . . 6 72 4.1. Report Time-frame . . . . . . . . . . . . . . . . . . . . 7 73 4.2. Delivery Summary . . . . . . . . . . . . . . . . . . . . 7 74 4.2.1. Success Count . . . . . . . . . . . . . . . . . . . . 7 75 4.2.2. Failure Count . . . . . . . . . . . . . . . . . . . . 7 76 4.3. Result Types . . . . . . . . . . . . . . . . . . . . . . 7 77 4.3.1. Negotiation Failures . . . . . . . . . . . . . . . . 7 78 4.3.2. Policy Failures . . . . . . . . . . . . . . . . . . . 8 79 4.3.3. General Failures . . . . . . . . . . . . . . . . . . 8 80 4.3.4. Transient Failures . . . . . . . . . . . . . . . . . 9 81 4.4. JSON Report Schema . . . . . . . . . . . . . . . . . . . 9 82 5. Report Delivery . . . . . . . . . . . . . . . . . . . . . . . 11 83 5.1. Report Filename . . . . . . . . . . . . . . . . . . . . . 11 84 5.2. Compression . . . . . . . . . . . . . . . . . . . . . . . 12 85 5.3. Email Transport . . . . . . . . . . . . . . . . . . . . . 12 86 5.3.1. Example Report . . . . . . . . . . . . . . . . . . . 14 87 5.4. HTTPS Transport . . . . . . . . . . . . . . . . . . . . . 14 88 5.5. Delivery Retry . . . . . . . . . . . . . . . . . . . . . 15 89 6. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 15 90 6.1. Message headers . . . . . . . . . . . . . . . . . . . . . 15 91 6.2. Report Type . . . . . . . . . . . . . . . . . . . . . . . 15 92 6.3. application/tlsrpt+json Media Type . . . . . . . . . . . 15 93 6.4. application/tlsrpt+gz Media Type . . . . . . . . . . . . 17 94 6.5. STARTTLS Validation Result Types . . . . . . . . . . . . 18 96 7. Security Considerations . . . . . . . . . . . . . . . . . . . 18 97 8. Appendix 1: Example Reporting Policy . . . . . . . . . . . . 19 98 8.1. Report using MAILTO . . . . . . . . . . . . . . . . . . . 19 99 8.2. Report using HTTPS . . . . . . . . . . . . . . . . . . . 19 100 9. Appendix 2: Example JSON Report . . . . . . . . . . . . . . . 19 101 10. Normative References . . . . . . . . . . . . . . . . . . . . 21 102 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 23 104 1. Introduction 106 The STARTTLS extension to SMTP [RFC3207] allows SMTP clients and 107 hosts to establish secure SMTP sessions over TLS. The protocol 108 design is based on "Opportunistic Security" (OS) [RFC7435], which 109 maintains interoperability with clients that do not support STARTTLS 110 but means that any attacker who can delete parts of the SMTP session 111 (such as the "250 STARTTLS" response) or redirect the entire SMTP 112 session (perhaps by overwriting the resolved MX record of the 113 delivery domain) can perform a downgrade or interception attack. 115 Because such "downgrade attacks" are not necessarily apparent to the 116 receiving MTA, this document defines a mechanism for sending domains 117 to report on failures at multiple stages of the MTA-to-MTA 118 conversation. 120 Recipient domains may also use the mechanisms defined by MTA-STS 121 (TODO: Add ref) or DANE [RFC6698] to publish additional encryption 122 and authentication requirements; this document defines a mechanism 123 for sending domains that are compatible with MTA-STS or DANE to share 124 success and failure statistics with recipient domains. 126 Specifically, this document defines a reporting schema that covers 127 failures in routing, STARTTLS negotiation, and both DANE [RFC6698] 128 and MTA-STS (TODO: Add ref) policy validation errors, and a standard 129 TXT record that recipient domains can use to indicate where reports 130 in this format should be sent. 132 This document is intended as a companion to the specification for 133 SMTP MTA Strict Transport Security (MTA-STS, TODO: Add ref). 135 1.1. Terminology 137 The keywords MUST, MUST NOT, REQUIRED, SHALL, SHALL NOT, SHOULD, 138 SHOULD NOT, RECOMMENDED, MAY, and OPTIONAL, when they appear in this 139 document, are to be interpreted as described in [RFC2119]. 141 We also define the following terms for further use in this document: 143 o MTA-STS Policy: A definition of the expected TLS availability, 144 behavior, and desired actions for a given domain when a sending 145 MTA encounters problems in negotiating a secure channel. MTA-STS 146 is defined in [TODO] 148 o DANE Policy: A mechanism by which administrators can supply a 149 record that can be used to validate the certificate presented by 150 an MTA. DANE is defined in [RFC6698]. 152 o TLSRPT Policy: A policy specifying the endpoint to which sending 153 MTAs should deliver reports. 155 o Policy Domain: The domain against which an MTA-STS or DANE Policy 156 is defined. 158 o Sending MTA: The MTA initiating the delivery of an email message. 160 2. Related Technologies 162 o This document is intended as a companion to the specification for 163 SMTP MTA Strict Transport Security (MTA-STS, TODO: Add RFC ref). 165 o SMTP-TLSRPT defines a mechanism for sending domains that are 166 compatible with MTA-STS or DANE to share success and failure 167 statistics with recipient domains. DANE is defined in [RFC6698] 168 and MTA-STS is defined in [TODO : Add RFC ref] 170 3. Reporting Policy 172 A domain publishes a record to its DNS indicating that it wishes to 173 receive reports. These SMTP TLSRPT policies are distributed via DNS 174 from the Policy Domain's zone, as TXT records (similar to DMARC 175 policies) under the name "_smtp-tlsrpt". For example, for the Policy 176 Domain "example.com", the recipient's TLSRPT policy can be retrieved 177 from "_smtp-tlsrpt.example.com". 179 Policies consist of the following directives: 181 o "v": This value MUST be equal to "TLSRPTv1". 183 o "rua": A URI specifying the endpoint to which aggregate 184 information about policy failures should be sent (see Section 4, 185 "Reporting Schema", for more information). Two URI schemes are 186 supported: "mailto" and "https". 188 o In the case of "https", reports should be submitted via POST 189 ([RFC2818]) to the specified URI. 191 o In the case of "mailto", reports should be submitted to the 192 specified email address ([RFC6068]). When sending failure reports 193 via SMTP, sending MTAs MUST deliver reports despite any TLS- 194 related failures. This may mean that the reports are delivered in 195 the clear. 197 The formal definition of the "_smtp-tlsrpt" TXT record, defined using 198 [RFC5234], is as follows: 200 tlsrpt-record = tlsrpt-version *WSP field-delim *WSP tlsrpt-rua 201 [field-delim [tlsrpt-extensions]] 203 field-delim = %x3B ; ";" 205 tlsrpt-version = %x76 *WSP "=" *WSP %x54 %x4C %x53 %x52 206 %x50 %x54 %x76 %x31 ; "v=TLSRPTv1" 208 tlsrpt-rua = %x72 %x75 %x61 *WSP "=" *WSP tlsrpt-uri ; "rua=..." 210 tlsrpt-uri = URI 211 ; "URI" is imported from [@!RFC3986]; commas (ASCII 212 ; 0x2C) and exclamation points (ASCII 0x21) 213 ; MUST be encoded; the numeric portion MUST fit 214 ; within an unsigned 64-bit integer 216 tlsrpt-extensions = tlsrpt-extension *(field-delim tlsrpt-extension) 217 [field-delim] 218 ; extension fields 220 tlsrpt-extension = tlsrpt-ext-name *WSP "=" *WSP tlsrpt-ext-value 222 tlsrpt-ext-name = (ALPHA / DIGIT) *31(ALPHA / DIGIT / "_" / "-" / ".") 224 tlsrpt-ext-value = 1*(%x21-3A / %x3C / %x3E-7E) ; chars excluding 225 ; "=", ";", SP, and 226 ; control chars 228 If multiple TXT records for "_smtp-tlsrpt" are returned by the 229 resolver, records which do not begin with "v=TLSRPTv1;" are 230 discarded. If the number of resulting records is not one, senders 231 MUST assume the recipient domain does not implement TLSRPT. Parsers 232 MUST accept TXT records which are syntactically valid (i.e. valid 233 key-value pairs seprated by semi-colons) and implementing a superset 234 of this specification, in which case unknown fields SHALL be ignored. 236 3.1. Example Reporting Policy 238 3.1.1. Report using MAILTO 240 _smtp-tlsrpt.example.com. IN TXT \ 241 "v=TLSRPTv1;rua=mailto:reports@example.com" 243 3.1.2. Report using HTTPS 245 _smtp-tlsrpt.example.com. IN TXT \ 246 "v=TLSRPTv1; \ 247 rua=https://reporting.example.com/v1/tlsrpt" 249 4. Reporting Schema 251 The report is composed as a plain text file encoded in the I-JSON 252 format ([RFC7493]). 254 Aggregate reports contain the following fields: 256 o Report metadata: 258 * The organization responsible for the report 260 * Contact information for one or more responsible parties for the 261 contents of the report 263 * A unique identifier for the report 265 * The reporting date range for the report 267 o Policy, consisting of: 269 * One of the following policy types: (1) The MTA-STS policy 270 applied (as a string) (2) The DANE TLSA record applied (as a 271 string, with each RR entry of the RRset listed and separated by 272 a semicolon) (3) The literal string "no-policy-found", if 273 neither a TLSA nor MTA-STS policy could be found. 275 * The domain for which the policy is applied 277 * The MX host 279 * An identifier for the policy (where applicable) 281 o Aggregate counts, comprising result type, sending MTA IP, 282 receiving MTA hostname, session count, and an optional additional 283 information field containing a URI for recipients to review 284 further information on a failure type. 286 Note that the failure types are non-exclusive; an aggregate report 287 may contain overlapping "counts" of failure types when a single send 288 attempt encountered multiple errors. 290 4.1. Report Time-frame 292 The report SHOULD cover a full day, from 0000-2400 UTC. This should 293 allow for easier correlation of failure events. 295 4.2. Delivery Summary 297 4.2.1. Success Count 299 o "success-count": This indicates that the sending MTA was able to 300 successfully negotiate a policy-compliant TLS connection, and 301 serves to provide a "heartbeat" to receiving domains that 302 reporting is functional and tabulating correctly. This field 303 contains an aggregate count of successful connections for the 304 reporting system. 306 4.2.2. Failure Count 308 o "failure-count": This indicates that the sending MTA was unable to 309 successfully establish a connection with the receiving platform. 310 Section 4.3, "Result Types", will elaborate on the failed 311 negotiation attempts. This field contains an aggregate count of 312 failed connections. 314 4.3. Result Types 316 The list of result types will start with the minimal set below, and 317 is expected to grow over time based on real-world experience. The 318 initial set is: 320 4.3.1. Negotiation Failures 322 o "starttls-not-supported": This indicates that the recipient MX did 323 not support STARTTLS. 325 o "certificate-host-mismatch": This indicates that the certificate 326 presented did not adhere to the constraints specified in the MTA- 327 STS or DANE policy, e.g. if the MX does not match any identities 328 listed in the Subject Alternate Name (SAN) [RFC5280]. 330 o "certificate-expired": This indicates that the certificate has 331 expired. 333 o "certificate-not-trusted": This a label that covers multiple 334 certificate related failures that include, but not limited to 335 errors such as untrusted/unknown CAs, certificate name 336 constraints, certificate chain errors etc. When using this 337 declaration, the reporting MTA SHOULD utilize the "failure-reason" 338 to provide more information to the receiving entity. 340 o "validation-failure": This indicates a general failure for a 341 reason not matching a category above. When using this 342 declaration, the reporting MTA SHOULD utilize the "failure-reason" 343 to provide more information to the receiving entity. 345 4.3.2. Policy Failures 347 4.3.2.1. DANE-specific Policy Failures 349 o "tlsa-invalid": This indicates a validation error in the TLSA 350 record associated with a DANE policy. None of the records in the 351 RRset were found to be valid. 353 o "dnssec-invalid": This would indicate that no valid records were 354 returned from the recursive resolver. The request returned with 355 SERVFAIL for the requested TLSA record. 357 4.3.2.2. MTA-STS-specific Policy Failures 359 o "sts-policy-invalid": This indicates a validation error for the 360 overall MTA-STS policy. 362 o "sts-webpki-invalid": This indicates that the MTA-STS policy could 363 not be authenticated using PKIX validation. 365 4.3.3. General Failures 367 When a negotiation failure can not be categorized into one of the 368 "Negotiation Failures" stated above, the reporter SHOULD use the 369 "validation-failure" category. As TLS grows and becomes more 370 complex, new mechanisms may not be easily categorized. This allows 371 for a generic feedback category. When this category is used, the 372 reporter SHOULD also use the "failure-reason-code" to give some 373 feedback to the receiving entity. This is intended to be a short 374 text field, and the contents of the field should be an error code or 375 error text, such as "X509_V_ERR_UNHANDLED_CRITICAL_CRL_EXTENSION". 377 4.3.4. Transient Failures 379 Transient errors due to too-busy network, TCP timeouts, etc. are not 380 required to be reported. 382 4.4. JSON Report Schema 384 The JSON schema is derived from the HPKP JSON schema [RFC7469] (cf. 385 Section 3) 387 { 388 "organization-name": organization-name, 389 "date-range": { 390 "start-datetime": date-time, 391 "end-datetime": date-time 392 }, 393 "contact-info": email-address, 394 "report-id": report-id, 395 "policy": { 396 "policy-type": policy-type, 397 "policy-string": policy-string, 398 "policy-domain": domain, 399 "mx-host": mx-host-pattern 400 }, 401 "summary": { 402 "total-successful-session-count": total-successful-session-count, 403 "total-failure-session-count:" total-failure-session-count 404 } 405 "failure-details": [ 406 { 407 "result-type": result-type, 408 "sending-mta-ip": ip-address, 409 "receiving-mx-hostname": receiving-mx-hostname, 410 "receiving-mx-helo": receiving-mx-helo, 411 "failed-session-count": failed-session-count, 412 "additional-information": additional-info-uri, 413 "failure-reason-code": "failure-reason-code" 414 } 415 ] 416 } 418 JSON Report Format 420 o "organization-name": The name of the organization responsible for 421 the report. It is provided as a string. 423 o "date-time": The date-time indicates the start- and end-times for 424 the report range. It is provided as a string formatted according 425 to Section 5.6, "Internet Date/Time Format", of [RFC3339]. The 426 report should be for a full UTC day, 0000-2400. 428 o "email-address": The contact information for a responsible party 429 of the report. It is provided as a string formatted according to 430 Section 3.4.1, "Addr-Spec", of [RFC5321]. 432 o "report-id": A unique identifier for the report. Report authors 433 may use whatever scheme they prefer to generate a unique 434 identifier. It is provided as a string. 436 o "policy-type": The type of policy that was applied by the sending 437 domain. Presently, the only three valid choices are "tlsa", 438 "sts", and the literal string "no-policy-found". It is provided 439 as a string. 441 o "policy-string": The JSON string serialization ([RFC7159] section 442 7) of the policy, whether TLSA record ([RFC6698] section 2.3) or 443 MTA-STS policy. 445 o "domain": The Policy Domain is the domain against which the MTA- 446 STS or DANE policy is defined. In the case of Internationalized 447 Domain Names ([RFC5891]), the domain is the Punycode-encoded 448 A-label ([RFC3492]) and not the U-label. 450 o "mx-host-pattern": The pattern of MX hostnames from the applied 451 policy. It is provided as a string, and is interpreted in the 452 same manner as the "Checking of Wildcard Certificates" rules in 453 Section 6.4.3 of [RFC6125]. 455 o "result-type": A value from Section 4.3, "Result Types", above. 456 In the case of Internationalized Domain Names ([RFC5891]), the 457 domain is the Punycode-encoded A-label ([RFC3492]) and not the 458 U-label. 460 o "ip-address": The IP address of the sending MTA that attempted the 461 STARTTLS connection. It is provided as a string representation of 462 an IPv4 (see below) or IPv6 ([RFC5952]) address in dot-decimal or 463 colon-hexadecimal notation. 465 o "receiving-mx-hostname": The hostname of the receiving MTA MX 466 record with which the sending MTA attempted to negotiate a 467 STARTTLS connection. 469 o "receiving-mx-helo": (optional) The HELO or EHLO string from the 470 banner announced during the reported session. 472 o "total-successful-session-count": The aggregate number (integer) 473 of successfully negotiated TLS-enabled connections to the 474 receiving site. 476 o "total-failure-session-count": The aggregate number (integer) of 477 failures to negotiate an TLS-enabled connection to the receiving 478 site. 480 o "failed-session-count": The number of (attempted) sessions that 481 match the relevant "result-type" for this section. 483 o "additional-info-uri": An optional URI [RFC3986] pointing to 484 additional information around the relevant "result-type". For 485 example, this URI might host the complete certificate chain 486 presented during an attempted STARTTLS session. 488 o "failure-reason-code": A text field to include an TLS-related 489 error code or error message. 491 For report purposes, an IPv4 Address is defined as: IPv4address = 492 dec-octet "." dec-octet "." dec-octet "." dec-octet dec-octet = DIGIT 493 ; 0-9 / %x31-39 DIGIT ; 10-99 / "1" 2DIGIT ; 100-199 / "2" %x30-34 494 DIGIT ; 200-249 / "25" %x30-35 ; 250-255 496 5. Report Delivery 498 Reports can be delivered either as an email message via SMTP or via 499 HTTP POST. 501 5.1. Report Filename 503 The filename is typically constructed using the following ABNF: 505 filename = sender "!" policy-domain "!" begin-timestamp 506 "!" end-timestamp [ "!" unique-id ] "." extension 508 unique-id = 1*(ALPHA / DIGIT) 510 sender = domain ; imported from [@!RFC5321] 512 policy-domain = domain 514 begin-timestamp = 1*DIGIT 515 ; seconds since 00:00:00 UTC January 1, 1970 516 ; indicating start of the time range contained 517 ; in the report 519 end-timestamp = 1*DIGIT 520 ; seconds since 00:00:00 UTC January 1, 1970 521 ; indicating end of the time range contained 522 ; in the report 524 extension = "json" / "json.gz" 526 The extension MUST be "json" for a plain JSON file, or "json.gz" for 527 a JSON file compressed using GZIP. 529 "unique-id" allows an optional unique ID generated by the Sending MTA 530 to distinguish among multiple reports generated simultaneously by 531 different sources within the same Policy Domain. For example, this 532 is a possible filename for the gzip file of a report to the Policy 533 Domain "example.net" from the Sending MTA "mail.sender.example.com": 535 `mail.sender.example.com!example.net!1470013207!1470186007!001.json.gz` 537 5.2. Compression 539 The report SHOULD be subjected to GZIP compression for both email and 540 HTTPS transport. Declining to apply compression can cause the report 541 to be too large for a receiver to process (a commonly observed 542 receiver limit is ten megabytes); compressing the file increases the 543 chances of acceptance of the report at some compute cost. 545 5.3. Email Transport 547 The report MAY be delivered by email. To make the reports machine- 548 parsable for the receivers, we define a top-level media type 549 "multipart/report" with a new parameter "report-type="tlsrpt"". 550 Inside it, there are two parts: The first part is human readable, 551 typically "text/plain", and the second part is machine readable with 552 a new media type defined called "application/tlsrpt+json". If 553 compressed, the report should use the media type "application/ 554 tlsrpt+gzip". 556 In addition, the following two new top level message header fields 557 are defined: 559 TLS-Report-Domain: Receiver-Domain 560 TLS-Report-Submitter: Sender-Domain 562 These message headers MUST be included and should allow for easy 563 searching for all reports submitted by a report domain or a 564 particular submitter, for example in IMAP [RFC3501]: 566 "s SEARCH HEADER "TLS-Report-Domain" "example.com"" 568 It is presumed that the aggregate reporting address will be equipped 569 to process new message header fields and extract MIME parts with the 570 prescribed media type and filename, and ignore the rest. 572 The [RFC5322].Subject field for individual report submissions SHOULD 573 conform to the following ABNF: 575 tlsrpt-subject = %s"Report" FWS ; "Report" 576 %s"Domain:" FWS ; "Domain:" 577 domain-name FWS ; per RFC6376 578 %s"Submitter:" FWS ; "Submitter:" 579 domain-name FWS ; per RFC6376 580 %s"Report-ID:" FWS ; "Report-ID: 581 "<" id-left "@" id-right ">" ; per RFC5322 582 [CFWS] ; per RFC5322 (as with FWS) 584 The first domain-name indicates the DNS domain name about which the 585 report was generated. The second domain-name indicates the DNS 586 domain name representing the Sending MTA generating the report. The 587 purpose of the Report-ID: portion of the field is to enable the 588 Policy Domain to identify and ignore duplicate reports that might be 589 sent by a Sending MTA. 591 For instance, this is a possible Subject field for a report to the 592 Policy Domain "example.net" from the Sending MTA 593 "mail.sender.example.com". It is line-wrapped as allowed by 594 [RFC5322]: 596 Subject: Report Domain: example.net 597 Submitter: mail.sender.example.com 598 Report-ID: <735ff.e317+bf22029@mailexample.net> 600 5.3.1. Example Report 602 From: tlsrpt@mail.sender.example.com 603 Date: Fri, May 09 2017 16:54:30 -0800 604 To: mts-sts-tlsrpt@example.net 605 Subject: Report Domain: example.net 606 Submitter: mail.sender.example.com 607 Report-ID: <735ff.e317+bf22029@example.net> 608 TLS-Report-Domain: example.net 609 TLS-Report-Submitter: mail.sender.example.com 610 MIME-Version: 1.0 611 Content-Type: multipart/report; report-type="tlsrpt"; 612 boundary="----=_NextPart_000_024E_01CC9B0A.AFE54C00" 613 Content-Language: en-us 615 This is a multipart message in MIME format. 617 ------=_NextPart_000_024E_01CC9B0A.AFE54C00 618 Content-Type: text/plain; charset="us-ascii" 619 Content-Transfer-Encoding: 7bit 621 This is an aggregate TLS report from mail.sender.example.com 623 ------=_NextPart_000_024E_01CC9B0A.AFE54C00 624 Content-Type: application/tlsrpt+gzip 625 Content-Transfer-Encoding: base64 626 Content-Disposition: attachment; 627 filename="mail.sender.example!example.com! 628 1013662812!1013749130.gz" 630 632 ------=_NextPart_000_024E_01CC9B0A.AFE54C00-- 633 ... 635 Note that, when sending failure reports via SMTP, sending MTAs MUST 636 NOT honor MTA-STS or DANE TLSA failures. 638 5.4. HTTPS Transport 640 The report MAY be delivered by POST to HTTPS. If compressed, the 641 report should use the media type "application/tlsrpt+gzip", and 642 "application/tlsrpt+json" otherwise (see section Section 6, "IANA 643 Considerations"). 645 5.5. Delivery Retry 647 In the event of a delivery failure, regardless of the delivery 648 method, a sender SHOULD attempt redelivery for up to 24hrs after the 649 initial attempt. As previously stated the reports are optional, so 650 while it is ideal to attempt redelivery, it is not required. If 651 multiple retries are attempted, they should be on a logarithmic 652 scale. 654 6. IANA Considerations 656 The following are the IANA considerations discussed in this document. 658 6.1. Message headers 660 Below is the Internet Assigned Numbers Authority (IANA) Permanent 661 Message Header Field registration information per [RFC3864]. 663 Header field name: TLS-Report-Domain 664 Applicable protocol: mail 665 Status: standard 666 Author/Change controller: IETF 667 Specification document(s): this one 669 Header field name: TLS-Report-Submitter 670 Applicable protocol: mail 671 Status: standard 672 Author/Change controller: IETF 673 Specification document(s): this one 675 6.2. Report Type 677 This document registers a new parameter "report-type="tlsrpt"" under 678 "multipart/report" top-level media type for use with [RFC6522]. 680 The media type suitable for use as a report-type is defined in the 681 following section. 683 6.3. application/tlsrpt+json Media Type 685 This document registers multiple media types, beginning with Table 1 686 below. 688 +-------------+----------------+-------------+-------------------+ 689 | Type | Subtype | File extn | Specification | 690 +-------------+----------------+-------------+-------------------+ 691 | application | tlsrpt+json | .json | Section 5.3 | 692 +-------------+----------------+-------------+-------------------+ 693 Table 1: SMTP TLS Reporting Media Type 695 Type name: application 697 Subtype name: tlsrpt+json 699 Required parameters: n/a 701 Optional parameters: n/a 703 Encoding considerations: Encoding considerations are identical to 704 those specified for the "application/json" media type. See 705 [RFC7493]. 707 Security considerations: Security considerations relating to SMTP TLS 708 Reporting are discussed in Section 7. 710 Interoperability considerations: This document specifies format of 711 conforming messages and the interpretation thereof. 713 Published specification: Section 5.3 of this document. 715 Applications that use this media type: Mail User Agents (MUA) and 716 Mail Transfer Agents. 718 Additional information: 720 Magic number(s): n/a 722 File extension(s): ".json" 724 Macintosh file type code(s): n/a 726 Person & email address to contact for further information: See 727 Authors' Addresses section. 729 Intended usage: COMMON 731 Restrictions on usage: n/a 733 Author: See Authors' Addresses section. 735 Change controller: Internet Engineering Task Force 736 (mailto:iesg@ietf.org). 738 6.4. application/tlsrpt+gz Media Type 740 +-------------+----------------+-------------+-------------------+ 741 | Type | Subtype | File extn | Specification | 742 +-------------+----------------+-------------+-------------------+ 743 | application | tlsrpt+gzip | .gz | Section 5.3 | 744 +-------------+----------------+-------------+-------------------+ 745 Table 2: SMTP TLS Reporting Media Type 747 Type name: application 749 Subtype name: tlsrpt+gzip 751 Required parameters: n/a 753 Optional parameters: n/a 755 Encoding considerations: Encoding considerations are identical to 756 those specified for the "application/json" media type. See 757 [RFC7493]. 759 Security considerations: Security considerations relating to SMTP TLS 760 Reporting are discussed in Section 7. 762 Interoperability considerations: This document specifies format of 763 conforming messages and the interpretation thereof. 765 Published specification: Section 5.3 of this document. 767 Applications that use this media type: Mail User Agents (MUA) and 768 Mail Transfer Agents. 770 Additional information: 772 Magic number(s): n/a 774 File extension(s): ".gz" 776 Macintosh file type code(s): n/a 778 Person & email address to contact for further information: See 779 Authors' Addresses section. 781 Intended usage: COMMON 782 Restrictions on usage: n/a 784 Author: See Authors' Addresses section. 786 Change controller: Internet Engineering Task Force 787 (mailto:iesg@ietf.org). 789 6.5. STARTTLS Validation Result Types 791 This document creates a new registry, "STARTTLS Validation Result 792 Types". The initial entries in the registry are: 794 +-------------------------------+ 795 | Result Type | 796 +-------------------------------+ 797 | "starttls-not-supported" | 798 | "certificate-host-mismatch" | 799 | "certificate-expired" | 800 | "tlsa-invalid" | 801 | "dnssec-invalid" | 802 | "sts-policy-invalid" | 803 | "sts-webpki-invalid" | 804 | "validation-failure" | 805 +-------------------------------+ 807 The above entries are described in section Section 4.3, "Result 808 Types." New result types can be added to this registry using "Expert 809 Review" IANA registration policy. 811 7. Security Considerations 813 SMTP TLS Reporting provides transparency into misconfigurations or 814 attempts to intercept or tamper with mail between hosts who support 815 STARTTLS. There are several security risks presented by the 816 existence of this reporting channel: 818 o Flooding of the Aggregate report URI (rua) endpoint: An attacker 819 could flood the endpoint with excessive reporting traffic and 820 prevent the receiving domain from accepting additional reports. 821 This type of Denial-of-Service attack would limit visibility into 822 STARTTLS failures, leaving the receiving domain blind to an 823 ongoing attack. 825 o Untrusted content: An attacker could inject malicious code into 826 the report, opening a vulnerability in the receiving domain. 827 Implementers are advised to take precautions against evaluating 828 the contents of the report. 830 o Report snooping: An attacker could create a bogus TLSRPT record to 831 receive statistics about a domain the attacker does not own. 832 Since an attacker able to poison DNS is already able to receive 833 counts of SMTP connections (and, absent DANE or MTA-STS policies, 834 actual SMTP message payloads), this does not present a significant 835 new vulnerability. 837 o Reports as DDoS: TLSRPT allows specifying destinations for the 838 reports that are outside the authority of the Policy Domain, which 839 allows domains to delegate processing of reports to a partner 840 organization. However, an attacker who controls the Policy Domain 841 DNS could also use this mechanism to direct the reports to an 842 unwitting victim, flooding that victim with excessive reports. 843 DMARC [RFC7489] defines a solution for verifying delegation to 844 avoid such attacks; the need for this is greater with DMARC, 845 however, because DMARC allows an attacker to trigger reports to a 846 target from an innocent third party by sending that third party 847 mail (which triggers a report from the third party to the target). 848 In the case of TLSRPT, the attacker would have to induce the third 849 party to send the attacker mail in order to trigger reports from 850 the third party to the victim; this reduces the risk of such an 851 attack and the need for a verification mechanism. 853 8. Appendix 1: Example Reporting Policy 855 8.1. Report using MAILTO 857 _smtp-tlsrpt.mail.example.com. IN TXT \ 858 "v=TLSRPTv1;rua=mailto:reports@example.com" 860 8.2. Report using HTTPS 862 _smtp-tlsrpt.mail.example.com. IN TXT \ 863 "v=TLSRPTv1; \ 864 rua=https://reporting.example.com/v1/tlsrpt" 866 9. Appendix 2: Example JSON Report 867 { 868 "organization-name": "Company-X", 869 "date-range": { 870 "start-datetime": "2016-04-01T00:00:00Z", 871 "end-datetime": "2016-04-01T23:59:59Z" 872 }, 873 "contact-info": "sts-reporting@company-x.com", 874 "report-id": "5065427c-23d3-47ca-b6e0-946ea0e8c4be", 875 "policy": { 876 "policy-type": "sts", 877 "policy-string": "{ \"version\": \"STSv1\",\"mode\": \"report\", \"mx\": [\".mail.company-y.com\"], \"max_age\": 86400 }", 878 "policy-domain": "company-y.com", 879 "mx-host": ".mail.company-y.com" 880 }, 881 "summary": { 882 "total-successful-session-count": 5326, 883 "total-failure-session-count": 303 884 } 885 "failure-details": [{ 886 "result-type": "certificate-expired", 887 "sending-mta-ip": "98.136.216.25", 888 "receiving-mx-hostname": "mx1.mail.company-y.com", 889 "failed-session-count": 100 890 }, { 891 "result-type": "starttls-not-supported", 892 "sending-mta-ip": "98.22.33.99", 893 "receiving-mx-hostname": "mx2.mail.company-y.com", 894 "failed-session-count": 200, 895 "additional-information": "hxxps://reports.company-x.com/ 896 report_info?id=5065427c-23d3#StarttlsNotSupported" 897 }, { 898 "result-type: "validation-failure", 899 "sending-mta-ip": "47.97.15.2", 900 "receiving-mx-hostname: "mx-backup.mail.company-y.com", 901 "failed-session-count": 3, 902 "failure-error-code": "X509_V_ERR_PROXY_PATH_LENGTH_EXCEEDED" 903 }] 904 } 906 Figure: Example JSON report for a messages from Company-X to 907 Company-Y, where 100 sessions were attempted to Company Y servers 908 with an expired certificate and 200 sessions were attempted to 909 Company Y servers that did not successfully respond to the "STARTTLS" 910 command. Additionally 3 sessions failed due to 911 "X509_V_ERR_PROXY_PATH_LENGTH_EXCEEDED". 913 10. Normative References 915 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 916 Requirement Levels", BCP 14, RFC 2119, DOI 10.17487/ 917 RFC2119, March 1997, 918 . 920 [RFC2818] Rescorla, E., "HTTP Over TLS", RFC 2818, DOI 10.17487/ 921 RFC2818, May 2000, 922 . 924 [RFC3207] Hoffman, P., "SMTP Service Extension for Secure SMTP over 925 Transport Layer Security", RFC 3207, DOI 10.17487/RFC3207, 926 February 2002, . 928 [RFC3339] Klyne, G. and C. Newman, "Date and Time on the Internet: 929 Timestamps", RFC 3339, DOI 10.17487/RFC3339, July 2002, 930 . 932 [RFC3492] Costello, A., "Punycode: A Bootstring encoding of Unicode 933 for Internationalized Domain Names in Applications 934 (IDNA)", RFC 3492, DOI 10.17487/RFC3492, March 2003, 935 . 937 [RFC3501] Crispin, M., "INTERNET MESSAGE ACCESS PROTOCOL - VERSION 938 4rev1", RFC 3501, DOI 10.17487/RFC3501, March 2003, 939 . 941 [RFC3864] Klyne, G., Nottingham, M., and J. Mogul, "Registration 942 Procedures for Message Header Fields", BCP 90, RFC 3864, 943 DOI 10.17487/RFC3864, September 2004, 944 . 946 [RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform 947 Resource Identifier (URI): Generic Syntax", STD 66, RFC 948 3986, DOI 10.17487/RFC3986, January 2005, 949 . 951 [RFC5234] Crocker, D., Ed. and P. Overell, "Augmented BNF for Syntax 952 Specifications: ABNF", STD 68, RFC 5234, DOI 10.17487/ 953 RFC5234, January 2008, 954 . 956 [RFC5321] Klensin, J., "Simple Mail Transfer Protocol", RFC 5321, 957 DOI 10.17487/RFC5321, October 2008, 958 . 960 [RFC5322] Resnick, P., Ed., "Internet Message Format", RFC 5322, DOI 961 10.17487/RFC5322, October 2008, 962 . 964 [RFC5891] Klensin, J., "Internationalized Domain Names in 965 Applications (IDNA): Protocol", RFC 5891, DOI 10.17487/ 966 RFC5891, August 2010, 967 . 969 [RFC5952] Kawamura, S. and M. Kawashima, "A Recommendation for IPv6 970 Address Text Representation", RFC 5952, DOI 10.17487/ 971 RFC5952, August 2010, 972 . 974 [RFC6068] Duerst, M., Masinter, L., and J. Zawinski, "The 'mailto' 975 URI Scheme", RFC 6068, DOI 10.17487/RFC6068, October 2010, 976 . 978 [RFC6125] Saint-Andre, P. and J. Hodges, "Representation and 979 Verification of Domain-Based Application Service Identity 980 within Internet Public Key Infrastructure Using X.509 981 (PKIX) Certificates in the Context of Transport Layer 982 Security (TLS)", RFC 6125, DOI 10.17487/RFC6125, March 983 2011, . 985 [RFC6522] Kucherawy, M., Ed., "The Multipart/Report Media Type for 986 the Reporting of Mail System Administrative Messages", STD 987 73, RFC 6522, DOI 10.17487/RFC6522, January 2012, 988 . 990 [RFC6698] Hoffman, P. and J. Schlyter, "The DNS-Based Authentication 991 of Named Entities (DANE) Transport Layer Security (TLS) 992 Protocol: TLSA", RFC 6698, DOI 10.17487/RFC6698, August 993 2012, . 995 [RFC7159] Bray, T., Ed., "The JavaScript Object Notation (JSON) Data 996 Interchange Format", RFC 7159, DOI 10.17487/RFC7159, March 997 2014, . 999 [RFC7435] Dukhovni, V., "Opportunistic Security: Some Protection 1000 Most of the Time", RFC 7435, DOI 10.17487/RFC7435, 1001 December 2014, . 1003 [RFC7469] Evans, C., Palmer, C., and R. Sleevi, "Public Key Pinning 1004 Extension for HTTP", RFC 7469, DOI 10.17487/RFC7469, April 1005 2015, . 1007 [RFC7489] Kucherawy, M., Ed. and E. Zwicky, Ed., "Domain-based 1008 Message Authentication, Reporting, and Conformance 1009 (DMARC)", RFC 7489, DOI 10.17487/RFC7489, March 2015, 1010 . 1012 [RFC7493] Bray, T., Ed., "The I-JSON Message Format", RFC 7493, DOI 1013 10.17487/RFC7493, March 2015, 1014 . 1016 Authors' Addresses 1018 Daniel Margolis 1019 Google, Inc 1021 Email: dmargolis (at) google.com 1023 Alexander Brotman 1024 Comcast, Inc 1026 Email: alex_brotman (at) comcast.com 1028 Binu Ramakrishnan 1029 Yahoo!, Inc 1031 Email: rbinu (at) yahoo-inc (dot com) 1033 Janet Jones 1034 Microsoft, Inc 1036 Email: janet.jones (at) microsoft (dot com) 1038 Mark Risher 1039 Google, Inc 1041 Email: risher (at) google (dot com)