<?xml version="1.0" encoding="US-ASCII"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">
<?rfc toc="yes"?>
<?rfc rfcedstyle="yes"?>
<?rfc subcompact="no"?>
<?rfc symrefs="yes"?>
<?rfc comments="yes" ?>
<?rfc inline="yes" ?>

<rfc ipr="trust200902" category="info" docName='draft-melnikov-mmhs-authorizing-users-14'>
  <front>
    <title abbrev="Message Authorizing Header Field">
      Message Authorizing Email Header Field and its use for Draft &amp; Release
    </title>
    <author initials="A." surname="Melnikov" fullname="Alexey Melnikov">
      <organization>Isode Ltd</organization>
      <address>
	    <postal>
        <street>14 Castle Mews</street>
        <city>Hampton</city>
        <region>Middlesex</region>
        <code>TW12 2NP</code>
        <country>UK</country>
	    </postal>
	    <email>Alexey.Melnikov@isode.com</email>
      </address>
    </author>
      
    <date year="2016" />
    
    <keyword>MMHS</keyword>
    <keyword>S/MIME</keyword>
    <keyword>MIXER</keyword>
    <keyword>email</keyword>

    <abstract>
	      
    <t>
      This document describes a procedure for when an Military Message Handling System (MMHS)
      message is composed by one user
      and is only released to the mail transfer system when one or more authorizing users
      authorize release of the message by adding the MMHS-Authorizing-Users header field.
      The resulting message can be optionally signed by the sender and/or reviewer,
      allowing recipients to verify both the original signature (if any) and review signatures.
    </t>
	
    </abstract>
    
  </front>
  <middle>

    <section title="Introduction">

      <t>
      In some secure environments email messages can't be released to
      the MTS (Message Transfer System) and, thus delivered to recipients, unless
      they are authorized by one or more authorizing users (e.g. Releasing Officers or Release Authorities).
      This document describes how this mechanism can be realized by
      an additional Internet Email <xref target="RFC5322"/> header field and optionally
      protected using S/MIME <xref target="RFC5750"/> <xref target="RFC5751"/> or DKIM <xref target="RFC6376"/>.
      </t>

      <t>
      This document describes a procedure for how an email message composed by one user
      can be released to the MTS when one or more authorizing users authorize and optionally
      countersign the message. The MMHS-Authorizing-Users header field (see <xref target="MMHS-Authorizing-Users"/>)
      communicates which user(s) authorized the message.
      If S/MIME signed, the resulting message allows recipients to verify both
      the original (if any) and counter signatures.
<!--////Is the following statement true? As long as S/MIME signature is not protecting
      all header fields (with tripple wrap)?-->
      The original S/MIME signature generated by
      
<!--////Add a reference to DOMSEC draft? <xref target="I-D.melnikov-smime-msa-to-mda"/>-->
      the sender (if any) is unaffected by additional S/MIME review signatures.
    </t>
      
    </section>
    
    <section title="Conventions Used in This Document">
      
      <t>The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
	    "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in
	    this document are to be interpreted as described in
	    <xref target="RFC2119"/>.</t>
      
      <t>The formal syntax uses the <xref target="RFC5234">Augmented
	    Backus-Naur Form (ABNF)</xref> notation including the core rules
	    defined in Appendix B of <xref target="RFC5234">RFC 5234</xref>.
      Terms not defined in this document are taken from <xref target="RFC5322"/>.
      </t>

    </section>


    <section title='Draft and Release procedure'>
      
        <section title='Terminology'>

          <t>
          Drafter: Any email user that composes a message (Draft Message) needing authorisation before it is released to its intended recipients.
          </t>
          
          <t>
          Authorizing User (also Releaser or Authorizer): The mailbox of a user or a group of users that must inspect
          and authorise the release of Draft Message before it can be sent. An organization may require more than one
          Authorizing User to authorize release of a Draft Message.
          </t>

        </section>
      
        <section title='Handling of Initial Message Submission by MSA'>
        
          <t>
          The original email message to be sent doesn't include the MMHS-Authorizing-Users header field.
<!--////Too S/MIME specific?-->
          It may or may not include sender's S/MIME signature.
      
<!--For future study:
      <cref>Is this true? Is there
      any use for specifying a value for the MMHS-Authorizing-Users header field before the message
      is countersigned?</cref>
-->
          </t>

          <t>The message to be sent is first submitted over SMTP <xref target="RFC6409"/>.
          The specific mechanism for how it arrives to authorizing user(s) is not specified
          in this document. One possibility is for the Message Submission Agent (MSA) to redirect all email
          messages not addressed to authorizing users and not submitted by authorizing users
          to a preconfigured mailbox(es) that can be accessed by authorizing user(s).
          Another possibility is for the MSA to redirect all email
          messages without the MMHS-Authorizing-Users header field and/or corresponding S/MIME
          review signatures to a preconfigured mailbox(es) that can be accessed by authorizing user(s).
          </t>

          <t>
          In order to prevent a malicious sender from bypassing or altering Draft and Release procedure,
          MSA MUST check that MMHS-Authorizing-Users header field (if present) is syntactically
          valid, contains email addresses of entities authorized to act as authorizing users
          and, when review signatures are used, that every entity listed has one or more matching review signature
          (or signature) which is valid.
          </t>

        </section>

        <section title='Review by Authorizing User(s)'>
        
          <t>Each user agent that is used by an authorized user MUST perform the following steps
          (if there are multiple authorizing users, the whole sequence of steps below is repeated for each authorizing user):
          <list style='numbers'>

            <t>
            Verify the origination of the message (From/Sender header fields). The exact mechanism to do that is out of scope for
            this document, but one example is by verifying the S/MIME signature, making sure that the signature protects all header fields
            (i.e. wrapped by message/rfc822, as described in Section 3.1 of <xref target="RFC5751"/>) and
            that it matches the sender of the message, as described in <xref target="RFC5750"/>.
            Another example is by verifying a DKIM signature <xref target="RFC6376"/> (added by Drafter's MUA or MSA) that covers From/Sender header fields.
            </t>

            <t>
            Check if the message already contains the MMHS-Authorizing-Users header field with the email address of
            the authorizing user. (This can happen, for example, if email system is misconfigured and thus contains a loop, or
            if a malicious sender or attacker is trying to affect authorization procedure.)
            If the message doesn't contain the email address of the authorizing user in the MMHS-Authorizing-Users
            header field, then go to the next step.
            If MMHS-Authorizing-Users header field contains the email address of the authorizing user,
            verify validity of the header field (for example by checking for S/MIME
            signature/review signature or for DKIM signature) and also verify that the email address associated with
            the signature matches the email address of the authorizing user. If the validity of the MMHS-Authorizing-Users header field
<!--////Make sure that the step reference is correct.-->
            <!--containing the email address of the authorizing user--> can be verified, go to step 5 below.
            Otherwise
            <!--////Sean doesn't thinks that this is a good idea:
            "strip the MMHS-Authorizing-Users header field"-->,
            return the message to sender (bounce) or redirect the message to a designated abuse mailbox.
            </t>

            <t>
            Allow the authorizing user to review content of the message. Some of the checks can be automated
            (for example search for keywords). (See <xref target="encrypted-emails"/> for additional considerations.)
            If based on the check the authorizing user is happy to release
            the message to MTS (or to the next authorizing user, if multiple authorizations are required),
            the UA SHOULD enable the authorizing user to protect additions to the MMHS-Authorizing-Users
            header field, for example by allowing to add S/MIME review signature (if S/MIME is used
            for protecting MMHS-Authorizing-Users header field. See <xref target="smime-reviewsignatures"/>
            for more details).
            If the authorizing user wants to reject the message, it SHOULD be returned to drafter with an explanatory
            note or MAY be discarded. The authorizing user can also choose to forward the message to another
            authorizing user for additional approval or become a new Drafter of the message. If the authorizing user becomes
            the new Drafter, its UA MUST strip any existing email addresses from the MMHS-Authorizing-Users header field.
            </t>

            <t>
            If there is an existing MMHS-Authorizing-Users header field containing the email address of
            the authorizing user, skip this step.
            Otherwise, insert a new MMHS-Authorizing-Users header field (if absent) containing the email address of
            the authorizing user or append the email address of the authorizing user to the end of the existing
            MMHS-Authorizing-Users header field.
            </t>
        
            <t>
            The (possibly) updated email message is either released to the MTS,
            or to the next authorizing user, as per email system configuration.

            Note that if the authorizing user updates the message in a manner that invalidates existing
            S/MIME/DKIM signature(s), the authorizing user becomes the Drafter, and need to reapply any
            protections. <!--////Point to draft-andersen-arc as an option for DKIM?-->
            </t>

          </list>
          </t>

          <section title="Processing of Encrypted Messages" anchor="encrypted-emails">

            <t>
            Any encrypted message sent in an environment where Draft and Release procedure is in force
            needs to be also encrypted to all authorizing users,
            so that they can perform review of the message. If a User Agent used by an authorizing user can't decrypt the
            message, it SHOULD notify the sender (which can be the drafter or a previous authorizing user)
            about the problem using a non delivery DSN or through some other means.
            The ciphertext that cannot be decrypted by the Authorizing User MAY be included in the notification to aid debugging.
            
            <!--This can be a NDN, but as Russ pointed out,
            decrypted text should still be available to the sender. Also, there is no need to restart the process
            from the beginning if some authorizing users were able to review the message.-->
            A possible reason not to notify the sender is in order to avoid Denial-of-Service attacks, for example
            if an attacker discovers a way to inject fake messages with encryption that doesn't validate in
            order to overflow sender's INBOX.
            </t>

          </section>

          <section title='Authorizing S/MIME signatures' anchor="smime-reviewsignatures">

            <t>
            If S/MIME were not used, the Authorizing User can become the original signer of the message.
            </t>

            <t>
            If a message is signed with multiple signatures (for example using different cryptographic algorithms,
            as described in <xref target="RFC5752"/>),
       <!--////Change the SHOULD to a MUST?-->
            all of the signatures that can be verified by an authorizing user SHOULD be signed with a review signature (authorizing signatures).
            A recipient of the message can consider any chain of review signatures that matches
            MMHS-Authorizing-Users header field values as valid, only if all signatures in the chain verify.
            All of the signatures that cannot be verified MUST be stripped by the
            Authorizing User Agent.
            </t>

            <t>When triple wrapping <xref target="RFC2634"/> is used, authorizing signatures are applied to the outer
            level, so that it can be verified by MTAs without the need to decrypt content.
<!--////As per Russ: a countersignature can only be applied to an existing signature. So the first Authorizing User
will generate a regular signature, unless the message already has one at the outer level.-->
            </t>

          </section>
          
      </section>

      <section title='Role of other Messaging Agents at the sender&apos;s domain'>

        <section title='MDA at the sender&apos;s domain'>

          <t>
            If a message being sent is to be delivered within the sender's domain, Message Delivery Agents (MDAs)
            are responsible for ensuring that the message was properly authorized by authorizing user(s),
            as determined by the sender's domain email system configuration.
            They verify presence and validity of MMHS-Authorizing-Users header field in the message,
            as well as validity of associated signatures on the message.
          </t>

          <t>Note that the above requirements don't apply to direct delivery to any user designated as an Authorizing User.</t>

        </section>

        <section title='Border MTA at the sender&apos;s domain'>

          <t>Sender's domain border MTAs are responsible for ensuring that all messages that leave sender's domain
          were properly authorized by authorizing user(s), as determined by the sender's domain email system configuration.
          They verify presence and validity of MMHS-Authorizing-Users header field in outgoing messages,
          as well as validity of associated signatures on the message.
          </t>

        </section>

      </section>

    </section>

    <section title='MMHS-Authorizing-Users header field' anchor="MMHS-Authorizing-Users">

      <t>The MMHS-Authorizing-Users header field specifies the list of authorizing users (or entities(*))
         that countersigned this email message (for example using S/MIME) before it was authorized
         for release to MTS. Each user/entity is described by her/his/its email address.
      </t>

      <t>
      (*) Note that in some environments identities of authorizing users are required to be hidden from recipients
      of email messages, so upon receipt MMHS-Authorizing-Users might contain an email address associated with a group
      of possible users. Such email addresses need to have signatures that don't disclose group membership.
      </t>
	
	    <t>
        The MMHS-Authorizing-Users header field specified in this document MUST NOT appear more
        than once in message headers.
        (An email message that contains multiple MMHS-Authorizing-Users is malformed.
        An agent processing such malformed message SHOULD either return it to sender (if possible)
        or fix the message so that it only contains one copy of the header field.)
       <!--////Don't do this, unless there is a desire to change existing implementations:
        [[An alternative is to allow for multiple copies of the header field and treat them as additive.
        This might work better with DKIM!]]
       -->
      </t>

<figure><artwork type="ABNF">
  <![CDATA[
    MMHS-Authorizing-Users = "MMHS-Authorizing-Users:"
                       mailbox-list CRLF
    
    mailbox-list = <Defined in RFC 5322>
]]></artwork></figure>
	
    </section>

    <section title="Updated MIXER mapping">

      <t>
        This section provides an updated version of the MIXER mapping
        specified in <xref target="RFC2156"/> for MMHS applications.</t>

      <section title="Mapping from RFC 5322/MIME to X.400">
        
          <t>In the absence of the MMHS-Authorizing-Users header field, From and Sender
          header fields are mapped to their X.400 equivalents as specified in <xref target="RFC2156"/>.</t>

          <t>If MMHS-Authorizing-Users header field is present:
          
              <list style='numbers'>

                <t>
                If the Sender header field is present, it is mapped to
                IPMS.Heading.originator, otherwise the first From header field
                address is mapped to IPMS.Heading.originator.
                </t>

                <t>
                Map the From header field address(es) and the MMHS-Authorizing-Users
                header field address(es) to IPMS.Heading.authorizing-users,
                skipping the first From header field address if it was mapped to
                IPMS.Heading.originator.
                </t>

              </list>
            
          </t>
        
      </section>

      <section title="Mapping from X.400 to RFC 5322/MIME">

        <t>Mapping from X.400 to Internet is controlled by whether or not a particular message
        is considered to be a military message. 
        A message is considered to be a military message (as defined by
        ACP 123 <xref target="ACP123"/> and also specified in STANAG 4406 <xref target="STANAG-4406"/>)
        if there are any MMHS heading extensions present.
        Alternatively, this MAY be done by configuration (i.e. all messages can be considered
        to be military messages).
        </t>
        
        <t>
        For non military messages, mapping from X.400 as specified in <xref target="RFC2156"/> is used.
        </t>

        <t>For military messages, the following mapping is used:

          <list style='numbers'>

            <t>
            IPMS.Heading.originator is mapped to From header field.
            </t>

            <t>
            The IPMS.Heading.authorizing-users is mapped to MMHS-Authorizing-Users header field.
            </t>

          </list>

        </t>

      </section>
      
    </section>

    <section title="IANA Considerations">

      <t>
        IANA is requested to add the MMHS-Authorizing-Users header field specified
        in <xref target="MMHS-Authorizing-Users"/> to the
        "Provisional Message Header Field Names", defined by
        Registration Procedures for Message Header Fields <xref target="RFC3864"/>.
        The registration template is as follows:
      </t>

      <t>Header field name: MMHS-Authorizing-Users<vspace blankLines='1'/>
      Applicable protocol: mail (<xref target="RFC5322"/>)<vspace blankLines='1'/>
      Status: provisional<vspace blankLines='1'/>
      Author/Change controller: Alexey Melnikov &lt;alexey.melnikov@isode.com&gt;<vspace blankLines='1'/>
      Specification document(s): [[RFC XXXX]]<vspace blankLines='1'/>
      Related information:</t>
	
    </section>

    <section title="Security Considerations" anchor="seccons">

      <t>
      In some military environments, the identities of authorizing users
      are required to be hidden from recipients of email messages.  This
      can be accomplished by using a group address for the MMHS-Authorizing-Users.
      In this way, the recipient will know that it was
      released by an Authorizing User in that group, but the recipient
      will not know which one of them took the action.
      </t>

      <t>For those organizations that wish to not disclose authorizing users' group membership,
      care must also be taken to ensure the information included in the certificate
      used for signing email messages does not disclose individuals in the group.</t>

      <t>Further security considerations are described in subsections of this section.</t>

<!--////Also think about how changes to the MMHS-Authorizing-Users header field would interact
with any mechanism used to protect header fields of the message.
MMHS-Authorizing-Users should not be signed with DKIM/etc, unless it is done by the last authorizing user?
Actually this is not a problem, if the next authorizing user can verify DKIM review signature before destroying it
by modifying the MMHS-Authorizing-Users header field.
Is this a Security Consideration?-->

      <section title="Forged Header Fields">

          <t>
          A malicious sender may add/change an MMHS-Authorizing-Users header field to bypass
          or alter the message authorization procedure invoked for messages with no
          MMHS-Authorizing-Users header field. For that reason it is important
          for agents and clients that rely on the validity of the MMHS-Authorizing-Users header field
          to also verify the review signature (or a similar protection mechanism),
          that confirms that a particular person or entity authorized release
          of a message.
<!--Similar to the above, but with slightly different emphasize:
          Agents or clients that don't verify review signatures can be tricked
          into believing that the release of the message was correctly authorized,
          which could lead to potentially making false conclusions based on
          forged header fields.
-->
          <!--
          For example if MMHS-Authorizing-Users header field is updated by a "trusted"
          machine and such machine is compromised, ...
          -->
          </t>

      </section>

      <section title="Intentionally Malformed Header Fields">

          <t>
          It is possible for an attacker to add an MMHS-Authorizing-Users
          header field that is extraordinarily large or otherwise malformed in
          an attempt to discover or exploit weaknesses in header field parsing
          code.  Implementations MUST thoroughly verify all such header fields
          received from MTAs and be robust against intentionally as well as
          unintentionally malformed header fields.
          </t>

      </section>

<!--      
      <section title="Compromised Internal Hosts">

        <t>
        An internal MUA or MTA that has been compromised could generate mail
  ////Wouldn't that require compromise of a key used by an authorizing user, which is a bigger concern anyway?
        with a forged MMHS-Authorizing-Users header field.  Although it is clearly a larger
        concern to have compromised internal machines than it is to prove the
        value of this header field, this risk can be mitigated by arranging
        that internal MTAs will remove this header field if it claims to have
        been added by a trusted border MTA (as described above), yet the
        [SMTP] connection is not coming from an internal machine known to be
        running an authorized MTA.  However, in such a configuration,
        legitimate MTAs will have to add this header field when legitimate
        internal-only messages are generated.
        </t>

      </section>
-->

    </section>

<!--
    <section title="Open Issues">

      <t>Netnews Approved header field has the same syntax and semantics as the one described here.
      Should it be used (and be formally registered for email) instead?</t>

///Don't do that, possibly save this for a future revision. Use a different header field for this!
      <t>Allow use of MMHS-Authorized-Users/Approved for specifying
      who should authorize release of the message (as opposed to just for recording of
      who authorized release so far)?</t>

    </section>
-->

  </middle>
  <back>
    <references title="Normative References">
      <?rfc include="reference.RFC.2119"?> <!-- Keywords -->
      <?rfc include="reference.RFC.2156"?> <!-- MIXER -->
      <?rfc include="reference.RFC.5322"?> <!-- Email -->
      <?rfc include="reference.RFC.6409"?> <!-- Submission Service -->
      <?rfc include="reference.RFC.5234"?> <!-- ABNF -->
<!-- CMS
      <?rfc include="reference.RFC.5652"?>
-->
      <?rfc include="reference.RFC.2634"?> <!-- Tripple Wrapping, etc -->
      <?rfc include="reference.RFC.5750"?> <!-- S/MIME 3.2 - Certificate Handling -->
      <?rfc include="reference.RFC.5751"?> <!-- S/MIME 3.2 - Message Specification -->
      <?rfc include="reference.RFC.6376"?> <!-- DKIM -->

      <reference anchor="ACP123">
        <front>
          <title>Common Messaging strategy and procedures</title>

          <!--CCEB == COMBINED COMMUNICATIONS-ELECTRONICS BOARD-->
          <author fullname="CCEB">
            <!--
			<organization></organization>
-->
          </author>

          <date month="May" year="2009" />
        </front>

        <seriesInfo name="ACP" value="123(B)" />
        <format target="http://jcs.dtic.mil/j6/cceb/acps/acp123" type="HTML" />

      </reference>

    </references>

    <references title="Informative References">
      
      <?rfc include="reference.RFC.3864"?> <!-- Header Field Registration procedure -->
      
      <reference anchor="STANAG-4406">
        <front>
          <title>STANAG 4406 Edition 2: Military Message Handling System</title>
          <author fullname="NATO">
          </author>
          <date month="March" year="2005"/>
        </front>

        <seriesInfo name="STANAG" value="4406 Ed. 2"/>
      </reference>
      
      <reference anchor="I-D.melnikov-smime-msa-to-mda">
        <front>
          <title>Domain-based signing and encryption using S/MIME</title>
          <author initials="W" surname="Ottaway" fullname="William Ottaway">
            <organization/>
          </author>
          <author initials="A" surname="Melnikov" fullname="Alexey Melnikov">
            <organization/>
          </author>
          <date month="March" day="5" year="2014"/>
          <abstract>
            <t>
              The S/MIME protocols Message Specification (RFC 5751), Cryptographic Message Syntax (RFC 5652), S/MIME Certificate Handling (RFC 5750) and Enhanced Security Services for S/MIME (RFC 2634) specify a consistent way to securely send and receive MIME messages providing end to end integrity, authentication, non-repudiation and confidentiality. This document identifies a number of interoperability, technical, procedural and policy related issues that may result in end-to-end security services not being achievable. To resolve such issues, this document profiles domain-based signing and encryption using S/MIME, such as specifying how S/MIME signing and encryption can be applied between a Message Submission Agent (MSA) and a Message Delivery Agent (MDA) or between 2 Message Transfer Agents (MTA). This document is also registering 2 URI scheme: "smtp" and "submit" which are used for designating SMTP/SMTP Submission servers (respectively), as well as SMTP/Submission client accounts.
            </t>
          </abstract>
        </front>
        <seriesInfo name="Internet-Draft" value="draft-melnikov-smime-msa-to-mda-04"/>
        <format type="TXT" target="http://www.ietf.org/internet-drafts/draft-melnikov-smime-msa-to-mda-04.txt"/>
      </reference>

      
      <?rfc include="reference.RFC.5752"?> <!-- Multiple Signatures in CMS -->
      
    </references>

    <section title="Acknowledgements">

      <t>Many thanks for reviews and text provided by Steve Kille, Jim Schaad, Russ Housley, David Wilson, Chris Bonatti and Sean Turner.</t>

      <t>Some text in this document was copied from RFC 7001.</t>

    </section>
  </back>
</rfc>
