idnits 2.17.1 draft-ietf-uta-smtp-tlsrpt-15.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 : ---------------------------------------------------------------------------- No issues found here. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (February 19, 2018) is 2251 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: 'CFWS' is mentioned on line 643, but not defined == Outdated reference: A later version (-21) exists of draft-ietf-uta-mta-sts-14 ** Obsolete normative reference: RFC 6125 (Obsoleted by RFC 9525) ** Obsolete normative reference: RFC 7231 (Obsoleted by RFC 9110) -- Obsolete informational reference (is this intentional?): RFC 3501 (Obsoleted by RFC 9051) Summary: 2 errors (**), 0 flaws (~~), 3 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: August 23, 2018 Comcast, Inc 6 B. Ramakrishnan 7 Yahoo!, Inc 8 J. Jones 9 Microsoft, Inc 10 M. Risher 11 Google, Inc 12 February 19, 2018 14 SMTP TLS Reporting 15 draft-ietf-uta-smtp-tlsrpt-15 17 Abstract 19 A number of protocols exist for establishing encrypted channels 20 between SMTP Mail Transfer Agents, including STARTTLS, DANE TLSA, and 21 MTA-STS. These protocols can fail due to misconfiguration or active 22 attack, leading to undelivered messages or delivery over unencrypted 23 or unauthenticated channels. This document describes a reporting 24 mechanism and format by which sending systems can share statistics 25 and specific information about potential failures with recipient 26 domains. Recipient domains can then use this information to both 27 detect potential attackers and diagnose unintentional 28 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 August 23, 2018. 47 Copyright Notice 49 Copyright (c) 2018 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 . . . . . . . . . . . . . . . . . . . . . . 8 77 4.3.1. Negotiation Failures . . . . . . . . . . . . . . . . 8 78 4.3.2. Policy Failures . . . . . . . . . . . . . . . . . . . 8 79 4.3.3. General Failures . . . . . . . . . . . . . . . . . . 9 80 4.3.4. Transient Failures . . . . . . . . . . . . . . . . . 9 81 4.4. JSON Report Schema . . . . . . . . . . . . . . . . . . . 9 82 5. Report Delivery . . . . . . . . . . . . . . . . . . . . . . . 12 83 5.1. Report Filename . . . . . . . . . . . . . . . . . . . . . 13 84 5.2. Compression . . . . . . . . . . . . . . . . . . . . . . . 13 85 5.3. Email Transport . . . . . . . . . . . . . . . . . . . . . 14 86 5.3.1. Example Report . . . . . . . . . . . . . . . . . . . 15 87 5.4. HTTPS Transport . . . . . . . . . . . . . . . . . . . . . 16 88 5.5. Delivery Retry . . . . . . . . . . . . . . . . . . . . . 16 89 5.6. Metadata Variances . . . . . . . . . . . . . . . . . . . 16 90 6. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 16 91 6.1. Message headers . . . . . . . . . . . . . . . . . . . . . 16 92 6.2. Report Type . . . . . . . . . . . . . . . . . . . . . . . 17 93 6.3. application/tlsrpt+json Media Type . . . . . . . . . . . 17 94 6.4. application/tlsrpt+gzip Media Type . . . . . . . . . . . 18 95 6.5. STARTTLS Validation Result Types . . . . . . . . . . . . 19 96 7. Security Considerations . . . . . . . . . . . . . . . . . . . 20 97 8. References . . . . . . . . . . . . . . . . . . . . . . . . . 21 98 8.1. Normative References . . . . . . . . . . . . . . . . . . 21 99 8.2. Informative References . . . . . . . . . . . . . . . . . 23 100 Appendix A. Example Reporting Policy . . . . . . . . . . . . . . 24 101 A.1. Report using MAILTO . . . . . . . . . . . . . . . . . . . 24 102 A.2. Report using HTTPS . . . . . . . . . . . . . . . . . . . 24 103 Appendix B. Example JSON Report . . . . . . . . . . . . . . . . 24 104 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 26 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 [I-D.ietf-uta-mta-sts] or DANE [RFC6698] to publish additional 124 encryption and authentication requirements; this document defines a 125 mechanism for sending domains that are compatible with MTA-STS or 126 DANE to share 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 [I-D.ietf-uta-mta-sts] policy validation errors, and a 131 standard TXT record that recipient domains can use to indicate where 132 reports in this format should be sent. 134 This document is intended as a companion to the specification for 135 SMTP MTA Strict Transport Security [I-D.ietf-uta-mta-sts]. 137 1.1. Terminology 139 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 140 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" 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 [I-D.ietf-uta-mta-sts]. 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 [I-D.ietf-uta-mta-sts]. 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 [I-D.ietf-uta-mta-sts]. 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 ([RFC7231]) 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 and SHOULD NOT include this SMTP session in the 200 next report. This may mean that the reports are delivered in the 201 clear. Additionally, reports sent via SMTP MUST contain a valid 202 DKIM [RFC6376] signature by the reporting domain. Reports lacking 203 such a signature MUST be ignored by the recipient. DKIM 204 signatures must not use the "l=" attribute to limit the body 205 length used in the signature. 207 The formal definition of the "_smtp-tlsrpt" TXT record, defined using 208 [RFC5234] & [RFC7405], is as follows: 210 tlsrpt-record = tlsrpt-version 1*(field-delim tlsrpt-field) 211 [field-delim] 213 field-delim = *WSP ";" *WSP 215 tlsrpt-field = tlsrpt-rua / ; Note that the 216 tlsrpt-extension ; tlsrpt-rua record is 217 ; required. 219 tlsrpt-version = %s"v=TLSRPTv1" 221 tlsrpt-rua = %s"rua=" 222 tlsrpt-uri *(*WSP "," *WSP tlsrpt-uri) 224 tlsrpt-uri = URI 225 ; "URI" is imported from [RFC3986]; 226 ; commas (ASCII 0x2C) and exclamation 227 ; points (ASCII 0x21) MUST be encoded 229 tlsrpt-extension = tlsrpt-ext-name "=" tlsrpt-ext-value 231 tlsrpt-ext-name = (ALPHA / DIGIT) *31(ALPHA / 232 DIGIT / "_" / "-" / ".") 234 tlsrpt-ext-value = 1*(%x21-3A / %x3C / %x3E-7E) 235 ; chars excluding "=", ";", SP, and control 236 ; chars 238 If multiple TXT records for "_smtp-tlsrpt" are returned by the 239 resolver, records which do not begin with "v=TLSRPTv1;" are 240 discarded. If the number of resulting records is not one, senders 241 MUST assume the recipient domain does not implement TLSRPT. If the 242 resulting TXT record contains multiple strings, then the record MUST 243 be treated as if those strings are concatenated together without 244 adding spaces. 246 Parsers MUST accept TXT records which are syntactically valid (i.e. 247 valid key-value pairs separated by semi-colons) and implementing a 248 superset of this specification, in which case unknown fields SHALL be 249 ignored. 251 3.1. Example Reporting Policy 253 3.1.1. Report using MAILTO 255 _smtp-tlsrpt.example.com. IN TXT \ 256 "v=TLSRPTv1;rua=mailto:reports@example.com" 258 3.1.2. Report using HTTPS 260 _smtp-tlsrpt.example.com. IN TXT \ 261 "v=TLSRPTv1; \ 262 rua=https://reporting.example.com/v1/tlsrpt" 264 4. Reporting Schema 266 The report is composed as a plain text file encoded in the I-JSON 267 format ([RFC7493]). 269 Aggregate reports contain the following fields: 271 o Report metadata: 273 * The organization responsible for the report 275 * Contact information for one or more responsible parties for the 276 contents of the report 278 * A unique identifier for the report 280 * The reporting date range for the report 282 o Policy, consisting of: 284 * One of the following policy types: (1) The MTA-STS policy 285 applied (as a string) (2) The DANE TLSA record applied (as a 286 string, with each RR entry of the RRset listed and separated by 287 a semicolon) (3) The literal string "no-policy-found", if 288 neither a DANE nor MTA-STS policy could be found. 290 * The domain for which the policy is applied 292 * The MX host 294 * An identifier for the policy (where applicable) 296 o Aggregate counts, comprising result type, sending MTA IP, 297 receiving MTA hostname, session count, and an optional additional 298 information field containing a URI for recipients to review 299 further information on a failure type. 301 Note that the failure types are non-exclusive; an aggregate report 302 may contain overlapping "counts" of failure types when a single send 303 attempt encountered multiple errors. Reporters may report multiple 304 applied policies (for example, an MTA-STS policy and a DANE TLSA 305 record for the same domain and MX); even in the case where only a 306 single policy was applied, the "policies" field of the report body 307 MUST be an array and not a singular value. 309 4.1. Report Time-frame 311 The report SHOULD cover a full day, from 0000-2400 UTC. This should 312 allow for easier correlation of failure events. To avoid a Denial of 313 Service against the system processing the reports, the reports should 314 be delivered after some delay, perhaps several hours. 316 4.2. Delivery Summary 318 4.2.1. Success Count 320 o "success-count": This indicates that the sending MTA was able to 321 successfully negotiate a policy-compliant TLS connection, and 322 serves to provide a "heartbeat" to receiving domains that 323 reporting is functional and tabulating correctly. This field 324 contains an aggregate count of successful connections for the 325 reporting system. 327 4.2.2. Failure Count 329 o "failure-count": This indicates that the sending MTA was unable to 330 successfully establish a connection with the receiving platform. 331 Section 4.3, "Result Types", will elaborate on the failed 332 negotiation attempts. This field contains an aggregate count of 333 failed connections. 335 4.3. Result Types 337 The list of result types will start with the minimal set below, and 338 is expected to grow over time based on real-world experience. The 339 initial set is: 341 4.3.1. Negotiation Failures 343 o "starttls-not-supported": This indicates that the recipient MX did 344 not support STARTTLS. 346 o "certificate-host-mismatch": This indicates that the certificate 347 presented did not adhere to the constraints specified in the MTA- 348 STS or DANE policy, e.g. if the MX does not match any identities 349 listed in the Subject Alternate Name (SAN) [RFC5280]. 351 o "certificate-expired": This indicates that the certificate has 352 expired. 354 o "certificate-not-trusted": This a label that covers multiple 355 certificate related failures that include, but not limited to 356 errors such as untrusted/unknown CAs, certificate name 357 constraints, certificate chain errors etc. When using this 358 declaration, the reporting MTA SHOULD utilize the "failure-reason" 359 to provide more information to the receiving entity. 361 o "validation-failure": This indicates a general failure for a 362 reason not matching a category above. When using this 363 declaration, the reporting MTA SHOULD utilize the "failure-reason" 364 to provide more information to the receiving entity. 366 4.3.2. Policy Failures 368 4.3.2.1. DANE-specific Policy Failures 370 o "tlsa-invalid": This indicates a validation error in the TLSA 371 record associated with a DANE policy. None of the records in the 372 RRset were found to be valid. 374 o "dnssec-invalid": This would indicate that no valid records were 375 returned from the recursive resolver. The request returned with 376 SERVFAIL for the requested TLSA record. 378 o "dane-required": This indicates that the sending system is 379 configured to require DANE TLSA records for all the MX hosts of 380 the destination domain, but no DNSSEC-validated TLSA records were 381 present for the MX host that is the subject of the report. 382 Mandatory DANE for SMTP is described in section 6 of [RFC7672]. 384 Such policies may be created by mutual agreement between two 385 organizations that frequently exchange sensitive content via 386 email. 388 4.3.2.2. MTA-STS-specific Policy Failures 390 o "sts-policy-invalid": This indicates a validation error for the 391 overall MTA-STS policy. 393 o "sts-webpki-invalid": This indicates that the MTA-STS policy could 394 not be authenticated using PKIX validation. 396 4.3.3. General Failures 398 When a negotiation failure can not be categorized into one of the 399 "Negotiation Failures" stated above, the reporter SHOULD use the 400 "validation-failure" category. As TLS grows and becomes more 401 complex, new mechanisms may not be easily categorized. This allows 402 for a generic feedback category. When this category is used, the 403 reporter SHOULD also use the "failure-reason-code" to give some 404 feedback to the receiving entity. This is intended to be a short 405 text field, and the contents of the field should be an error code or 406 error text, such as "X509_V_ERR_UNHANDLED_CRITICAL_CRL_EXTENSION". 408 4.3.4. Transient Failures 410 Transient errors due to too-busy network, TCP timeouts, etc. are not 411 required to be reported. 413 4.4. JSON Report Schema 415 The JSON schema is derived from the HPKP JSON schema [RFC7469] (cf. 416 Section 3) 418 { 419 "organization-name": organization-name, 420 "date-range": { 421 "start-datetime": date-time, 422 "end-datetime": date-time 423 }, 424 "contact-info": email-address, 425 "report-id": report-id, 426 "policies": [{ 427 "policy": { 428 "policy-type": policy-type, 429 "policy-string": policy-string, 430 "policy-domain": domain, 431 "mx-host": mx-host-pattern 432 }, 433 "summary": { 434 "total-successful-session-count": total-successful-session-count, 435 "total-failure-session-count": total-failure-session-count 436 }, 437 "failure-details": [ 438 { 439 "result-type": result-type, 440 "sending-mta-ip": ip-address, 441 "receiving-mx-hostname": receiving-mx-hostname, 442 "receiving-mx-helo": receiving-mx-helo, 443 "receiving-ip": receiving-ip, 444 "failed-session-count": failed-session-count, 445 "additional-information": additional-info-uri, 446 "failure-reason-code": failure-reason-code 447 } 448 ] 449 } 450 ] 451 } 453 JSON Report Format 455 o "organization-name": The name of the organization responsible for 456 the report. It is provided as a string. 458 o "date-time": The date-time indicates the start- and end-times for 459 the report range. It is provided as a string formatted according 460 to Section 5.6, "Internet Date/Time Format", of [RFC3339]. The 461 report should be for a full UTC day, 0000-2400. 463 o "email-address": The contact information for a responsible party 464 of the report. It is provided as a string formatted according to 465 Section 3.4.1, "Addr-Spec", of [RFC5321]. 467 o "report-id": A unique identifier for the report. Report authors 468 may use whatever scheme they prefer to generate a unique 469 identifier. It is provided as a string. 471 o "policy-type": The type of policy that was applied by the sending 472 domain. Presently, the only three valid choices are "tlsa", 473 "sts", and the literal string "no-policy-found". It is provided 474 as a string. 476 o "policy-string": A string representation of the policy, whether 477 TLSA record ([RFC6698] section 2.3) or MTA-STS policy. Examples: 479 For DANE TLSA policies, a JSON array array of strings each 480 representing the RDATA of a single TLSA resource record as a space- 481 separated list of its four TLSA fields (in RFC6698 Section 2.2) 482 presentation form with no internal spaces or grouping parentheses: 484 ["3 0 1 485 1F850A337E6DB9C609C522D136A475638CC43E1ED424F8EEC8513D747D1D085D", 486 3 0 1 487 12350A337E6DB9C6123522D136A475638CC43E1ED424F8EEC8513D747D1D1234"] 489 MTA-STS (array of JSON strings): 491 ["version: STSv1","mode: report","mx: mx1.example.com","mx: 492 mx2.example.com","mx: mx.backup-example.com","max_age: 12345678"] 494 o "domain": The Policy Domain is the domain against which the MTA- 495 STS or DANE policy is defined. In the case of Internationalized 496 Domain Names ([RFC5891]), the domain MUST consist of the Punycode- 497 encoded A-labels ([RFC3492]) and not the U-labels. 499 o "mx-host-pattern": The pattern of MX hostnames from the applied 500 policy. It is provided as a string, and is interpreted in the 501 same manner as the "Checking of Wildcard Certificates" rules in 502 Section 6.4.3 of [RFC6125]. In the case of Internationalized 503 Domain Names ([RFC5891]), the domain MUST consist of the Punycode- 504 encoded A-labels ([RFC3492]) and not the U-labels. 506 o "result-type": A value from Section 4.3, "Result Types", above. 508 o "ip-address": The IP address of the sending MTA that attempted the 509 STARTTLS connection. It is provided as a string representation of 510 an IPv4 (see below) or IPv6 ([RFC5952]) address in dot-decimal or 511 colon-hexadecimal notation. 513 o "receiving-mx-hostname": The hostname of the receiving MTA MX 514 record with which the sending MTA attempted to negotiate a 515 STARTTLS connection. 517 o "receiving-mx-helo": (optional) The HELO or EHLO string from the 518 banner announced during the reported session. 520 o "receiving-ip": The destination IP address that was using when 521 creating the outbound session. It is provided as a string 522 representation of an IPv4 (see below) or IPv6 ([RFC5952]) address 523 in dot-decimal or colon-hexadecimal notation. 525 o "total-successful-session-count": The aggregate number (integer) 526 of successfully negotiated TLS-enabled connections to the 527 receiving site. 529 o "total-failure-session-count": The aggregate number (integer) of 530 failures to negotiate a TLS-enabled connection to the receiving 531 site. 533 o "failed-session-count": The number of (attempted) sessions that 534 match the relevant "result-type" for this section. 536 o "additional-info-uri": An optional URI [RFC3986] pointing to 537 additional information around the relevant "result-type". For 538 example, this URI might host the complete certificate chain 539 presented during an attempted STARTTLS session. 541 o "failure-reason-code": A text field to include a TLS-related error 542 code or error message. 544 For report purposes, an IPv4 Address is defined as: IPv4address = 545 dec-octet "." dec-octet "." dec-octet "." dec-octet 546 dec-octet = DIGIT ; 0-9 / %x31-39 DIGIT ; 10-99 / "1" 2DIGIT ; 547 100-199 / "2" %x30-34 DIGIT ; 200-249 / "25" %x30-35 ; 250-255 549 5. Report Delivery 551 Reports can be delivered either as an email message via SMTP or via 552 HTTP POST. 554 5.1. Report Filename 556 The filename is RECOMMENDED to be constructed using the following 557 ABNF: 559 filename = sender "!" policy-domain "!" begin-timestamp 560 "!" end-timestamp [ "!" unique-id ] "." extension 562 unique-id = 1*(ALPHA / DIGIT) 564 sender = domain ; From the [RFC5321] that is used 565 ; as the domain for the `contact-info` 566 ; address in the report body 568 policy-domain = domain 570 begin-timestamp = 1*DIGIT 571 ; seconds since 00:00:00 UTC January 1, 1970 572 ; indicating start of the time range contained 573 ; in the report 575 end-timestamp = 1*DIGIT 576 ; seconds since 00:00:00 UTC January 1, 1970 577 ; indicating end of the time range contained 578 ; in the report 580 extension = "json" / "json.gz" 582 The extension MUST be "json" for a plain JSON file, or "json.gz" for 583 a JSON file compressed using GZIP. 585 "unique-id" allows an optional unique ID generated by the Sending MTA 586 to distinguish among multiple reports generated simultaneously by 587 different sources within the same Policy Domain. For example, this 588 is a possible filename for a compressed report to the Policy Domain 589 "example.net" from the Sending MTA "mail.sndr.example.com": 591 "mail.sndr.example.com!example.net!1470013207!1470186007!001.json.gz" 593 5.2. Compression 595 The report SHOULD be subjected to GZIP compression for both email and 596 HTTPS transport. Declining to apply compression can cause the report 597 to be too large for a receiver to process (a commonly observed 598 receiver limit is ten megabytes); compressing the file increases the 599 chances of acceptance of the report at some compute cost. 601 5.3. Email Transport 603 The report MAY be delivered by email. To make the reports machine- 604 parsable for the receivers, we define a top-level media type 605 "multipart/report" with a new parameter "report-type="tlsrpt"". 606 Inside it, there are two parts: The first part is human readable, 607 typically "text/plain", and the second part is machine readable with 608 a new media type defined called "application/tlsrpt+json". If 609 compressed, the report should use the media type "application/ 610 tlsrpt+gzip". 612 In addition, the following two new top level message header fields 613 are defined: 615 "TLS-Report-Domain: Receiver-Domain" 617 "TLS-Report-Submitter: Sender-Domain" 619 The "TLS-Report-Submitter" value MUST match the value found in the 620 filename and the [RFC5321] domain from the "contact-info" from the 621 report body. These message headers MUST be included and should allow 622 for easy searching for all reports submitted by a report domain or a 623 particular submitter, for example in IMAP [RFC3501]: 625 "s SEARCH HEADER "TLS-Report-Domain" "example.com"" 627 It is presumed that the aggregate reporting address will be equipped 628 to process new message header fields and extract MIME parts with the 629 prescribed media type and filename, and ignore the rest. These 630 additional headers SHOULD be included in the DKIM [RFC6376] signature 631 for the message. 633 The [RFC5322].Subject field for report submissions SHOULD conform to 634 the following ABNF: 636 tlsrpt-subject = %s"Report" FWS ; "Report" 637 %s"Domain:" FWS ; "Domain:" 638 domain-name FWS ; per [RFC6376] 639 %s"Submitter:" FWS ; "Submitter:" 640 domain-name FWS ; per [RFC6376] 641 %s"Report-ID:" FWS ; "Report-ID: 642 "<" id-left "@" id-right ">" ; per [RFC5322] 643 [CFWS] ; per [RFC5322] 644 ; (as with FWS) 646 The first domain-name indicates the DNS domain name about which the 647 report was generated. The second domain-name indicates the DNS 648 domain name representing the Sending MTA generating the report. The 649 purpose of the Report-ID: portion of the field is to enable the 650 Policy Domain to identify and ignore duplicate reports that might be 651 sent by a Sending MTA. 653 For instance, this is a possible Subject field for a report to the 654 Policy Domain "example.net" from the Sending MTA 655 "mail.sender.example.com". It is line-wrapped as allowed by 656 [RFC5322]: 658 Subject: Report Domain: example.net 659 Submitter: mail.sender.example.com 660 Report-ID: <735ff.e317+bf22029@mailexample.net> 662 5.3.1. Example Report 664 From: tlsrpt@mail.sender.example.com 665 Date: Fri, May 09 2017 16:54:30 -0800 666 To: mts-sts-tlsrpt@example.net 667 Subject: Report Domain: example.net 668 Submitter: mail.sender.example.com 669 Report-ID: <735ff.e317+bf22029@example.net> 670 TLS-Report-Domain: example.net 671 TLS-Report-Submitter: mail.sender.example.com 672 MIME-Version: 1.0 673 Content-Type: multipart/report; report-type="tlsrpt"; 674 boundary="----=_NextPart_000_024E_01CC9B0A.AFE54C00" 675 Content-Language: en-us 677 This is a multipart message in MIME format. 679 ------=_NextPart_000_024E_01CC9B0A.AFE54C00 680 Content-Type: text/plain; charset="us-ascii" 681 Content-Transfer-Encoding: 7bit 683 This is an aggregate TLS report from mail.sender.example.com 685 ------=_NextPart_000_024E_01CC9B0A.AFE54C00 686 Content-Type: application/tlsrpt+gzip 687 Content-Transfer-Encoding: base64 688 Content-Disposition: attachment; 689 filename="mail.sender.example!example.com! 690 1013662812!1013749130.json.gz" 692 694 ------=_NextPart_000_024E_01CC9B0A.AFE54C00-- 695 ... 697 Note that, when sending failure reports via SMTP, sending MTAs MUST 698 NOT honor MTA-STS or DANE TLSA failures. 700 5.4. HTTPS Transport 702 The report MAY be delivered by POST to HTTPS. If compressed, the 703 report SHOULD use the media type "application/tlsrpt+gzip", and 704 "application/tlsrpt+json" otherwise (see section Section 6, "IANA 705 Considerations"). 707 A reporting entity SHOULD expect a "successful" response from the 708 accepting HTTPS server, typically a 200 or 201 HTTP code [RFC7231]. 709 Other codes could indicate a delivery failure, and may be retried as 710 per local policy. The receiving system is not expected to process 711 reports at receipt time, and MAY store them for processing at a later 712 time. 714 Alternately, if a receiving system offers "Accept-Encoding" value of 715 "gzip", the sending system MAY use "Content-Encoding: gzip" as an 716 HTTP header as appropriate. This can be used in place of delivering 717 a compressed file as the payload. 719 5.5. Delivery Retry 721 In the event of a delivery failure, regardless of the delivery 722 method, a sender SHOULD attempt redelivery for up to 24hrs after the 723 initial attempt. As previously stated the reports are optional, so 724 while it is ideal to attempt redelivery, it is not required. If 725 multiple retries are attempted, ideally they SHOULD be done with 726 exponential backoff. 728 5.6. Metadata Variances 730 As stated above, there are a variable number of ways to declare 731 information about the data therein. If any of items declared via 732 subject or filename disagree with the report, the report MUST be 733 considered the authoritative source. 735 6. IANA Considerations 737 The following are the IANA considerations discussed in this document. 739 6.1. Message headers 741 Below is the Internet Assigned Numbers Authority (IANA) Permanent 742 Message Header Field registration information per [RFC3864]. 744 Header field name: TLS-Report-Domain 745 Applicable protocol: mail 746 Status: standard 747 Author/Change controller: IETF 748 Specification document(s): this one 750 Header field name: TLS-Report-Submitter 751 Applicable protocol: mail 752 Status: standard 753 Author/Change controller: IETF 754 Specification document(s): this one 756 6.2. Report Type 758 This document registers a new parameter "report-type="tlsrpt"" under 759 "multipart/report" top-level media type for use with [RFC6522]. 761 The media type suitable for use as a report-type is defined in the 762 following section. 764 6.3. application/tlsrpt+json Media Type 766 This document registers multiple media types, beginning with Table 1 767 below. 769 +-------------+----------------+-------------+-------------------+ 770 | Type | Subtype | File extn | Specification | 771 +-------------+----------------+-------------+-------------------+ 772 | application | tlsrpt+json | .json | Section 5.3 | 773 +-------------+----------------+-------------+-------------------+ 774 Table 1: SMTP TLS Reporting Media Type 776 Type name: application 778 Subtype name: tlsrpt+json 780 Required parameters: n/a 782 Optional parameters: n/a 784 Encoding considerations: Encoding considerations are identical to 785 those specified for the "application/json" media type. See 786 [RFC7493]. 788 Security considerations: Security considerations relating to SMTP TLS 789 Reporting are discussed in Section 7. 791 Interoperability considerations: This document specifies format of 792 conforming messages and the interpretation thereof. 794 Published specification: Section 5.3 of this document. 796 Applications that use this media type: Mail User Agents (MUA) and 797 Mail Transfer Agents. 799 Additional information: 801 Magic number(s): n/a 803 File extension(s): ".json" 805 Macintosh file type code(s): n/a 807 Person & email address to contact for further information: See 808 Authors' Addresses section. 810 Intended usage: COMMON 812 Restrictions on usage: n/a 814 Author: See Authors' Addresses section. 816 Change controller: Internet Engineering Task Force 817 (mailto:iesg@ietf.org). 819 6.4. application/tlsrpt+gzip Media Type 821 +-------------+----------------+-------------+-------------------+ 822 | Type | Subtype | File extn | Specification | 823 +-------------+----------------+-------------+-------------------+ 824 | application | tlsrpt+gzip | .gz | Section 5.3 | 825 +-------------+----------------+-------------+-------------------+ 826 Table 2: SMTP TLS Reporting Media Type 828 Type name: application 830 Subtype name: tlsrpt+gzip 832 Required parameters: n/a 834 Optional parameters: n/a 836 Encoding considerations: Binary 837 Security considerations: Security considerations relating to SMTP TLS 838 Reporting are discussed in Section 7. 840 Interoperability considerations: This document specifies format of 841 conforming messages and the interpretation thereof. 843 Published specification: Section 5.3 of this document. 845 Applications that use this media type: Mail User Agents (MUA) and 846 Mail Transfer Agents. 848 Additional information: 850 Magic number(s): n/a 852 File extension(s): ".gz" 854 Macintosh file type code(s): n/a 856 Person & email address to contact for further information: See 857 Authors' Addresses section. 859 Intended usage: COMMON 861 Restrictions on usage: n/a 863 Author: See Authors' Addresses section. 865 Change controller: Internet Engineering Task Force 866 (mailto:iesg@ietf.org). 868 6.5. STARTTLS Validation Result Types 870 This document creates a new registry, "STARTTLS Validation Result 871 Types". The initial entries in the registry are: 873 +-------------------------------+ 874 | Result Type | 875 +-------------------------------+ 876 | "starttls-not-supported" | 877 | "certificate-host-mismatch" | 878 | "certificate-expired" | 879 | "tlsa-invalid" | 880 | "dnssec-invalid" | 881 | "sts-policy-invalid" | 882 | "sts-webpki-invalid" | 883 | "validation-failure" | 884 +-------------------------------+ 886 The above entries are described in section Section 4.3, "Result 887 Types." New result types can be added to this registry using "Expert 888 Review" IANA registration policy. 890 7. Security Considerations 892 SMTP TLS Reporting provides transparency into misconfigurations or 893 attempts to intercept or tamper with mail between hosts who support 894 STARTTLS. There are several security risks presented by the 895 existence of this reporting channel: 897 o Flooding of the Aggregate report URI (rua) endpoint: An attacker 898 could flood the endpoint with excessive reporting traffic and 899 prevent the receiving domain from accepting additional reports. 900 This type of Denial-of-Service attack would limit visibility into 901 STARTTLS failures, leaving the receiving domain blind to an 902 ongoing attack. 904 o Untrusted content: An attacker could inject malicious code into 905 the report, opening a vulnerability in the receiving domain. 906 Implementers are advised to take precautions against evaluating 907 the contents of the report. 909 o Report snooping: An attacker could create a bogus TLSRPT record to 910 receive statistics about a domain the attacker does not own. 911 Since an attacker able to poison DNS is already able to receive 912 counts of SMTP connections (and, absent DANE or MTA-STS policies, 913 actual SMTP message payloads), this does not present a significant 914 new vulnerability. 916 o Reports as DDoS: TLSRPT allows specifying destinations for the 917 reports that are outside the authority of the Policy Domain, which 918 allows domains to delegate processing of reports to a partner 919 organization. However, an attacker who controls the Policy Domain 920 DNS could also use this mechanism to direct the reports to an 921 unwitting victim, flooding that victim with excessive reports. 922 DMARC [RFC7489] defines a solution for verifying delegation to 923 avoid such attacks; the need for this is greater with DMARC, 924 however, because DMARC allows an attacker to trigger reports to a 925 target from an innocent third party by sending that third party 926 mail (which triggers a report from the third party to the target). 927 In the case of TLSRPT, the attacker would have to induce the third 928 party to send the attacker mail in order to trigger reports from 929 the third party to the victim; this reduces the risk of such an 930 attack and the need for a verification mechanism. 932 Finally, because TLSRPT is intended to help administrators discover 933 man-in-the-middle attacks against transport-layer encryption, 934 including attacks designed to thwart negotiation of encrypted 935 connections (by downgrading opportunistic encryption or, in the case 936 of MTA-STS, preventing discovery of a new MTA-STS policy), we must 937 also consider the risk that an adversary who can induce such a 938 downgrade attack can also prevent discovery of the TLSRPT TXT record 939 (and thus prevent discovery of the successful downgrade attack). 940 Administrators are thus encouraged to deploy TLSRPT TXT records with 941 a large TTL (reducing the window for successful attacks against DNS 942 resolution of the record) or to deploy DNSSEC on the deploying zone. 944 8. References 946 8.1. Normative References 948 [I-D.ietf-uta-mta-sts] 949 Margolis, D., Risher, M., Ramakrishnan, B., Brotman, A., 950 and J. Jones, "SMTP MTA Strict Transport Security (MTA- 951 STS)", draft-ietf-uta-mta-sts-14 (work in progress), 952 January 2018. 954 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 955 Requirement Levels", BCP 14, RFC 2119, 956 DOI 10.17487/RFC2119, March 1997, . 959 [RFC3339] Klyne, G. and C. Newman, "Date and Time on the Internet: 960 Timestamps", RFC 3339, DOI 10.17487/RFC3339, July 2002, 961 . 963 [RFC3492] Costello, A., "Punycode: A Bootstring encoding of Unicode 964 for Internationalized Domain Names in Applications 965 (IDNA)", RFC 3492, DOI 10.17487/RFC3492, March 2003, 966 . 968 [RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform 969 Resource Identifier (URI): Generic Syntax", STD 66, 970 RFC 3986, DOI 10.17487/RFC3986, January 2005, 971 . 973 [RFC5234] Crocker, D., Ed. and P. Overell, "Augmented BNF for Syntax 974 Specifications: ABNF", STD 68, RFC 5234, 975 DOI 10.17487/RFC5234, January 2008, . 978 [RFC5280] Cooper, D., Santesson, S., Farrell, S., Boeyen, S., 979 Housley, R., and W. Polk, "Internet X.509 Public Key 980 Infrastructure Certificate and Certificate Revocation List 981 (CRL) Profile", RFC 5280, DOI 10.17487/RFC5280, May 2008, 982 . 984 [RFC5321] Klensin, J., "Simple Mail Transfer Protocol", RFC 5321, 985 DOI 10.17487/RFC5321, October 2008, . 988 [RFC5322] Resnick, P., Ed., "Internet Message Format", RFC 5322, 989 DOI 10.17487/RFC5322, October 2008, . 992 [RFC5891] Klensin, J., "Internationalized Domain Names in 993 Applications (IDNA): Protocol", RFC 5891, 994 DOI 10.17487/RFC5891, August 2010, . 997 [RFC5952] Kawamura, S. and M. Kawashima, "A Recommendation for IPv6 998 Address Text Representation", RFC 5952, 999 DOI 10.17487/RFC5952, August 2010, . 1002 [RFC6068] Duerst, M., Masinter, L., and J. Zawinski, "The 'mailto' 1003 URI Scheme", RFC 6068, DOI 10.17487/RFC6068, October 2010, 1004 . 1006 [RFC6125] Saint-Andre, P. and J. Hodges, "Representation and 1007 Verification of Domain-Based Application Service Identity 1008 within Internet Public Key Infrastructure Using X.509 1009 (PKIX) Certificates in the Context of Transport Layer 1010 Security (TLS)", RFC 6125, DOI 10.17487/RFC6125, March 1011 2011, . 1013 [RFC6376] Crocker, D., Ed., Hansen, T., Ed., and M. Kucherawy, Ed., 1014 "DomainKeys Identified Mail (DKIM) Signatures", STD 76, 1015 RFC 6376, DOI 10.17487/RFC6376, September 2011, 1016 . 1018 [RFC6522] Kucherawy, M., Ed., "The Multipart/Report Media Type for 1019 the Reporting of Mail System Administrative Messages", 1020 STD 73, RFC 6522, DOI 10.17487/RFC6522, January 2012, 1021 . 1023 [RFC6698] Hoffman, P. and J. Schlyter, "The DNS-Based Authentication 1024 of Named Entities (DANE) Transport Layer Security (TLS) 1025 Protocol: TLSA", RFC 6698, DOI 10.17487/RFC6698, August 1026 2012, . 1028 [RFC7231] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer 1029 Protocol (HTTP/1.1): Semantics and Content", RFC 7231, 1030 DOI 10.17487/RFC7231, June 2014, . 1033 [RFC7405] Kyzivat, P., "Case-Sensitive String Support in ABNF", 1034 RFC 7405, DOI 10.17487/RFC7405, December 2014, 1035 . 1037 [RFC7493] Bray, T., Ed., "The I-JSON Message Format", RFC 7493, 1038 DOI 10.17487/RFC7493, March 2015, . 1041 8.2. Informative References 1043 [RFC3207] Hoffman, P., "SMTP Service Extension for Secure SMTP over 1044 Transport Layer Security", RFC 3207, DOI 10.17487/RFC3207, 1045 February 2002, . 1047 [RFC3501] Crispin, M., "INTERNET MESSAGE ACCESS PROTOCOL - VERSION 1048 4rev1", RFC 3501, DOI 10.17487/RFC3501, March 2003, 1049 . 1051 [RFC3864] Klyne, G., Nottingham, M., and J. Mogul, "Registration 1052 Procedures for Message Header Fields", BCP 90, RFC 3864, 1053 DOI 10.17487/RFC3864, September 2004, . 1056 [RFC7435] Dukhovni, V., "Opportunistic Security: Some Protection 1057 Most of the Time", RFC 7435, DOI 10.17487/RFC7435, 1058 December 2014, . 1060 [RFC7469] Evans, C., Palmer, C., and R. Sleevi, "Public Key Pinning 1061 Extension for HTTP", RFC 7469, DOI 10.17487/RFC7469, April 1062 2015, . 1064 [RFC7489] Kucherawy, M., Ed. and E. Zwicky, Ed., "Domain-based 1065 Message Authentication, Reporting, and Conformance 1066 (DMARC)", RFC 7489, DOI 10.17487/RFC7489, March 2015, 1067 . 1069 [RFC7672] Dukhovni, V. and W. Hardaker, "SMTP Security via 1070 Opportunistic DNS-Based Authentication of Named Entities 1071 (DANE) Transport Layer Security (TLS)", RFC 7672, 1072 DOI 10.17487/RFC7672, October 2015, . 1075 Appendix A. Example Reporting Policy 1077 A.1. Report using MAILTO 1079 _smtp-tlsrpt.mail.example.com. IN TXT \ 1080 "v=TLSRPTv1;rua=mailto:reports@example.com" 1082 A.2. Report using HTTPS 1084 _smtp-tlsrpt.mail.example.com. IN TXT \ 1085 "v=TLSRPTv1; \ 1086 rua=https://reporting.example.com/v1/tlsrpt" 1088 Appendix B. Example JSON Report 1089 { 1090 "organization-name": "Company-X", 1091 "date-range": { 1092 "start-datetime": "2016-04-01T00:00:00Z", 1093 "end-datetime": "2016-04-01T23:59:59Z" 1094 }, 1095 "contact-info": "sts-reporting@company-x.example", 1096 "report-id": "5065427c-23d3-47ca-b6e0-946ea0e8c4be", 1097 "policies": [{ 1098 "policy": { 1099 "policy-type": "sts", 1100 "policy-string": ["version: STSv1","mode: report", 1101 "mx: .mail.company-y.example","max_age: 86400"], 1102 "policy-domain": "company-y.example", 1103 "mx-host": ".mail.company-y.example" 1104 }, 1105 "summary": { 1106 "total-successful-session-count": 5326, 1107 "total-failure-session-count": 303 1108 }, 1109 "failure-details": [{ 1110 "result-type": "certificate-expired", 1111 "sending-mta-ip": "98.136.216.25", 1112 "receiving-mx-hostname": "mx1.mail.company-y.example", 1113 "failed-session-count": 100 1114 }, { 1115 "result-type": "starttls-not-supported", 1116 "sending-mta-ip": "98.22.33.99", 1117 "receiving-mx-hostname": "mx2.mail.company-y.example", 1118 "receiving-ip": "192.168.14.72", 1119 "failed-session-count": 200, 1120 "additional-information": "https://reports.company-x.example/ 1121 report_info ? id = 5065427 c - 23 d3# StarttlsNotSupported " 1122 }, { 1123 "result-type": "validation-failure", 1124 "sending-mta-ip": "47.97.15.2", 1125 "receiving-ip": "10.72.84.12", 1126 "receiving-mx-hostname": "mx-backup.mail.company-y.example", 1127 "failed-session-count": 3, 1128 "failure-error-code": "X509_V_ERR_PROXY_PATH_LENGTH_EXCEEDED" 1129 }] 1130 }] 1131 } 1133 Figure: Example JSON report for a messages from Company-X to Company- 1134 Y, where 100 sessions were attempted to Company Y servers with an 1135 expired certificate and 200 sessions were attempted to Company Y 1136 servers that did not successfully respond to the "STARTTLS" command. 1137 Additionally 3 sessions failed due to 1138 "X509_V_ERR_PROXY_PATH_LENGTH_EXCEEDED". 1140 Authors' Addresses 1142 Daniel Margolis 1143 Google, Inc 1145 Email: dmargolis@google.com 1147 Alexander Brotman 1148 Comcast, Inc 1150 Email: alex_brotman@comcast.com 1152 Binu Ramakrishnan 1153 Yahoo!, Inc 1155 Email: rbinu@oath.com 1157 Janet Jones 1158 Microsoft, Inc 1160 Email: janet.jones@microsoft.com 1162 Mark Risher 1163 Google, Inc 1165 Email: risher@google.com