idnits 2.17.1 draft-ietf-uta-smtp-tlsrpt-08.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 5 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 (August 15, 2017) is 2446 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 148, but not defined == Missing Reference: 'RFC5280' is mentioned on line 338, but not defined == Missing Reference: 'CFWS' is mentioned on line 598, but not defined ** Obsolete normative reference: RFC 2818 (Obsoleted by RFC 9110) ** Obsolete normative reference: RFC 6125 (Obsoleted by RFC 9525) ** Obsolete normative reference: RFC 7159 (Obsoleted by RFC 8259) -- Obsolete informational reference (is this intentional?): RFC 3501 (Obsoleted by RFC 9051) Summary: 5 errors (**), 0 flaws (~~), 5 warnings (==), 2 comments (--). 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 16, 2018 Comcast, Inc 6 B. Ramakrishnan 7 Yahoo!, Inc 8 J. Jones 9 Microsoft, Inc 10 M. Risher 11 Google, Inc 12 August 15, 2017 14 SMTP TLS Reporting 15 draft-ietf-uta-smtp-tlsrpt-08 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 16, 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 5.6. Metadata Variances . . . . . . . . . . . . . . . . . . . 15 90 6. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 15 91 6.1. Message headers . . . . . . . . . . . . . . . . . . . . . 15 92 6.2. Report Type . . . . . . . . . . . . . . . . . . . . . . . 15 93 6.3. application/tlsrpt+json Media Type . . . . . . . . . . . 16 94 6.4. application/tlsrpt+gzip Media Type . . . . . . . . . . . 17 95 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. References . . . . . . . . . . . . . . . . . . . . . . . . . 21 102 10.1. Normative References . . . . . . . . . . . . . . . . . . 21 103 10.2. Informative References . . . . . . . . . . . . . . . . . 22 104 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 23 106 1. Introduction 108 The STARTTLS extension to SMTP [RFC3207] allows SMTP clients and 109 hosts to establish secure SMTP sessions over TLS. The protocol 110 design is based on "Opportunistic Security" (OS) [RFC7435], which 111 maintains interoperability with clients that do not support STARTTLS 112 but means that any attacker who can delete parts of the SMTP session 113 (such as the "250 STARTTLS" response) or redirect the entire SMTP 114 session (perhaps by overwriting the resolved MX record of the 115 delivery domain) can perform a downgrade or interception attack. 117 Because such "downgrade attacks" are not necessarily apparent to the 118 receiving MTA, this document defines a mechanism for sending domains 119 to report on failures at multiple stages of the MTA-to-MTA 120 conversation. 122 Recipient domains may also use the mechanisms defined by MTA-STS 123 (TODO: Add ref) or DANE [RFC6698] to publish additional encryption 124 and authentication requirements; this document defines a mechanism 125 for sending domains that are compatible with MTA-STS or DANE to share 126 success and failure statistics with recipient domains. 128 Specifically, this document defines a reporting schema that covers 129 failures in routing, STARTTLS negotiation, and both DANE [RFC6698] 130 and MTA-STS (TODO: Add ref) policy validation errors, and a standard 131 TXT record that recipient domains can use to indicate where reports 132 in this format should be sent. 134 This document is intended as a companion to the specification for 135 SMTP MTA Strict Transport Security (MTA-STS, TODO: Add ref). 137 1.1. Terminology 139 The keywords MUST, MUST NOT, REQUIRED, SHALL, SHALL NOT, SHOULD, 140 SHOULD NOT, RECOMMENDED, MAY, and OPTIONAL, when they appear in this 141 document, are to be interpreted as described in [RFC2119]. 143 We also define the following terms for further use in this document: 145 o MTA-STS Policy: A definition of the expected TLS availability, 146 behavior, and desired actions for a given domain when a sending 147 MTA encounters problems in negotiating a secure channel. MTA-STS 148 is defined in [TODO] 150 o DANE Policy: A mechanism by which administrators can supply a 151 record that can be used to validate the certificate presented by 152 an MTA. DANE is defined in [RFC6698]. 154 o TLSRPT Policy: A policy specifying the endpoint to which sending 155 MTAs should deliver reports. 157 o Policy Domain: The domain against which an MTA-STS or DANE Policy 158 is defined. 160 o Sending MTA: The MTA initiating the delivery of an email message. 162 2. Related Technologies 164 o This document is intended as a companion to the specification for 165 SMTP MTA Strict Transport Security (MTA-STS, TODO: Add RFC ref). 167 o SMTP-TLSRPT defines a mechanism for sending domains that are 168 compatible with MTA-STS or DANE to share success and failure 169 statistics with recipient domains. DANE is defined in [RFC6698] 170 and MTA-STS is defined in [TODO : Add RFC ref] 172 3. Reporting Policy 174 A domain publishes a record to its DNS indicating that it wishes to 175 receive reports. These SMTP TLSRPT policies are distributed via DNS 176 from the Policy Domain's zone, as TXT records (similar to DMARC 177 policies) under the name "_smtp-tlsrpt". For example, for the Policy 178 Domain "example.com", the recipient's TLSRPT policy can be retrieved 179 from "_smtp-tlsrpt.example.com". 181 Policies consist of the following directives: 183 o "v": This value MUST be equal to "TLSRPTv1". 185 o "rua": A URI specifying the endpoint to which aggregate 186 information about policy validation results should be sent (see 187 Section 4, "Reporting Schema", for more information). Two URI 188 schemes are supported: "mailto" and "https". As with DMARC 189 [RFC7489], the policy domain can specify a comma-separated list of 190 URIs. 192 o In the case of "https", reports should be submitted via POST 193 ([RFC2818]) to the specified URI. Report submitters MAY ignore 194 certificate validation errors when submitting reports via https. 196 o In the case of "mailto", reports should be submitted to the 197 specified email address ([RFC6068]). When sending failure reports 198 via SMTP, sending MTAs MUST deliver reports despite any TLS- 199 related failures. This may mean that the reports are delivered in 200 the clear. Additionally, reports sent via SMTP MUST contain a 201 valid DKIM [RFC6376] signature by the reporting domain. Reports 202 lacking such a signature MUST be ignored by the recipient. 204 The formal definition of the "_smtp-tlsrpt" TXT record, defined using 205 [RFC5234], is as follows: 207 tlsrpt-record = tlsrpt-version *WSP field-delim *WSP tlsrpt-rua 208 [field-delim [tlsrpt-extensions]] 210 field-delim = %x3B ; ";" 212 tlsrpt-version = %x76 *WSP "=" *WSP %x54 %x4C %x53 %x52 213 %x50 %x54 %x76 %x31 ; "v=TLSRPTv1" 215 tlsrpt-rua = %x72 %x75 %x61 *WSP "=" *WSP 216 tlsrpt-uri *(*WSP "," *WSP tlsrpt-uri) ; "rua=..." 218 tlsrpt-uri = URI 219 ; "URI" is imported from [@!RFC3986]; commas (ASCII 220 ; 0x2C) and exclamation points (ASCII 0x21) 221 ; MUST be encoded; the numeric portion MUST fit 222 ; within an unsigned 64-bit integer 224 tlsrpt-extensions = tlsrpt-extension *(field-delim tlsrpt-extension) 225 [field-delim] 226 ; extension fields 228 tlsrpt-extension = tlsrpt-ext-name *WSP "=" *WSP tlsrpt-ext-value 230 tlsrpt-ext-name = (ALPHA / DIGIT) *31(ALPHA / DIGIT / "_" / "-" / ".") 232 tlsrpt-ext-value = 1*(%x21-3A / %x3C / %x3E-7E) ; chars excluding 233 ; "=", ";", SP, and 234 ; control chars 236 If multiple TXT records for "_smtp-tlsrpt" are returned by the 237 resolver, records which do not begin with "v=TLSRPTv1;" are 238 discarded. If the number of resulting records is not one, senders 239 MUST assume the recipient domain does not implement TLSRPT. Parsers 240 MUST accept TXT records which are syntactically valid (i.e. valid 241 key-value pairs seprated by semi-colons) and implementing a superset 242 of this specification, in which case unknown fields SHALL be ignored. 244 3.1. Example Reporting Policy 246 3.1.1. Report using MAILTO 248 _smtp-tlsrpt.example.com. IN TXT \ 249 "v=TLSRPTv1;rua=mailto:reports@example.com" 251 3.1.2. Report using HTTPS 253 _smtp-tlsrpt.example.com. IN TXT \ 254 "v=TLSRPTv1; \ 255 rua=https://reporting.example.com/v1/tlsrpt" 257 4. Reporting Schema 259 The report is composed as a plain text file encoded in the I-JSON 260 format ([RFC7493]). 262 Aggregate reports contain the following fields: 264 o Report metadata: 266 * The organization responsible for the report 268 * Contact information for one or more responsible parties for the 269 contents of the report 271 * A unique identifier for the report 273 * The reporting date range for the report 275 o Policy, consisting of: 277 * One of the following policy types: (1) The MTA-STS policy 278 applied (as a string) (2) The DANE TLSA record applied (as a 279 string, with each RR entry of the RRset listed and separated by 280 a semicolon) (3) The literal string "no-policy-found", if 281 neither a DANE nor MTA-STS policy could be found. 283 * The domain for which the policy is applied 285 * The MX host 287 * An identifier for the policy (where applicable) 289 o Aggregate counts, comprising result type, sending MTA IP, 290 receiving MTA hostname, session count, and an optional additional 291 information field containing a URI for recipients to review 292 further information on a failure type. 294 Note that the failure types are non-exclusive; an aggregate report 295 may contain overlapping "counts" of failure types when a single send 296 attempt encountered multiple errors. 298 4.1. Report Time-frame 300 The report SHOULD cover a full day, from 0000-2400 UTC. This should 301 allow for easier correlation of failure events. To avoid a Denial of 302 Service against the system processing the reports, the reports should 303 be delivered after some delay, perhaps several hours. 305 4.2. Delivery Summary 307 4.2.1. Success Count 309 o "success-count": This indicates that the sending MTA was able to 310 successfully negotiate a policy-compliant TLS connection, and 311 serves to provide a "heartbeat" to receiving domains that 312 reporting is functional and tabulating correctly. This field 313 contains an aggregate count of successful connections for the 314 reporting system. 316 4.2.2. Failure Count 318 o "failure-count": This indicates that the sending MTA was unable to 319 successfully establish a connection with the receiving platform. 320 Section 4.3, "Result Types", will elaborate on the failed 321 negotiation attempts. This field contains an aggregate count of 322 failed connections. 324 4.3. Result Types 326 The list of result types will start with the minimal set below, and 327 is expected to grow over time based on real-world experience. The 328 initial set is: 330 4.3.1. Negotiation Failures 332 o "starttls-not-supported": This indicates that the recipient MX did 333 not support STARTTLS. 335 o "certificate-host-mismatch": This indicates that the certificate 336 presented did not adhere to the constraints specified in the MTA- 337 STS or DANE policy, e.g. if the MX does not match any identities 338 listed in the Subject Alternate Name (SAN) [RFC5280]. 340 o "certificate-expired": This indicates that the certificate has 341 expired. 343 o "certificate-not-trusted": This a label that covers multiple 344 certificate related failures that include, but not limited to 345 errors such as untrusted/unknown CAs, certificate name 346 constraints, certificate chain errors etc. When using this 347 declaration, the reporting MTA SHOULD utilize the "failure-reason" 348 to provide more information to the receiving entity. 350 o "validation-failure": This indicates a general failure for a 351 reason not matching a category above. When using this 352 declaration, the reporting MTA SHOULD utilize the "failure-reason" 353 to provide more information to the receiving entity. 355 4.3.2. Policy Failures 357 4.3.2.1. DANE-specific Policy Failures 359 o "tlsa-invalid": This indicates a validation error in the TLSA 360 record associated with a DANE policy. None of the records in the 361 RRset were found to be valid. 363 o "dnssec-invalid": This would indicate that no valid records were 364 returned from the recursive resolver. The request returned with 365 SERVFAIL for the requested TLSA record. It should be noted that 366 if the reporter's systems are having problems resolving 367 destination DNS records due to DNSSEC failures, it's possible they 368 will also be unable to resolve the TLSRPT record, therefore these 369 types of reports may be rare. 371 4.3.2.2. MTA-STS-specific Policy Failures 373 o "sts-policy-invalid": This indicates a validation error for the 374 overall MTA-STS policy. 376 o "sts-webpki-invalid": This indicates that the MTA-STS policy could 377 not be authenticated using PKIX validation. 379 4.3.3. General Failures 381 When a negotiation failure can not be categorized into one of the 382 "Negotiation Failures" stated above, the reporter SHOULD use the 383 "validation-failure" category. As TLS grows and becomes more 384 complex, new mechanisms may not be easily categorized. This allows 385 for a generic feedback category. When this category is used, the 386 reporter SHOULD also use the "failure-reason-code" to give some 387 feedback to the receiving entity. This is intended to be a short 388 text field, and the contents of the field should be an error code or 389 error text, such as "X509_V_ERR_UNHANDLED_CRITICAL_CRL_EXTENSION". 391 4.3.4. Transient Failures 393 Transient errors due to too-busy network, TCP timeouts, etc. are not 394 required to be reported. 396 4.4. JSON Report Schema 398 The JSON schema is derived from the HPKP JSON schema [RFC7469] (cf. 399 Section 3) 401 { 402 "organization-name": organization-name, 403 "date-range": { 404 "start-datetime": date-time, 405 "end-datetime": date-time 406 }, 407 "contact-info": email-address, 408 "report-id": report-id, 409 "policy": { 410 "policy-type": policy-type, 411 "policy-string": policy-string, 412 "policy-domain": domain, 413 "mx-host": mx-host-pattern 414 }, 415 "summary": { 416 "total-successful-session-count": total-successful-session-count, 417 "total-failure-session-count:" total-failure-session-count 418 } 419 "failure-details": [ 420 { 421 "result-type": result-type, 422 "sending-mta-ip": ip-address, 423 "receiving-mx-hostname": receiving-mx-hostname, 424 "receiving-mx-helo": receiving-mx-helo, 425 "failed-session-count": failed-session-count, 426 "additional-information": additional-info-uri, 427 "failure-reason-code": "failure-reason-code" 428 } 429 ] 430 } 432 JSON Report Format 434 o "organization-name": The name of the organization responsible for 435 the report. It is provided as a string. 437 o "date-time": The date-time indicates the start- and end-times for 438 the report range. It is provided as a string formatted according 439 to Section 5.6, "Internet Date/Time Format", of [RFC3339]. The 440 report should be for a full UTC day, 0000-2400. 442 o "email-address": The contact information for a responsible party 443 of the report. It is provided as a string formatted according to 444 Section 3.4.1, "Addr-Spec", of [RFC5321]. 446 o "report-id": A unique identifier for the report. Report authors 447 may use whatever scheme they prefer to generate a unique 448 identifier. It is provided as a string. 450 o "policy-type": The type of policy that was applied by the sending 451 domain. Presently, the only three valid choices are "tlsa", 452 "sts", and the literal string "no-policy-found". It is provided 453 as a string. 455 o "policy-string": The JSON string serialization ([RFC7159] section 456 7) of the policy, whether TLSA record ([RFC6698] section 2.3) or 457 MTA-STS policy. 459 o "domain": The Policy Domain is the domain against which the MTA- 460 STS or DANE policy is defined. In the case of Internationalized 461 Domain Names ([RFC5891]), the domain is the Punycode-encoded 462 A-label ([RFC3492]) and not the U-label. 464 o "mx-host-pattern": The pattern of MX hostnames from the applied 465 policy. It is provided as a string, and is interpreted in the 466 same manner as the "Checking of Wildcard Certificates" rules in 467 Section 6.4.3 of [RFC6125]. In the case of Internationalized 468 Domain Names ([RFC5891]), the domain is the Punycode-encoded 469 A-label ([RFC3492]) and not the U-label. 471 o "result-type": A value from Section 4.3, "Result Types", above. 473 o "ip-address": The IP address of the sending MTA that attempted the 474 STARTTLS connection. It is provided as a string representation of 475 an IPv4 (see below) or IPv6 ([RFC5952]) address in dot-decimal or 476 colon-hexadecimal notation. 478 o "receiving-mx-hostname": The hostname of the receiving MTA MX 479 record with which the sending MTA attempted to negotiate a 480 STARTTLS connection. 482 o "receiving-mx-helo": (optional) The HELO or EHLO string from the 483 banner announced during the reported session. 485 o "total-successful-session-count": The aggregate number (integer) 486 of successfully negotiated TLS-enabled connections to the 487 receiving site. 489 o "total-failure-session-count": The aggregate number (integer) of 490 failures to negotiate an TLS-enabled connection to the receiving 491 site. 493 o "failed-session-count": The number of (attempted) sessions that 494 match the relevant "result-type" for this section. 496 o "additional-info-uri": An optional URI [RFC3986] pointing to 497 additional information around the relevant "result-type". For 498 example, this URI might host the complete certificate chain 499 presented during an attempted STARTTLS session. 501 o "failure-reason-code": A text field to include an TLS-related 502 error code or error message. 504 For report purposes, an IPv4 Address is defined as: IPv4address = 505 dec-octet "." dec-octet "." dec-octet "." dec-octet 506 dec-octet = DIGIT ; 0-9 / %x31-39 DIGIT ; 10-99 / "1" 2DIGIT ; 507 100-199 / "2" %x30-34 DIGIT ; 200-249 / "25" %x30-35 ; 250-255 509 5. Report Delivery 511 Reports can be delivered either as an email message via SMTP or via 512 HTTP POST. 514 5.1. Report Filename 516 The filename is RECOMMENDED to be constructed using the following 517 ABNF: 519 filename = sender "!" policy-domain "!" begin-timestamp 520 "!" end-timestamp [ "!" unique-id ] "." extension 522 unique-id = 1*(ALPHA / DIGIT) 524 sender = domain ; imported from [@!RFC5321] 526 policy-domain = domain 528 begin-timestamp = 1*DIGIT 529 ; seconds since 00:00:00 UTC January 1, 1970 530 ; indicating start of the time range contained 531 ; in the report 533 end-timestamp = 1*DIGIT 534 ; seconds since 00:00:00 UTC January 1, 1970 535 ; indicating end of the time range contained 536 ; in the report 538 extension = "json" / "json.gz" 540 The extension MUST be "json" for a plain JSON file, or "json.gz" for 541 a JSON file compressed using GZIP. 543 "unique-id" allows an optional unique ID generated by the Sending MTA 544 to distinguish among multiple reports generated simultaneously by 545 different sources within the same Policy Domain. For example, this 546 is a possible filename for the gzip file of a report to the Policy 547 Domain "example.net" from the Sending MTA "mail.sender.example.com": 549 `mail.sender.example.com!example.net!1470013207!1470186007!001.json.gz` 551 5.2. Compression 553 The report SHOULD be subjected to GZIP compression for both email and 554 HTTPS transport. Declining to apply compression can cause the report 555 to be too large for a receiver to process (a commonly observed 556 receiver limit is ten megabytes); compressing the file increases the 557 chances of acceptance of the report at some compute cost. 559 5.3. Email Transport 561 The report MAY be delivered by email. To make the reports machine- 562 parsable for the receivers, we define a top-level media type 563 "multipart/report" with a new parameter "report-type="tlsrpt"". 564 Inside it, there are two parts: The first part is human readable, 565 typically "text/plain", and the second part is machine readable with 566 a new media type defined called "application/tlsrpt+json". If 567 compressed, the report should use the media type "application/ 568 tlsrpt+gzip". 570 In addition, the following two new top level message header fields 571 are defined: 573 TLS-Report-Domain: Receiver-Domain 574 TLS-Report-Submitter: Sender-Domain 576 These message headers MUST be included and should allow for easy 577 searching for all reports submitted by a report domain or a 578 particular submitter, for example in IMAP [RFC3501]: 580 "s SEARCH HEADER "TLS-Report-Domain" "example.com"" 582 It is presumed that the aggregate reporting address will be equipped 583 to process new message header fields and extract MIME parts with the 584 prescribed media type and filename, and ignore the rest. These 585 additional headers SHOULD be included in the DKIM [RFC6376] signature 586 for the message. 588 The [RFC5322].Subject field for report submissions SHOULD conform to 589 the following ABNF: 591 tlsrpt-subject = %s"Report" FWS ; "Report" 592 %s"Domain:" FWS ; "Domain:" 593 domain-name FWS ; per RFC6376 594 %s"Submitter:" FWS ; "Submitter:" 595 domain-name FWS ; per RFC6376 596 %s"Report-ID:" FWS ; "Report-ID: 597 "<" id-left "@" id-right ">" ; per RFC5322 598 [CFWS] ; per RFC5322 (as with FWS) 600 The first domain-name indicates the DNS domain name about which the 601 report was generated. The second domain-name indicates the DNS 602 domain name representing the Sending MTA generating the report. The 603 purpose of the Report-ID: portion of the field is to enable the 604 Policy Domain to identify and ignore duplicate reports that might be 605 sent by a Sending MTA. 607 For instance, this is a possible Subject field for a report to the 608 Policy Domain "example.net" from the Sending MTA 609 "mail.sender.example.com". It is line-wrapped as allowed by 610 [RFC5322]: 612 Subject: Report Domain: example.net 613 Submitter: mail.sender.example.com 614 Report-ID: <735ff.e317+bf22029@mailexample.net> 616 5.3.1. Example Report 618 From: tlsrpt@mail.sender.example.com 619 Date: Fri, May 09 2017 16:54:30 -0800 620 To: mts-sts-tlsrpt@example.net 621 Subject: Report Domain: example.net 622 Submitter: mail.sender.example.com 623 Report-ID: <735ff.e317+bf22029@example.net> 624 TLS-Report-Domain: example.net 625 TLS-Report-Submitter: mail.sender.example.com 626 MIME-Version: 1.0 627 Content-Type: multipart/report; report-type="tlsrpt"; 628 boundary="----=_NextPart_000_024E_01CC9B0A.AFE54C00" 629 Content-Language: en-us 631 This is a multipart message in MIME format. 633 ------=_NextPart_000_024E_01CC9B0A.AFE54C00 634 Content-Type: text/plain; charset="us-ascii" 635 Content-Transfer-Encoding: 7bit 637 This is an aggregate TLS report from mail.sender.example.com 639 ------=_NextPart_000_024E_01CC9B0A.AFE54C00 640 Content-Type: application/tlsrpt+gzip 641 Content-Transfer-Encoding: base64 642 Content-Disposition: attachment; 643 filename="mail.sender.example!example.com! 644 1013662812!1013749130.gz" 646 648 ------=_NextPart_000_024E_01CC9B0A.AFE54C00-- 649 ... 651 Note that, when sending failure reports via SMTP, sending MTAs MUST 652 NOT honor MTA-STS or DANE TLSA failures. 654 5.4. HTTPS Transport 656 The report MAY be delivered by POST to HTTPS. If compressed, the 657 report SHOULD use the media type "application/tlsrpt+gzip", and 658 "application/tlsrpt+json" otherwise (see section Section 6, "IANA 659 Considerations"). 661 5.5. Delivery Retry 663 In the event of a delivery failure, regardless of the delivery 664 method, a sender SHOULD attempt redelivery for up to 24hrs after the 665 initial attempt. As previously stated the reports are optional, so 666 while it is ideal to attempt redelivery, it is not required. If 667 multiple retries are attempted, ideally they would be on a 668 logarithmic scale. 670 5.6. Metadata Variances 672 As stated above, there are a variable number of ways to declare 673 information about the data therein. If it should be the case that 674 these objects were to disagree, then the report data contained within 675 the JSON body MUST be considered the authoritative source for those 676 data elements. 678 6. IANA Considerations 680 The following are the IANA considerations discussed in this document. 682 6.1. Message headers 684 Below is the Internet Assigned Numbers Authority (IANA) Permanent 685 Message Header Field registration information per [RFC3864]. 687 Header field name: TLS-Report-Domain 688 Applicable protocol: mail 689 Status: standard 690 Author/Change controller: IETF 691 Specification document(s): this one 693 Header field name: TLS-Report-Submitter 694 Applicable protocol: mail 695 Status: standard 696 Author/Change controller: IETF 697 Specification document(s): this one 699 6.2. Report Type 701 This document registers a new parameter "report-type="tlsrpt"" under 702 "multipart/report" top-level media type for use with [RFC6522]. 704 The media type suitable for use as a report-type is defined in the 705 following section. 707 6.3. application/tlsrpt+json Media Type 709 This document registers multiple media types, beginning with Table 1 710 below. 712 +-------------+----------------+-------------+-------------------+ 713 | Type | Subtype | File extn | Specification | 714 +-------------+----------------+-------------+-------------------+ 715 | application | tlsrpt+json | .json | Section 5.3 | 716 +-------------+----------------+-------------+-------------------+ 717 Table 1: SMTP TLS Reporting Media Type 719 Type name: application 721 Subtype name: tlsrpt+json 723 Required parameters: n/a 725 Optional parameters: n/a 727 Encoding considerations: Encoding considerations are identical to 728 those specified for the "application/json" media type. See 729 [RFC7493]. 731 Security considerations: Security considerations relating to SMTP TLS 732 Reporting are discussed in Section 7. 734 Interoperability considerations: This document specifies format of 735 conforming messages and the interpretation thereof. 737 Published specification: Section 5.3 of this document. 739 Applications that use this media type: Mail User Agents (MUA) and 740 Mail Transfer Agents. 742 Additional information: 744 Magic number(s): n/a 746 File extension(s): ".json" 748 Macintosh file type code(s): n/a 750 Person & email address to contact for further information: See 751 Authors' Addresses section. 753 Intended usage: COMMON 754 Restrictions on usage: n/a 756 Author: See Authors' Addresses section. 758 Change controller: Internet Engineering Task Force 759 (mailto:iesg@ietf.org). 761 6.4. application/tlsrpt+gzip Media Type 763 +-------------+----------------+-------------+-------------------+ 764 | Type | Subtype | File extn | Specification | 765 +-------------+----------------+-------------+-------------------+ 766 | application | tlsrpt+gzip | .gz | Section 5.3 | 767 +-------------+----------------+-------------+-------------------+ 768 Table 2: SMTP TLS Reporting Media Type 770 Type name: application 772 Subtype name: tlsrpt+gzip 774 Required parameters: n/a 776 Optional parameters: n/a 778 Encoding considerations: Binary 780 Security considerations: Security considerations relating to SMTP TLS 781 Reporting are discussed in Section 7. 783 Interoperability considerations: This document specifies format of 784 conforming messages and the interpretation thereof. 786 Published specification: Section 5.3 of this document. 788 Applications that use this media type: Mail User Agents (MUA) and 789 Mail Transfer Agents. 791 Additional information: 793 Magic number(s): n/a 795 File extension(s): ".gz" 797 Macintosh file type code(s): n/a 799 Person & email address to contact for further information: See 800 Authors' Addresses section. 802 Intended usage: COMMON 804 Restrictions on usage: n/a 806 Author: See Authors' Addresses section. 808 Change controller: Internet Engineering Task Force 809 (mailto:iesg@ietf.org). 811 6.5. STARTTLS Validation Result Types 813 This document creates a new registry, "STARTTLS Validation Result 814 Types". The initial entries in the registry are: 816 +-------------------------------+ 817 | Result Type | 818 +-------------------------------+ 819 | "starttls-not-supported" | 820 | "certificate-host-mismatch" | 821 | "certificate-expired" | 822 | "tlsa-invalid" | 823 | "dnssec-invalid" | 824 | "sts-policy-invalid" | 825 | "sts-webpki-invalid" | 826 | "validation-failure" | 827 +-------------------------------+ 829 The above entries are described in section Section 4.3, "Result 830 Types." New result types can be added to this registry using "Expert 831 Review" IANA registration policy. 833 7. Security Considerations 835 SMTP TLS Reporting provides transparency into misconfigurations or 836 attempts to intercept or tamper with mail between hosts who support 837 STARTTLS. There are several security risks presented by the 838 existence of this reporting channel: 840 o Flooding of the Aggregate report URI (rua) endpoint: An attacker 841 could flood the endpoint with excessive reporting traffic and 842 prevent the receiving domain from accepting additional reports. 843 This type of Denial-of-Service attack would limit visibility into 844 STARTTLS failures, leaving the receiving domain blind to an 845 ongoing attack. 847 o Untrusted content: An attacker could inject malicious code into 848 the report, opening a vulnerability in the receiving domain. 850 Implementers are advised to take precautions against evaluating 851 the contents of the report. 853 o Report snooping: An attacker could create a bogus TLSRPT record to 854 receive statistics about a domain the attacker does not own. 855 Since an attacker able to poison DNS is already able to receive 856 counts of SMTP connections (and, absent DANE or MTA-STS policies, 857 actual SMTP message payloads), this does not present a significant 858 new vulnerability. 860 o Reports as DDoS: TLSRPT allows specifying destinations for the 861 reports that are outside the authority of the Policy Domain, which 862 allows domains to delegate processing of reports to a partner 863 organization. However, an attacker who controls the Policy Domain 864 DNS could also use this mechanism to direct the reports to an 865 unwitting victim, flooding that victim with excessive reports. 866 DMARC [RFC7489] defines a solution for verifying delegation to 867 avoid such attacks; the need for this is greater with DMARC, 868 however, because DMARC allows an attacker to trigger reports to a 869 target from an innocent third party by sending that third party 870 mail (which triggers a report from the third party to the target). 871 In the case of TLSRPT, the attacker would have to induce the third 872 party to send the attacker mail in order to trigger reports from 873 the third party to the victim; this reduces the risk of such an 874 attack and the need for a verification mechanism. 876 8. Appendix 1: Example Reporting Policy 878 8.1. Report using MAILTO 880 _smtp-tlsrpt.mail.example.com. IN TXT \ 881 "v=TLSRPTv1;rua=mailto:reports@example.com" 883 8.2. Report using HTTPS 885 _smtp-tlsrpt.mail.example.com. IN TXT \ 886 "v=TLSRPTv1; \ 887 rua=https://reporting.example.com/v1/tlsrpt" 889 9. Appendix 2: Example JSON Report 890 { 891 "organization-name": "Company-X", 892 "date-range": { 893 "start-datetime": "2016-04-01T00:00:00Z", 894 "end-datetime": "2016-04-01T23:59:59Z" 895 }, 896 "contact-info": "sts-reporting@company-x.com", 897 "report-id": "5065427c-23d3-47ca-b6e0-946ea0e8c4be", 898 "policy": { 899 "policy-type": "sts", 900 "policy-string": "{ \"version\": \"STSv1\",\"mode\": \"report\", \"mx\": [\".mail.company-y.com\"], \"max_age\": 86400 }", 901 "policy-domain": "company-y.com", 902 "mx-host": ".mail.company-y.com" 903 }, 904 "summary": { 905 "total-successful-session-count": 5326, 906 "total-failure-session-count": 303 907 }, 908 "failure-details": [{ 909 "result-type": "certificate-expired", 910 "sending-mta-ip": "98.136.216.25", 911 "receiving-mx-hostname": "mx1.mail.company-y.com", 912 "failed-session-count": 100 913 }, { 914 "result-type": "starttls-not-supported", 915 "sending-mta-ip": "98.22.33.99", 916 "receiving-mx-hostname": "mx2.mail.company-y.com", 917 "failed-session-count": 200, 918 "additional-information": "hxxps://reports.company-x.com/ 919 report_info?id=5065427c-23d3#StarttlsNotSupported" 920 }, { 921 "result-type": "validation-failure", 922 "sending-mta-ip": "47.97.15.2", 923 "receiving-mx-hostname": "mx-backup.mail.company-y.com", 924 "failed-session-count": 3, 925 "failure-error-code": "X509_V_ERR_PROXY_PATH_LENGTH_EXCEEDED" 926 }] 927 } 929 Figure: Example JSON report for a messages from Company-X to 930 Company-Y, where 100 sessions were attempted to Company Y servers 931 with an expired certificate and 200 sessions were attempted to 932 Company Y servers that did not successfully respond to the "STARTTLS" 933 command. Additionally 3 sessions failed due to 934 "X509_V_ERR_PROXY_PATH_LENGTH_EXCEEDED". 936 10. References 938 10.1. Normative References 940 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 941 Requirement Levels", BCP 14, RFC 2119, DOI 10.17487/ 942 RFC2119, March 1997, 943 . 945 [RFC2818] Rescorla, E., "HTTP Over TLS", RFC 2818, DOI 10.17487/ 946 RFC2818, May 2000, 947 . 949 [RFC3339] Klyne, G. and C. Newman, "Date and Time on the Internet: 950 Timestamps", RFC 3339, DOI 10.17487/RFC3339, July 2002, 951 . 953 [RFC3492] Costello, A., "Punycode: A Bootstring encoding of Unicode 954 for Internationalized Domain Names in Applications 955 (IDNA)", RFC 3492, DOI 10.17487/RFC3492, March 2003, 956 . 958 [RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform 959 Resource Identifier (URI): Generic Syntax", STD 66, RFC 960 3986, DOI 10.17487/RFC3986, January 2005, 961 . 963 [RFC5234] Crocker, D., Ed. and P. Overell, "Augmented BNF for Syntax 964 Specifications: ABNF", STD 68, RFC 5234, DOI 10.17487/ 965 RFC5234, January 2008, 966 . 968 [RFC5321] Klensin, J., "Simple Mail Transfer Protocol", RFC 5321, 969 DOI 10.17487/RFC5321, October 2008, 970 . 972 [RFC5322] Resnick, P., Ed., "Internet Message Format", RFC 5322, DOI 973 10.17487/RFC5322, October 2008, 974 . 976 [RFC5891] Klensin, J., "Internationalized Domain Names in 977 Applications (IDNA): Protocol", RFC 5891, DOI 10.17487/ 978 RFC5891, August 2010, 979 . 981 [RFC5952] Kawamura, S. and M. Kawashima, "A Recommendation for IPv6 982 Address Text Representation", RFC 5952, DOI 10.17487/ 983 RFC5952, August 2010, 984 . 986 [RFC6068] Duerst, M., Masinter, L., and J. Zawinski, "The 'mailto' 987 URI Scheme", RFC 6068, DOI 10.17487/RFC6068, October 2010, 988 . 990 [RFC6125] Saint-Andre, P. and J. Hodges, "Representation and 991 Verification of Domain-Based Application Service Identity 992 within Internet Public Key Infrastructure Using X.509 993 (PKIX) Certificates in the Context of Transport Layer 994 Security (TLS)", RFC 6125, DOI 10.17487/RFC6125, March 995 2011, . 997 [RFC6376] Crocker, D., Ed., Hansen, T., Ed., and M. Kucherawy, Ed., 998 "DomainKeys Identified Mail (DKIM) Signatures", STD 76, 999 RFC 6376, DOI 10.17487/RFC6376, September 2011, 1000 . 1002 [RFC6522] Kucherawy, M., Ed., "The Multipart/Report Media Type for 1003 the Reporting of Mail System Administrative Messages", STD 1004 73, RFC 6522, DOI 10.17487/RFC6522, January 2012, 1005 . 1007 [RFC6698] Hoffman, P. and J. Schlyter, "The DNS-Based Authentication 1008 of Named Entities (DANE) Transport Layer Security (TLS) 1009 Protocol: TLSA", RFC 6698, DOI 10.17487/RFC6698, August 1010 2012, . 1012 [RFC7159] Bray, T., Ed., "The JavaScript Object Notation (JSON) Data 1013 Interchange Format", RFC 7159, DOI 10.17487/RFC7159, March 1014 2014, . 1016 [RFC7493] Bray, T., Ed., "The I-JSON Message Format", RFC 7493, DOI 1017 10.17487/RFC7493, March 2015, 1018 . 1020 10.2. Informative References 1022 [RFC3207] Hoffman, P., "SMTP Service Extension for Secure SMTP over 1023 Transport Layer Security", RFC 3207, DOI 10.17487/RFC3207, 1024 February 2002, . 1026 [RFC3501] Crispin, M., "INTERNET MESSAGE ACCESS PROTOCOL - VERSION 1027 4rev1", RFC 3501, DOI 10.17487/RFC3501, March 2003, 1028 . 1030 [RFC3864] Klyne, G., Nottingham, M., and J. Mogul, "Registration 1031 Procedures for Message Header Fields", BCP 90, RFC 3864, 1032 DOI 10.17487/RFC3864, September 2004, 1033 . 1035 [RFC7435] Dukhovni, V., "Opportunistic Security: Some Protection 1036 Most of the Time", RFC 7435, DOI 10.17487/RFC7435, 1037 December 2014, . 1039 [RFC7469] Evans, C., Palmer, C., and R. Sleevi, "Public Key Pinning 1040 Extension for HTTP", RFC 7469, DOI 10.17487/RFC7469, April 1041 2015, . 1043 [RFC7489] Kucherawy, M., Ed. and E. Zwicky, Ed., "Domain-based 1044 Message Authentication, Reporting, and Conformance 1045 (DMARC)", RFC 7489, DOI 10.17487/RFC7489, March 2015, 1046 . 1048 Authors' Addresses 1050 Daniel Margolis 1051 Google, Inc 1053 Email: dmargolis (at) google.com 1055 Alexander Brotman 1056 Comcast, Inc 1058 Email: alex_brotman (at) comcast.com 1060 Binu Ramakrishnan 1061 Yahoo!, Inc 1063 Email: rbinu (at) yahoo-inc (dot com) 1065 Janet Jones 1066 Microsoft, Inc 1068 Email: janet.jones (at) microsoft (dot com) 1070 Mark Risher 1071 Google, Inc 1073 Email: risher (at) google (dot com)