idnits 2.17.1 draft-melnikov-smime-msa-to-mda-01.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- 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 (January 8, 2014) is 3762 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) ** Obsolete normative reference: RFC 5750 (Obsoleted by RFC 8550) ** Obsolete normative reference: RFC 5751 (Obsoleted by RFC 8551) -- Obsolete informational reference (is this intentional?): RFC 7001 (Obsoleted by RFC 7601) Summary: 2 errors (**), 0 flaws (~~), 1 warning (==), 2 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Network Working Group W. Ottaway 3 Internet-Draft QinetiQ 4 Intended status: Standards Track A. Melnikov, Ed. 5 Expires: July 12, 2014 Isode Ltd 6 January 8, 2014 8 MSA-to-MDA S/MIME signing & encryption 9 draft-melnikov-smime-msa-to-mda-01 11 Abstract 13 This document specifies how S/MIME signing and encryption can be 14 applied between a Message Submission Agent (MSA) and a Message 15 Delivery Agent (MDA) or between 2 Message Transfer Agents (MTA). 17 Status of This Memo 19 This Internet-Draft is submitted in full conformance with the 20 provisions of BCP 78 and BCP 79. 22 Internet-Drafts are working documents of the Internet Engineering 23 Task Force (IETF). Note that other groups may also distribute 24 working documents as Internet-Drafts. The list of current Internet- 25 Drafts is at http://datatracker.ietf.org/drafts/current/. 27 Internet-Drafts are draft documents valid for a maximum of six months 28 and may be updated, replaced, or obsoleted by other documents at any 29 time. It is inappropriate to use Internet-Drafts as reference 30 material or to cite them other than as "work in progress." 32 This Internet-Draft will expire on July 12, 2014. 34 Copyright Notice 36 Copyright (c) 2014 IETF Trust and the persons identified as the 37 document authors. All rights reserved. 39 This document is subject to BCP 78 and the IETF Trust's Legal 40 Provisions Relating to IETF Documents 41 (http://trustee.ietf.org/license-info) in effect on the date of 42 publication of this document. Please review these documents 43 carefully, as they describe your rights and restrictions with respect 44 to this document. Code Components extracted from this document must 45 include Simplified BSD License text as described in Section 4.e of 46 the Trust Legal Provisions and are provided without warranty as 47 described in the Simplified BSD License. 49 Table of Contents 51 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 52 2. Conventions Used in This Document . . . . . . . . . . . . . . 4 53 2.1. Domain Signature . . . . . . . . . . . . . . . . . . . . 5 54 2.2. Domain Encryption and Decryption . . . . . . . . . . . . 5 55 2.3. Signature Encapsulation . . . . . . . . . . . . . . . . . 5 56 3. MSA-to-MDA S/MIME signing . . . . . . . . . . . . . . . . . . 6 57 3.1. Naming Conventions and Signature Types . . . . . . . . . 6 58 3.1.1. Naming Conventions . . . . . . . . . . . . . . . . . 7 59 3.1.2. Signature Type Attribute . . . . . . . . . . . . . . 8 60 3.2. Domain Signature Generation and Verification . . . . . . 9 61 4. MSA-to-MDA S/MIME Encryption and Decryption . . . . . . . . . 10 62 4.1. Key Management for DCA Encryption . . . . . . . . . . . . 11 63 4.2. Key Management for DCA Decryption . . . . . . . . . . . . 12 64 5. Applying a Domain Signature when Mail List Agents are Present 12 65 5.1. Examples of Rule Processing . . . . . . . . . . . . . . . 15 66 6. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 17 67 7. Security Considerations . . . . . . . . . . . . . . . . . . . 17 68 8. References . . . . . . . . . . . . . . . . . . . . . . . . . 18 69 8.1. Normative References . . . . . . . . . . . . . . . . . . 18 70 8.2. Informative References . . . . . . . . . . . . . . . . . 18 71 Appendix A. Changes from RFC 3183 . . . . . . . . . . . . . . . 20 72 Appendix B. Acknowledgements . . . . . . . . . . . . . . . . . . 20 74 1. Introduction 76 The S/MIME [RFC5750][RFC5751] series of standards define a data 77 encapsulation format for the provision of a number of security 78 services including data integrity, confidentiality, and 79 authentication. S/MIME is designed for use by messaging clients to 80 deliver security services to distributed messaging applications. 82 The mechanisms described in this document are designed to solve a 83 number of interoperability problems and technical limitations that 84 arise when different security domains wish to communicate securely, 85 for example when two domains use incompatible messaging technologies 86 such as the X.400 series and SMTP/MIME [RFC5322], or when a single 87 domain wishes to communicate securely with one of its members 88 residing on an untrusted domain. The main scenario covered by this 89 document is domain-to-domain, although it is also applicable to 90 individual-to-domain and domain-to-individual communications. This 91 document is also applicable to organizations and enterprises that 92 have internal PKIs which are not accessible by the outside world, but 93 wish to interoperate securely using the S/MIME protocol. 95 There are many circumstances when it is not desirable or practical to 96 provide end-to-end (MUA-to-MUA) security services, particularly 97 between different security domains. An organization that is 98 considering providing end-to-end security services will typically 99 have to deal with some if not all of the following issues: 101 1. Message screening and audit: Server-based mechanisms such as 102 searching for prohibited words or other content, virus scanning, 103 and audit, are incompatible with end-to-end encryption. 105 2. PKI deployment issues: There may not be any certificate paths 106 between two organizations. Or an organization may be sensitive 107 about aspects of its PKI and unwilling to expose them to outside 108 access. Also, full PKI deployment for all employees, may be 109 expensive, not necessary or impractical for large organizations. 110 For any of these reasons, direct end-to-end signature validation 111 and encryption are impossible. 113 3. Heterogeneous message formats: One organization using X.400 114 series protocols wishes to communicate with another using SMTP 115 [RFC5321]. Message reformatting at gateways makes end-to-end 116 encryption and signature validation impossible. 118 4. Heterogeneous message access methods: Users are accessing mail 119 using mechanisms which re-format messages, such as using Web 120 browsers. Message reformatting in the Message Store makes end- 121 to-end encryption and signature validation impossible. 123 5. Problems deploying fully S/MIME capable email clients on some 124 platforms. Signature verification at a border MTA can be coupled 125 with use of Authentication-Results header field [RFC7001] to 126 convey results of verification. 128 This document describes an approach to solving these problems by 129 providing message security services at the level of a domain or an 130 organization. This document specifies how these 'domain security 131 services' can be provided using the S/MIME protocol. Domain security 132 services may replace or complement mechanisms at the desktop/mobile 133 device. For example, a domain may decide to provide MUA-to-MUA 134 signatures but domain-to-domain encryption services. Or it may allow 135 MUA-to-MUA services for intra-domain use, but enforce domain-based 136 services for communication with other domains. 138 Domain services can also be used by individual members of a 139 corporation who are geographically remote and who wish to exchange 140 encrypted and/or signed messages with their base. 142 Whether or not a domain based service is inherently better or worse 143 than desktop based solutions is an open question. Some experts 144 believe that only end-to-end solutions can be truly made secure, 145 while others believe that the benefits offered by such things as 146 content checking at domain boundaries offers considerable increase in 147 practical security for many real systems. The additional service of 148 allowing signature checking at several points on a communications 149 path is also an extra benefit in many situations. This debate is 150 outside the scope of this document. What is offered here is a set of 151 tools that integrators can tailor in different ways to meet different 152 needs in different circumstances. 154 Message Transfer Agents (MTAs), guards, firewalls and protocol 155 translation gateways all provide domain security services. As with 156 MUA based solutions, these components must be resilient against a 157 wide variety of attacks intended to subvert the security services. 158 Therefore, careful consideration should be given to security of these 159 components, to make sure that their siting and configuration 160 minimises the possibility of attack. 162 2. Conventions Used in This Document 164 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 165 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 166 document are to be interpreted as described in [RFC2119]. 168 The signature type defined in this document are referred to as DOMSEC 169 defined signatures. 171 The term 'security domain' as used in this document is defined as a 172 collection of hardware and personnel operating under a single 173 security authority and performing a common business function. 174 Members of a security domain will of necessity share a high degree of 175 mutual trust, due to their shared aims and objectives. 177 A security domain is typically protected from direct outside attack 178 by physical measures and from indirect (electronic) attack by a 179 combination of firewalls and guards at network boundaries. The 180 interface between two security domains is termed a 'security 181 boundary'. One example of a security domain is an organizational 182 network ('Intranet'). 184 Message encryption may be performed by a third party on behalf of a 185 set of originators in a domain. This is referred to as domain 186 encryption. Message decryption may be performed by a third party on 187 behalf of a set of recipients in a domain. This is referred to as 188 domain decryption. The third party that performs these processes is 189 referred to in this section as a "Domain Confidentiality Authority" 190 (DCA). 192 2.1. Domain Signature 194 A domain signature is an S/MIME signature generated on behalf of a 195 set of users in a domain. A domain signature can be used to 196 authenticate information sent between domains or between a certain 197 domain and one of its individuals, for example, when two 'Intranets' 198 are connected using the Internet, or when an Intranet is connected to 199 a remote user over the Internet. It can be used when two domains 200 employ incompatible signature schemes internally or when there are no 201 certification links between their PKIs. In both cases messages from 202 the originator's domain are signed over the original message and 203 signature (if present) using an algorithm, key, and certificate which 204 can be processed by the recipient(s) or the recipient(s) domain. A 205 domain signature is sometimes referred to as an "organizational 206 signature". 208 2.2. Domain Encryption and Decryption 210 Domain encryption is S/MIME encryption performed on behalf of a 211 collection of users in a domain. Domain encryption can be used to 212 protect information between domains, for example, when two 213 'Intranets' are connected using the Internet. It can also be used 214 when end users do not have PKI/encryption capabilities at the 215 desktop, or when two domains employ incompatible encryption schemes 216 internally. In the latter case messages from the originator's domain 217 are encrypted (or re-encrypted) using an algorithm, key, and 218 certificate which can be decrypted by the recipient(s) or an entity 219 in their domain. This scheme also applies to protecting information 220 between a single domain and one of its members when both are 221 connected using an untrusted network, e.g., the Internet. 223 2.3. Signature Encapsulation 225 ESS [RFC2634] introduces the concept of triple-wrapped messages that 226 are first signed, then encrypted, then signed again. This document 227 also uses this concept of triple-wrapping. In addition, this 228 document also uses the concept of 'signature encapsulation'. 229 'Signature encapsulation' denotes a signed or unsigned message that 230 is wrapped in a signature, this signature covering both the content 231 and the first (inner) signature, if present. 233 Signature encapsulation can be performed on the inner and/or the 234 outer signature of a triple-wrapped message. 236 For example, the originator signs a message which is then 237 encapsulated with an 'additional attributes' signature. This is then 238 encrypted. A reviewer then signs this encrypted data, which is then 239 encapsulated by a domain signature. 241 There is a possibility that some policies will require signatures to 242 be added in a specific order. By only allowing signatures to be 243 added by encapsulation it is possible to determine the order in which 244 the signatures have been added. 246 A DOMSEC defined signature MAY encapsulate a message in one of the 247 following ways: 249 1. An unsigned message has an empty signature layer added to it 250 (i.e., the message is wrapped in a signedData that has a 251 signerInfos which contains no elements). This is to enable 252 backward compatibility with S/MIME software that does not have a 253 DOMSEC capability. Since the signerInfos will contain no signers 254 the eContentType, within the EncapsulatedContentInfo, MUST be id- 255 data as described in CMS [RFC5652]. However, the eContent field 256 will contain the unsigned message instead of being left empty as 257 suggested in section 5.2 in CMS [RFC5652]. This is so that when 258 the DOMSEC defined signature is added, as defined in method 2) 259 below, the signature will cover the unsigned message. 261 2. Signature Encapsulation is used to wrap the original signed 262 message with a DOMSEC defined signature. This is so that the 263 DOMSEC defined signature covers the message and all the 264 previously added signatures. Also, it is possible to determine 265 that the DOMSEC defined signature was added after the signatures 266 that are already there. 268 3. MSA-to-MDA S/MIME signing 270 3.1. Naming Conventions and Signature Types 272 An entity receiving an S/MIME signed message would normally expect 273 the signature to be that of the originator of the message. However, 274 the message security services defined in this document require the 275 recipient to be able to accept messages signed by other entities and/ 276 or the originator. When other entities sign the message the name in 277 the certificate will not match the message sender's name. An S/MIME 278 compliant implementation would normally flag a warning if there were 279 a mismatch between the name in the certificate and the message 280 sender's name. (This check prevents a number of types of masquerade 281 attack.) 283 In the case of domain security services, this warning condition 284 SHOULD be suppressed under certain circumstances. These 285 circumstances are defined by a naming convention that specifies the 286 form that the signers name SHOULD adhere to. Adherence to this 287 naming convention avoids the problems of uncontrolled naming and the 288 possible masquerade attacks that this would produce. 290 As an assistance to implementation, a signed attribute is defined to 291 be included in the S/MIME signature - the 'signature type' attribute 292 Section 3.1.2. On receiving a message containing this attribute, the 293 naming convention checks are invoked. 295 Implementations conforming to this standard MUST support the naming 296 convention for signature generation and verification. 297 Implementations conforming to this standard MUST recognize the 298 signature type attribute for signature verification. Implementations 299 conforming to this standard MUST support the signature type attribute 300 for signature generation. 302 3.1.1. Naming Conventions 304 The subject name of the Originating S/MIME MSA/MTA's X.509 305 certificate is not restricted as specified in RFC 3183 [RFC3183]. In 306 order for a verifier to recognize a signing/encrypting certificate as 307 the Originating S/MIME MSA/MTA's certificate, it MUST contain 308 uniformResourceIdentifier GeneralName of the format "smtp://" in its SubjectAltName [RFC5280]. (Here is the domain that is being served by the signing/ 311 encrypting MSA/MTA.) An rfc822Name GeneralName as specified in 312 [RFC3183] MAY optionally be included in the SubjectAltName. 314 Any message received where the domain part of the domain signing 315 agent's name does not match, or is not an ascendant of, the 316 originator's domain name MUST be flagged to the user. 318 This naming rule prevents agents from one organization masquerading 319 as domain signing authorities on behalf of another. For the other 320 types of signature defined in future documents, no such named mapping 321 rule is defined. 323 Implementations conforming to this standard MUST support this naming 324 convention as a minimum. Implementations MAY choose to supplement 325 this convention with other locally defined conventions. However, 326 these MUST be agreed between sender and recipient domains prior to 327 secure exchange of messages. 329 On verifying the signature, a receiving agent MUST ensure that the 330 naming convention has been adhered to. Any message that violates the 331 convention MUST be flagged to the user. 333 [[Do we need to distinguish signing versa encryption in certificate's 334 SubjectAltName?]] 336 3.1.2. Signature Type Attribute 338 An S/MIME signed attribute is used to indicate the type of signature. 339 This should be used in conjunction with the naming conventions 340 specified in the previous section. When an S/MIME signed message 341 containing the signature type attribute is received it triggers the 342 software to verify that the correct naming convention has been used. 344 The following object identifier identifies the SignatureType 345 attribute: 347 id-aa-signatureType OBJECT IDENTIFIER ::= { iso(1) 348 member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs9(9) 28 } 350 The ASN.1 [ASN.1] notation of this attribute is: - 352 SignatureType ::= SEQUENCE OF OBJECT IDENTIFIER 354 id-sti OBJECT IDENTIFIER ::= {iso(1) member-body(2) us(840) 355 rsadsi(113549) pkcs(1) pkcs-9(9) smime(16) 9 } 356 -- signature type identifier 358 If present, the SignatureType attribute MUST be a signed attribute, 359 as defined in [RFC5652]. If the SignatureType attribute is absent 360 and there are no further encapsulated signatures the recipient SHOULD 361 assume that the signature is that of the message originator. 363 All of the signatures defined here are generated and processed as 364 described in [RFC5652]. They are distinguished by the presence of 365 the following values in the SignatureType signed attribute: 367 id-sti-domainSig OBJECT IDENTIFIER ::= { id-sti 2 } 368 -- domain signature. 370 A domain signature MUST encapsulate other signatures. Note a DOMSEC 371 defined signature could be encapsulating an empty signature as 372 defined in Section 2.3. 374 A SignerInfo MUST NOT include multiple instances of SignatureType. A 375 signed attribute representing a SignatureType MAY include multiple 376 instances of different SignatureType values as an AttributeValue of 377 attrValues [RFC5652], as long as the SignatureType 'additional 378 attributes' is not present. 380 If there is more than one SignerInfo in a signerInfos (i.e., when 381 different algorithms are used) then the SignatureType attribute in 382 all the SignerInfos MUST contain the same content. 384 3.2. Domain Signature Generation and Verification 386 A 'domain signature' is a proxy signature generated on a user's 387 behalf in the user's domain. The signature MUST adhere to the naming 388 conventions in Section 3.1.1. A 'domain signature' on a message 389 authenticates the fact that the message has been released from that 390 domain. Before signing, a process generating a 'domain signature' 391 MUST first satisfy itself of the authenticity of the message 392 originator. This is achieved by one of two methods. Either the 393 'originator's signature' is checked, if S/MIME signatures are used 394 inside a domain. Or if not, some mechanism external to S/MIME is 395 used, such as the physical address of the originating client or an 396 authenticated IP link, SMTP authentication credentials, etc. 398 If the originator's authenticity is successfully verified by one of 399 the above methods and all other signatures present are valid, 400 including those that have been encrypted, a 'domain signature' can be 401 added to a message. 403 If a 'domain signature' is added and the message is received by a 404 Mail List Agent (MLA) there is a possibility that the 'domain 405 signature' will be removed. To stop the 'domain signature' from 406 being removed the steps in Section 5 MUST be followed. 408 An entity generating a domain signature MUST do so using a 409 certificate containing a subject name that follows the naming 410 convention specified in Section 3.1.1. 412 If the originator's authenticity is not successfully verified or all 413 the signatures present are not valid, a 'domain signature' MUST NOT 414 be generated. 416 On reception, the 'domain signature' SHOULD be used to verify the 417 authenticity of a message. A check MUST be made to ensure that the 418 naming convention have been used as specified in this standard. 420 A recipient can assume that successful verification of the domain 421 signature also authenticates the message originator. 423 If there is an originator signature present, the name in that 424 certificate SHOULD be used to identify the originator. This 425 information can then be displayed to the recipient. 427 If there is no originator signature present, the only assumption that 428 can be made is the domain the message originated from. 430 A domain signer can be assumed to have verified any signatures that 431 it encapsulates. Therefore, it is not necessary to verify these 432 signatures before treating the message as authentic. However, this 433 standard does not preclude a recipient from attempting to verify any 434 other signatures that are present. 436 The 'domain signature' is indicated by the presence of the value id- 437 sti-domainSig in a 'signature type' signed attribute. 439 There MAY be one or more 'domain signature' signatures in an S/MIME 440 encoding. 442 4. MSA-to-MDA S/MIME Encryption and Decryption 444 Message encryption may be performed by a third party on behalf of a 445 set of originators in a domain. This is referred to as domain 446 encryption. Message decryption may be performed by a third party on 447 behalf of a set of recipients in a domain. This is referred to as 448 domain decryption. The third party that performs these processes is 449 referred to in this section as a "Domain Confidentiality Authority" 450 (DCA). Both of these processes are described in this section. 452 Messages may be encrypted for decryption by the final recipient and/ 453 or by a DCA in the recipient's domain. The message may also be 454 encrypted for decryption by a DCA in the originator's domain (e.g., 455 for content analysis, audit, key word scanning, etc.). The choice of 456 which of these is actually performed is a system specific issue that 457 depends on system security policy. It is therefore outside the scope 458 of this document. These processes of encryption and decryption 459 processes are shown in the following table. 461 +-----------------------+----------------------+-------------------+ 462 | | Recipient Decryption | Domain Decryption | 463 +-----------------------+----------------------+-------------------+ 464 | Originator Encryption | Case(a) | Case(b) | 465 | | | | 466 | Domain Encryption | Case(c) | Case(d) | 467 +-----------------------+----------------------+-------------------+ 469 Case (a), encryption of messages by the originator for decryption by 470 the final recipient(s), is described in CMS [RFC5652]. In cases (c) 471 and (d), encryption is performed not by the originator but by the DCA 472 in the originator's domain. In cases (b) and (d), decryption is 473 performed not by the recipient(s) but by the DCA in the recipient's 474 domain. 476 A client implementation that conforms to this standard MUST support 477 case (b) for transmission, case (c) for reception and case (a) for 478 transmission and reception. 480 A DCA implementation that conforms to this standard MUST support 481 cases (c) and (d), for transmission, and cases (b) and (d) for 482 reception. In cases (c) and (d) the 'domain signature' SHOULD be 483 applied before the encryption. In cases (b) and (d) the message 484 SHOULD be decrypted before the originators 'domain signature' is 485 obtained and verified. 487 The process of encryption and decryption is documented in CMS 488 [RFC5652]. The only additional requirement introduced by domain 489 encryption and decryption is for greater flexibility in the 490 management of keys, as described in the following subsections. As 491 with signatures, a naming convention is used to locate the correct 492 public key. 494 The mechanisms described below are applicable both to key agreement 495 and key transport systems, as documented in CMS [RFC5652]. The 496 phrase 'encryption key' is used as a collective term to cover the key 497 management keys used by both techniques. 499 The mechanisms below are also applicable to individual roving users 500 who wish to encrypt messages that are sent back to base. 502 4.1. Key Management for DCA Encryption 504 At the sender's domain, DCA encryption is achieved using the 505 recipient DCA's certificate or the end recipient's certificate. For 506 this, the encrypting process must be able to correctly locate the 507 certificate for the corresponding DCA in the recipient's domain or 508 the one corresponding to the end recipient. Having located the 509 correct certificate, the encryption process is then performed and 510 additional information required for decryption is conveyed to the 511 recipient in the recipientInfo field as specified in CMS [RFC5652]. 512 A DCA encryption agent MUST be named according to the naming 513 convention specified in Section 3.1.1. This is so that the 514 corresponding certificate can be found. 516 No specific method for locating the certificate to the corresponding 517 DCA in the recipient's domain or the one corresponding to the end 518 recipient is mandated in this document. An implementation may choose 519 to access a local certificate store to locate the correct 520 certificate. Alternatively, a X.500 or LDAP [RFC4510] directory may 521 be used in one of the following ways: 523 1. The directory may store the DCA certificate in the recipient's 524 directory entry. When the user certificate attribute is 525 requested, this certificate is returned. 527 2. The encrypting agent maps the recipient's name to the DCA name in 528 the manner specified in Section 3.1.1. The user certificate 529 attribute associated with this directory entry is then obtained. 531 This document does not mandate either of these processes. Whichever 532 one is used, the naming conventions must be adhered to, in order to 533 maintain confidentiality. 535 Having located the correct certificate, the encryption process is 536 then performed. A recipientInfo for the DCA or end recipient is then 537 generated, as described in CMS [RFC5652]. 539 DCA encryption may be performed for decryption by the end recipient 540 and/or by a DCA. End recipient decryption is described in CMS 541 [RFC5652]. DCA decryption is described in Section 4.2. 543 4.2. Key Management for DCA Decryption 545 DCA decryption uses a private-key belonging to the DCA and the 546 necessary information conveyed in the DCA's recipientInfo field. 548 It should be noted that domain decryption can be performed on 549 messages encrypted by the originator and/or by a DCA in the 550 originator's domain. In the first case, the encryption process is 551 described in CMS [RFC5652]; in the second case, the encryption 552 process is described in Section 4.1. 554 5. Applying a Domain Signature when Mail List Agents are Present 556 It is possible that a message leaving a DOMSEC domain may encounter a 557 Mail List Agent (MLA) before it reaches the final recipient. There 558 is a possibility that this would result in the 'domain signature' 559 being stripped off the message. We do not want a MLA to remove the 560 'domain signature'. Therefore, the 'domain signature' must be 561 applied to the message in such a way that will prevent a MLA from 562 removing it. 564 A MLA will search a message for the "outer" signedData layer, as 565 defined in ESS [RFC2634] section 4.2, and strip off all signedData 566 layers that encapsulate this "outer" signedData layer. Where this 567 "outer" signedData layer is found will depend on whether the message 568 contains a mlExpansionHistory attribute or an envelopedData layer. 570 There is a possibility that a message leaving a DOMSEC domain has 571 already been processed by a MLA, in which case a 'mlExpansionHistory' 572 attribute will be present within the message. 574 There is a possibility that the message will contain an envelopedData 575 layer. This will be the case when the message has been encrypted 576 within the domain for the domain's "Domain Confidentiality Authority" 577 (see Section 4), and, possibly, the final recipient. 579 How the 'domain signature' is applied will depend on what is already 580 present within the message. Before the 'domain signature' can be 581 applied the message MUST be searched for the "outer" signedData 582 layer, this search is complete when one of the following is found: 584 o The "outer" signedData layer that includes an mlExpansionHistory 585 attribute or encapsulates an envelopedData object. 587 o An envelopedData layer. 589 o The original content (that is, a layer that is neither 590 envelopedData nor signedData). 592 If a signedData layer containing a mlExpansionHistory attribute has 593 been found then: 595 1. Strip off the signedData layer (after remembering the included 596 signedAttributes). 598 2. Search the rest of the message until an envelopedData layer or 599 the original content is found. 601 3. 603 A. If an envelopedData layer has been found then: 605 + Strip off all the signedData layers down to the 606 envelopedData layer. 608 + Locate the RecipientInfo for the local DCA and use the 609 information it contains to obtain the message key. 611 + Decrypt the encryptedContent using the message key. 613 + Encapsulate the decrypted message with a 'domain 614 signature'. 616 + If local policy requires the message to be encrypted using 617 S/MIME encryption before leaving the domain then 618 encapsulate the 'domain signature' with an envelopedData 619 layer containing RecipientInfo structures for each of the 620 recipients and an originatorInfo value built from 621 information describing this DCA. 623 If local policy does not require the message to be 624 encrypted using S/MIME encryption but there is an 625 envelopedData at a lower level within the message then the 626 'domain signature' MUST be encapsulated by an 627 envelopedData as described above. 629 An example when it may not be local policy to require S/ 630 MIME encryption is when there is a link crypto present. 632 B. If an envelopedData layer has not been found then: 634 - Encapsulate the new message with a 'domain signature'. 636 4. Encapsulate the new message in a signedData layer, adding the 637 signedAttributes from the signedData layer that contained the 638 mlExpansionHistory attribute. 640 If no signedData layer containing a mlExpansionHistory attribute has 641 been found but an envelopedData has been found then: - 643 1. Strip off all the signedData layers down to the envelopedData 644 layer. 646 2. Locate the RecipientInfo for the local DCA and use the 647 information it contains to obtain the message key. 649 3. Decrypt the encryptedContent using the message key. 651 4. Encapsulate the decrypted message with a 'domain signature'. 653 5. If local policy requires the message to be encrypted before 654 leaving the domain then encapsulate the 'domain signature' with 655 an envelopedData layer containing RecipientInfo structures for 656 each of the recipients and an originatorInfo value built from 657 information describing this DCA. 659 6. If local policy does not require the message to be encrypted 660 using S/MIME encryption but there is an envelopedData at a lower 661 level within the message then the 'domain signature' MUST be 662 encapsulated by an envelopedData as described above. 664 If no signedData layer containing a mlExpansionHistory attribute has 665 been found and no envelopedData has been found then: - 667 1. Strip off all the signedData layers down to the envelopedData 668 Encapsulate the message in a 'domain signature'. 670 5.1. Examples of Rule Processing 672 The following examples help explain the above rules. All of the 673 signedData objects are valid and none of them are a domain signature. 674 If a signedData object was a domain signature then it would not be 675 necessary to validate any further signedData objects. 677 1. A message (S1 (Original Content)) (where S = signedData) in which 678 the signedData does not include an mlExpansionHistory attribute 679 is to have a 'domain signature' applied. The signedData, S1, is 680 verified. No "outer" signedData is found, after searching for 681 one as defined above, since the original content is found, nor is 682 an envelopedData or a mlExpansionHistory attribute found. A new 683 signedData layer, S2, is created that contains a 'domain 684 signature', resulting in the following message sent out of the 685 domain (S2 (S1 (Original Content))). 687 2. A message (S3 (S2 (S1 (Original Content))) in which none of the 688 signedData layers includes an mlExpansionHistory attribute is to 689 have a 'domain signature' applied. The signedData objects S1, S2 690 and S3 are verified. There is not an original, "outer" 691 signedData layer since the original content is found, nor is an 692 envelopedData or a mlExpansionHistory attribute found. A new 693 signedData layer, S4, is created that contains a 'domain 694 signature', resulting in the following message sent out of the 695 domain (S4 (S3 (S2 (S1 (Original Content))). 697 3. A message (E1 (S1 (Original Content))) (where E = envelopedData) 698 in which S1 does not include a mlExpansionHistory attribute is to 699 have a 'domain signature' applied. There is not an original, 700 received "outer" signedData layer since the envelopedData, E1, is 701 found at the outer layer. The encryptedContent is decrypted. 702 The signedData, S1, is verified. The decrypted content is 703 wrapped in a new signedData layer, S2, which contains a 'domain 704 signature'. If local policy requires the message to be 705 encrypted, using S/MIME encryption, before it leaves the domain 706 then this new message is wrapped in an envelopedData layer, E2, 707 resulting in the following message sent out of the domain (E2 (S2 708 (S1 (Original Content)))), else the message is not wrapped in an 709 envelopedData layer resulting in the following message (S2 (S1 710 (Original Content))) being sent. 712 4. A message (S2 (E1 (S1 (Original Content)))) in which S2 includes 713 a mlExpansionHistory attribute is to have a 'domain signature' 714 applied. The signedData object S2 is verified. The 715 mlExpansionHistory attribute is found in S2, so S2 is the "outer" 716 signedData. The signed attributes in S2 are remembered for later 717 inclusion in the new outer signedData that is applied to the 718 message. S2 is stripped off and the message is decrypted. The 719 signedData object S1 is verified. The decrypted message is 720 wrapped in a signedData layer, S3, which contains a 'domain 721 signature'. If local policy requires the message to be 722 encrypted, using S/MIME encryption, before it leaves the domain 723 then this new message is wrapped in an envelopedData layer, E2. 724 A new signedData layer, S4, is then wrapped around the 725 envelopedData, E2, resulting in the following message sent out of 726 the domain (S4 (E2 (S3 (S1 (Original Content))))). If local 727 policy does not require the message to be encrypted, using S/MIME 728 encryption, before it leaves the domain then the message is not 729 wrapped in an envelopedData layer but is wrapped in a new 730 signedData layer, S4, resulting in the following message sent out 731 of the domain (S4 (S3 (S1 (Original Content). The signedData S4, 732 in both cases, contains the signed attributes from S2. 734 5. A message (S3 (S2 (E1 (S1 (Original Content))))) in which none of 735 the signedData layers include a mlExpansionHistory attribute is 736 to have a 'domain signature' applied. The signedData objects S3 737 and S2 are verified. When the envelopedData E1 is found the 738 signedData objects S3 and S2 are stripped off. The 739 encryptedContent is decrypted. The signedData object S1 is 740 verified. The decrypted content is wrapped in a new signedData 741 layer, S4, which contains a 'domain signature'. If local policy 742 requires the message to be encrypted, using S/MIME encryption, 743 before it leaves the domain then this new message is wrapped in 744 an envelopedData layer, E2, resulting in the following message 745 sent out of the domain (E2 (S4 (S1 (Original Content)))), else 746 the message is not wrapped in an envelopedData layer resulting in 747 the following message (S4 (S1 (Original Content))) being sent. 749 6. A message (S3 (S2 (E1 (S1 (Original Content))))) in which S3 750 includes a mlExpansionHistory attribute is to have a 'domain 751 signature' applied. The signedData objects S3 and S2 are 752 verified. The mlExpansionHistory attribute is found in S3, so S3 753 is the "outer" signedData. The signed attributes in S3 are 754 remembered for later inclusion in the new outer signedData that 755 is applied to the message. The signedData object S3 is stripped 756 off. When the envelopedData layer, E1, is found the signedData 757 object S2 is stripped off. The encryptedContent is decrypted. 758 The signedData object S1 is verified. The decrypted content is 759 wrapped in a new signedData layer, S4, which contains a 'domain 760 signature'. If local policy requires the message to be 761 encrypted, using S/MIME encryption, before it leaves the domain 762 then this new message is wrapped in an envelopedData layer, E2. 763 A new signedData layer, S5, is then wrapped around the 764 envelopedData, E2, resulting in the following message sent out of 765 the domain (S5 (E2 (S4 (S1 (Original Content))))). If local 766 policy does not require the message to be encrypted, using S/MIME 767 encryption, before it leaves the domain then the message is not 768 wrapped in an envelopedData layer but is wrapped in a new 769 signedData layer, S5, resulting in the following message sent out 770 of the domain (S5 (S4 (S1 (Original Content). The signedData S5, 771 in both cases, contains the signed attributes from S3. 773 7. A message (S3 (E2 (S2 (E1 (S1 (Original Content)))))) in which S3 774 does not include a mlExpansionHistory attribute is to have a 775 'domain signature' applied. The signedData object S3 is 776 verified. When the envelopedData E2 is found the signedData 777 object S3 is stripped off. The encryptedContent is decrypted. 778 The signedData object S2 is verified, the envelopedData E1 is 779 decrypted and the signedData object S1 is verified. The 780 signedData object S2 is wrapped in a new signedData layer S4, 781 which contains a 'domain signature'. Since there is an 782 envelopedData E1 lower down in the message, the new message is 783 wrapped in an envelopedData layer, E3, resulting in the following 784 message sent out of the domain (E3 (S4 (S2 (E1 (S1 (Original 785 Content)))))). 787 6. IANA Considerations 789 This document doesn't require any action from IANA. 791 7. Security Considerations 793 Implementations MUST protect all private keys. Compromise of the 794 signer's private key permits masquerade. 796 Similarly, compromise of the content-encryption key may result in 797 disclosure of the encrypted content. 799 Compromise of key material is regarded as an even more serious issue 800 for domain security services than for an S/MIME client. This is 801 because compromise of the private key may in turn compromise the 802 security of a whole domain. Therefore, great care should be used 803 when considering its protection. 805 Domain encryption alone is not secure and should be used in 806 conjunction with a domain signature to avoid a masquerade attack, 807 where an attacker that has obtained a DCA certificate can fake a 808 message to that domain pretending to be another domain. 810 When an encrypted DOMSEC message is sent to an end user in such a way 811 that the message is decrypted by the end users DCA the message will 812 be in plain text and therefore confidentiality could be compromised. 813 If the recipient's DCA is compromised then the recipient can not 814 guarantee the integrity of the message. Furthermore, even if the 815 recipient's DCA correctly verifies a message's signatures, then a 816 message could be undetectably modified, when there are no signatures 817 on a message that the recipient can verify. 819 8. References 821 8.1. Normative References 823 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 824 Requirement Levels", BCP 14, RFC 2119, March 1997. 826 [RFC2634] Hoffman, P., "Enhanced Security Services for S/MIME", RFC 827 2634, June 1999. 829 [RFC5652] Housley, R., "Cryptographic Message Syntax (CMS)", STD 70, 830 RFC 5652, September 2009. 832 [RFC5280] Cooper, D., Santesson, S., Farrell, S., Boeyen, S., 833 Housley, R., and W. Polk, "Internet X.509 Public Key 834 Infrastructure Certificate and Certificate Revocation List 835 (CRL) Profile", RFC 5280, May 2008. 837 [RFC5750] Ramsdell, B. and S. Turner, "Secure/Multipurpose Internet 838 Mail Extensions (S/MIME) Version 3.2 Certificate 839 Handling", RFC 5750, January 2010. 841 [RFC5751] Ramsdell, B. and S. Turner, "Secure/Multipurpose Internet 842 Mail Extensions (S/MIME) Version 3.2 Message 843 Specification", RFC 5751, January 2010. 845 [ASN.1] International Telecommunications Union, , "Open systems 846 interconnection: specification of Abstract Syntax Notation 847 (ASN.1)", CCITT Recommendation X.208, 1989. 849 8.2. Informative References 851 [RFC5321] Klensin, J., "Simple Mail Transfer Protocol", RFC 5321, 852 October 2008. 854 [RFC5322] Resnick, P., Ed., "Internet Message Format", RFC 5322, 855 October 2008. 857 [RFC3183] Dean, T. and W. Ottaway, "Domain Security Services using S 858 /MIME", RFC 3183, October 2001. 860 [RFC4510] Zeilenga, K., "Lightweight Directory Access Protocol 861 (LDAP): Technical Specification Road Map", RFC 4510, June 862 2006. 864 [RFC7001] Kucherawy, M., "Message Header Field for Indicating 865 Message Authentication Status", RFC 7001, September 2013. 867 Appendix A. Changes from RFC 3183 869 This document only includes domain signatures from RFC 3183 (i.e. 870 Additional Attributes Signatures and Review Signatures are not 871 mentioned). 873 Unlike RFC 3183, subject names of domain signing/encrypting X.509 874 certificates don't have to have a specific form. But Subject 875 Alternative Names need to include URIs for domain being protected. 877 Incorporated erratum 3757 resolution. 879 Updated references and some minor editorial corrections. 881 Appendix B. Acknowledgements 883 This document contains lots of text from RFC 3183. 885 Authors' Addresses 887 William Ottaway 888 QinetiQ 889 St. Andrews Road 890 Malvern, Worcs WR14 3PS 891 UK 893 EMail: wjottaway@QinetiQ.com 895 Alexey Melnikov (editor) 896 Isode Ltd 897 5 Castle Business Village 898 36 Station Road 899 Hampton, Middlesex TW12 2BX 900 UK 902 EMail: Alexey.Melnikov@isode.com