<?xml version="1.0" encoding="utf-8"?>

<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
  <!ENTITY rfc2629 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.2629.xml'>
  <!ENTITY RFC1035 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.1035.xml">
  <!ENTITY RFC2119 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml">
  <!ENTITY RFC2629 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2629.xml">
  <!ENTITY RFC5280 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.5280.xml">
  <!ENTITY RFC3552 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.3552.xml">
  <!ENTITY RFC3642 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.3642.xml">
  <!ENTITY RFC4033 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.4033.xml">
  <!ENTITY RFC4055 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.4055.xml">
  <!ENTITY RFC4648 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.4648.xml">
  <!ENTITY RFC5395 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.5395.xml">
  <!ENTITY RFC4366 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.4366.xml">
]>
<?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?>
<?rfc strict="yes" ?>
<?rfc toc="yes"?>
<?rfc tocdepth="4"?>
<?rfc symrefs="yes"?>
<?rfc sortrefs="yes" ?>
<?rfc compact="yes" ?>
<?rfc subcompact="no" ?>
<rfc category="std" docName="draft-hallambaker-httpintegrity-01" ipr="trust200902">

  <front>
    <title abbrev="HTTP Integrity Header">HTTP Integrity Header</title>
    <author fullname="Phillip Hallam-Baker" initials="P. M." surname="Hallam-Baker">
      <organization>Comodo Group Inc.</organization>
      <address>
        <email>philliph@comodo.com</email>
      </address>
    </author>

    <date day="19" month="October" year="2012" />

    <area>General</area>

    <workgroup>Internet Engineering Task Force</workgroup>

    <abstract>
      <t>
        The HTTP Integrity header provides a means of authenticating HTTP requests and responses
        using a Message Authentication Code (MAC). This document defines the HTTP integrity header
        and specifies its use to authenticate and verify specific parts of an HTTP message.
        the means by which the symmetric or asymmetric keys used to authenticate the messages 
        is outside the scope of this document.
      </t>

    </abstract>
  </front>

  <middle>
    <section title="Introduction">
      <t>
        The HTTP Integrity header provides a simple and effective means of authenticating 
        components of a HTTP transaction at the HTTP Application layer without disclosure
        of the secret(s) used as the basis for authentication.
      </t>
      <t>
        This approach has considerable advantages over the traditional approaches of using
        HTTP Cookies containing an authentication secret, embedding authentication data 
        within the HTTP message content or relying on TLS integrity checks alone.
      </t>
      <t>
        The Integrity header provides an equivalent
        security functionality to the use of authentication cookies without the vulnerabilities
        intrinsic to the use of static authentication secrets that are disclosed to the
        verifying party en-clair to effect verification.
      </t>
      <t>
        Use of a HTTP header to provide integrity information offers a simpler and more flexible
        approach than use of schemes such as PKCS#7/CMS, XML Signature or JSON Signature. 
        The chief technical challenge in such specifications being to reliably identify the
        exact scope of the data being signed and the form of encoding. Moving the integrity 
        check to a HTTP header permits the scope of the signature to be defined as the 
        scope of the HTTP content body and the encoding to be the HTTP transport encoding.
      </t>
      <t>
        Use of the HTTP Intergity header permits the same mutual authentication guarantees
        provided by TLS client authentication without the need to provision client certificates
        and with considerably less complexity.
      </t>
      <t>
        For simplicity, the HTTP Integrity header is strictly limited to identifying a 
        security context, the HTTP transaction item(s) to be authenticated and the 
        resulting authentication value. The means of establishing the keys and algorithms
        that make up the security context are outside the scope of this document.
      </t>
      <t>
        In the typical case the security context identifier is a ticket (c.f. Kerberos)
        that contains the account identifier, shared secret(s) and algorithm identifier
        required a Web Service protocol or Web Browser Authentication protocol. This
        approach permits a stateless server design in which the server does not
        store per-account keys.
      </t>
      <section title="Use in Web Services">
        <t>
          The HTTP Integrity header was originally developed to simplify implemenatation of
          Web Services. Using the SOAP approach a Web Service message is encoded in XML, wrapped in 
          a SOAP envelope and a WS-Security header with an XML Signature attached. The whole 
          package is then attached to a HTTP message as a content payload.
        </t>
        <t>
          This approach involves a considerable degree of complexity and in most cases achieves
          nothing more than attaching an integrity check. Carrying the integrity check as a HTTP
          header eliminates the need for the SOAP and WS-Security layers entirely. For example,
          the following example is a HTTP request in the Omnibroker connectin protocol.
        </t>
        <figure>
          <artwork>
<![CDATA[Post / HTTP/1.1
Host: example.com
Cache-Control: no-store
Content-Type: Application/json;charset=UTF-8
Content-Length: 78
Integrity: content=true;
    value=cjkMkfnnYP8JYWZAbRLvtpqImmOK3rsrOT1XcvAgHDk=;
    id=TUMnorO0SjHHS7D2uFcGlRYJ0Hd3eibwe0ogptoNMQuCYmCHfHAJcJlyvi
      j8WoXDglTSOkctnmoBzl8W0NLSlcgSyZcmsAyoWs8y1Rn2ZlO2WBgoWrFIOqPa4 
      oB29dgs/ei6ieINZtmvXNCm2NUkWA==

{
"TicketRequest": {
"ChallengeResponse": "TctLOG74cwpm26YNpEibcQ=="}}]]>
</artwork>
</figure>
        <t>
          A single HTTP message MAY have multiple Integrity headers. This facilitates support
          for multi-party transactions in which A submits a transaction to B who countersigns it
          and passes it to C who is required to chek that she has proof of agreement by both
          A and B.
        </t>
        <t>
          Use of the Integrity header permits the developer to isolate integrity and
          authentication checks to a single point of control, as is advised by best security
          practice. The security monitor examines a HTTP message, verifies that the
          required integrity data is present and correct and only passes the payload on for
          processing by the Web Service itself if and only if the verification checks have 
          been passed.
        </t>
      </section>
      <section title="User Authentication">
        <t>
          Use of the HTTP Intgerity header addresses the most challenging  problem
          facing the designers of SAML, OpenID and OAUTH, this being binding the established
          authentication context to the HTTP messages sent by the authenticated parties.
          The problem is difficult because the protocols are designed to interoperate
          with legacy browsers. Providing explicit support for an integrity check in the 
          HTTP protocol would require browsers with native support for the authentication
          mechanism but greatly reduce the complexity of providing this support.
        </t>
      </section>  
    </section>


    <section title="Syntax and options">
      <section title="Attribute id=[base64(value)]">
        <t>
          The ticket attribute identifies the security context under which the authentication 
          value has been generated. The attribute is an opaque sequence of octets in base64 encoding.
        </t>
      </section>
      <section title="Attribute nonce=[base64(value)]">
        <t>
          Specifies a nonce value to be used in combination with the specified scope.
        </t>
      </section>
      <section title="Attribute value=[base64(value)]">
        <t>
          The mac attribute specifies the value resulting from applying the security context 
          and nonce (if present) to 
          the specified scope.
        </t>
        <t>
          The scope is specified by the start, header and content attributes. The order in which the
          scope attributes are specified is immaterial. The scope is always constructed in the
          same order as the elements occur in a HTTP message, i.e. start, headers and content.
        </t>
      </section>
      <section title="Attribute content=[true|false]">
        <t>
          If set true, the specified scope includes the message body. The content transfer encoding 
          (e.g. chunked) is ignored for the purpose of determining the content.
        </t>
      </section>
      <section title="Attribute start=[true|false]">
        <t>
          If set true, the specified scope includes the message start line. This being the request Line in
          the case of a request and the status line in the case of a response.
        </t>
      </section>
      <section title="Attribute header=[escaped(headers)]">
        <t>
          Specifies HTTP headers to be included in the specified scope following the 
          escaped encoding defined in DKIM.
        </t>
      </section>

    </section>


 

      <section title="Security Considerations">
        <section title="Data outside the specified scope is not authenticated">
          <t>
            The integrity check only extends to the portions of the message that
            are within the specified scope.
          </t>
        </section>
        <section title="Truncated Hash Algorithms">
          <t>
            If the security context permits the use of a truncated MAC, it 
            MUST specify the minimum length of the MAC after truncation and
            verifiers MUST reject MAC values shorter than that length as invalid.
          </t>
        </section>
        <section title="Randomness of Secret Keys and nonces">
          <t>
            The security of any cryptographic protocol relies on the difficulty
            of guessing secret keys. Secret keys and nonces SHOULD be generated
            using a mechanism that ensures that the range of possible values
            is sufficiently large to prevent 'brute force' guessing attacks.
            (see that RFC of EKR's)
          </t>
        </section>
        <section title="Weak Ciphers">
          <t>
            Specification of the cryptographic algorithms used to construct the 
            Integrity header value is implicit in the Security context identifier 
            and thus outside the scope of this specification.
          </t>
        </section>        
    </section>
    <section title="IANA Considerations">
      <t>
        Add the 'Integrity' header to the list of provisional HTTP headers.
      </t>
      <t>
        [Upgrade if/when this becomes an RFC]
      </t>
    </section>
  </middle>
  <back>


    <references title="Normative References">
      &RFC2119;
    </references>
  </back>
</rfc>   