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

<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [

    <!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-tlssecuritypolicy-02" ipr="trust200902">

    <front>
        <title abbrev="X.509v3 Extension: OCSP Stapling Required">X.509v3 Extension: OCSP Stapling Required</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>

        <keyword>X.509</keyword>
        <keyword>PKIX</keyword>
        <keyword>OCSP</keyword>
 
        <abstract>
            <t>
              The purpose of the TLS Security Policy extension is to prevent downgrade
              attacks that are not otherwise prevented by the TLS protocol.
              In particular, the TLS Security Policy extension may be used to mandate
              support for revocation checking features in the TLS protocol such as
              OCSP stapling. Informing clients that an OCSP status response will 
              always be stapled permits an immediate failure in the case that the
              response is not stapled. This in turn prevents a denial of service 
              attack that might otherwise be possible.
            </t>
        </abstract>
    </front>

  <middle>
    <section title="Definitions">
      <section title="Requirements Language">
        <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">RFC 2119</xref>.
        </t>
      </section>

    </section>
    <section title="Purpose">
      <t>
        The purpose of the TLS Security Policy extension is to prevent downgrade
        attacks that are not otherwise prevented by the TLS protocol.
      </t>
      <t>
        Since the TLS protocol itself provides strong protection against most
        forms of downgrade attack, the TLS Security Policy is only
        relevant to the validation of TLS protocol credentials. In particular
        to the revocation status of the credentials presented.
      </t>

      <t>
        At the time of writing, the only TLS feature that is relevant to the
        revocation status of credentials is the Certificate Status Request
        extension (status_request) used to support in-band exchange of
        OCSP tokens, otherwise known as OCSP stapling. This extension is
        described in <xref target="RFC4366">RFC 4366</xref>.
      </t>
      <t>
        The TLS Security Policy
        mechanism described in this document is designed to support policy statements
        that prevent a downgrade attack against the current OCSP stapling mechanism 
        and possible future certificate revocation mechanisms
        such as stapling of multiple OCSP tokens.
      </t>
      <t>
        The OCSP stapling mechanism described in <xref target="RFC4366">RFC 4366</xref>
        permits a TLS server to provide evidence of valid certificate
        status inband and thus improve client response.
        A TLS Security Policy that advertises the status_request extension
        informs a client that if the status_request is specified in a TLS Client Helo,
        that a server compliant with the policy MUST respond with a valid OCSP token 
        for the End Entity Certificate it presents.
      </t>
      <t>
        Use of the TLS Security Policy extension in this fashion permits 
        a client to avoid reliance on
        certificates that are revoked for the reasons that occur most frequently.
        In particular it allows a client to avoid
        mis-reliance on certificates that are revoked for cause or at the request
        of the subject (e.g. because of a compromised private key).
      </t>
      <t>
        Advertising the status_request extension permits a client to fail immediately
        in the case that the token is not provided by the server without the need to 
        query the OCSP responder in addition. This improves client efficiency and more
        importantly prevents a denial of service attack against the client by either blocking
        the OCSP response or mounting a denial of service attack against the OCSP responder.
      </t>
      <t>
        Since the TLS Security Policy extension is an option, it is not likely that an
        attacker attempting to obtain a certificate through fraud  will choose to
        have a certificate issued with this extension. Such risks are more
        approrpriately addressed by mechanisms such as Certificate Authority
        Authorization records that are designed to prevent or mitigate
        mis-issue. Nevertheless a Certification Authority MAY consider the
        presence or absence of a required security policy as one factor in determining
        the level of additional scruitiny a request should be subject to.
      </t>

     
      <t>
        Any security policy specified in an End Entity certificate MUST be 
        followed by the 
        server or clients MAY refuse connection. It is important therefore that
        a Certification Authority only issue certificates that specify policies 
        that match the configuration of the server and that the server is
        capable of verifying that its configuration is compatible with the 
        security policy of the certificates it offers. Ideally, the TLS 
        security policy would be specified by the client as part of the 
        certificate issue process.
      </t>
      <t>
        This document describes a mechanism that MAY be used to provide this
        communication in-band for the most commonly used certificate registration
        protocol.
      </t>


    </section>
    <section title="Syntax">
      <t>
        The TLS Security Policy extension has the following format:
      </t>

      <figure>
        <artwork>
          <![CDATA[cabf-tls-security-policy OBJECT IDENTIFIER ::=  { cabf 1 }

SecurityPolicy ::= SEQUENCE {
    minVersion       [0]     INTEGER,
    extensions       [1]     SEQUENCE OF INTEGER OPTIONAL}
]]>
        </artwork>
      </figure>
      <t>
        The TLS Security Policy Extension MAY be marked critical. Implementations that 
        process the extension MUST ignore the criticality bit setting.
      </t>

      <section title="minVersion">
        <t>
          The minVersion element constrains the minimum version of the TLS protocol 
          to be offered.
        </t>
        <t>
          If a client that supports processing of the TLS Security Policy Extension
          is presented with a certificate that specifies a higher minimum version 
          number than that specified, the client MUST conclude that a security policy
          violation has occurred.
        </t>
        <t>
          The minimum version number is specified as follows.
          <list style="hanging" hangIndent="6">
            <t hangText="1">To be compliant with the policy a server MUST offer TLS 
                  version 1.0 or higher</t>
            <t hangText="2">
              To be compliant with the policy a server MUST offer TLS
              version 1.1 or higher
            </t>
            <t hangText="3">
              To be compliant with the policy a server MUST offer TLS
              version 1.2 or higher
            </t>
            <t hangText="n">
              To be compliant with the policy a server MUST offer a TLS
              connection that specifies a version identifier of {3, m} 
              where m >= n.
            </t>            
          </list>
        </t>
        <t>
          For historical reasons, TLS version 1.0 uses the protocol identifer {3,1}, 
          TLS version 1.1 the identifier {3,2} and so on. The minVersion specifier is
          defined for consistency with the internal TLS protocol rather than the 
          descriptive name.
        </t>
        <t>
          It will be noted that this approach does not support major version number
          increments. This is intentional since a major version number increment 
          signals an incompatible change to the specification which would almost 
          certainly require a new Security Policy extension to be defined.
        </t>
      </section>
 
      <section title="extensions">
        <t>
          The extensions element lists a sequence of TLS extension identifiers that a
          server compliant with the policy MUST support and accept on client request.
        </t>
        <t>
          This specification does not require a TLS client to offer or support
          any TLS extension regardless of whether it is specified in the TLS
          Security Policy or not. In particular a client MAY request and a server
          MAY support any TLS extension regardless of whether it is specified
          in a TLS security extension or not.
        </t>
        <t>
          If a TLS Security Policy extension specifies a TLS extension, a server
          offering the certificate MUST support the extension specified and MUST
          comply with any specific requirements specified for that extension
          in this document or in the document that specifies the TLS extension.
        </t>

        <section title="status_request">
          <t>
            If the TLS status_request extension is specified in the TLS Security Policy
            extension and a TLS client specifies the status_request extensionin the Client 
            Hello, a server MUST return a valid OCSP token for the specified End
            Entity certificate in the response.
          </t>
        </section>
      </section>

      <section title="Use">
        <section title="Certificate Signing Request">
          <t>
            If the certificate issue mechanism makes use of the PKCS#10 Certificate
            Signing Request (CSR) <xref target="RFC4366">RFC 4366</xref>, the CSR
            MAY specify a TLS Security Policy extension as a CSR attribute. A server
            or server administration tool should only generate key signing requests
            that it knows can be supperted by the server for which the certificate is
            intended.
          </t>
        </section>
        <section title="Certificate Signing Certificate">
          <t>
            When present in a Certificate Signing Certificate, the TLS Security Policy
            extension specifies a constraint on valid certificate chains. Specifically,
            a certificate chain is only valid if each certificate in the chain 
            specifies a TLS Security Policy that is at least as restrictive as that 
            specified in the certificate for the key used to sign it.
          </t>
          <t>
            While relying clients MAY reject certificates that do not comply with this
            particular requirement, the use of TLs Security Policy in Certificate Signing 
            Certificates is primarily intended for use by parties seeking 
            to evaluate the performance of certificate issuers and MAY be ignored by 
            clients.
          </t>
        </section>
        <section title="End Entity Certificate">
          <t>
            When specified in an End Entity Certificate, the TLS Security Policy 
            extension specifies criteria that a server MUST meet to be compliant
            with the policy.
          </t>
          <t>
            In the case that a client determines that the server configuration is
            inconsistent with the specified policy it MAY reject the TLS configuration.
          </t>
          <t>
            In the case that a client determines that the server configuration is
            inconsistent with a policy specifying support for the TLS status_request 
            extension it SHOULD reject the TLS configuration.
          </t>
        </section>
      </section>
      <section title="Processing">
        <section title="Certification Authority">
          <t>
            A CA SHOULD NOT issue certs with the extension unless there is an
            affirmative statement to the effect that stapling is requested.
          </t>
          <t>
            For example the use of the extension in the CSR or through an out of band
            communication.
          </t>
        </section>
        <section title="Server">
          <t>
            A server SHOULD verify that its configuration is compatible with the 
            TLS Security Policy extension expressed in a certificate it presents. A server
            MAY override local configuration options if necessary to ensure consistency
            but SHOULD inform the administrator whenever such an inconsitency is discovered.
          </t>
          <t>
            A server SHOULD NOT override local configuration options to offer use of
            cipher suites that have been otherwise deprecated as insecure but MAY override
            local configuration to offer stronger cipher suites that would otherwise have 
            been the case. For example, a server that would normally only offer DES might offer
            3DES but not vice versa.
          </t>
          <t>
            A server SHOULD support generation of the extension in CSRs if key generation is
            supported.
          </t>
        </section>
        <section title="Client">
          <t>
            A compliant client MUST process the TLS Security Policy Extension and
            MUST ignore the setting of the X.509 criticality flag.
          </t>
          <t>
            A compliant client SHOULD reject a TLS connection
            with security properties that are inconsistent with the specified 
            TLS Security Policy extension.
            A compliant client MAY accept such a TLS connection request however
            if it is determined that doing so is appropriate in particular 
            circumstances.
          </t>
        </section>
      </section>
    </section>
    <section title="Acknowledgements">
      <t>
        [List of CABForum and PKIX contributors]
      </t>
    </section>
    <section title="Security Considerations">
      <section title="Alternative Certificates and Certificate Issuers">
        <t>
          Use of the TLS Security Policy to mandate support for a particular
          form of revocation checking is optional. This control can provide 
          protection in the case that a certificate with a TLS Security Policy
          is compromised after issue but not in the case that the attacker 
          obtains an unmarked certificate from an issuer through fraud.
        </t>
        <t>
          TLS Security Policy is a post-issue security control. Such risks
          can only be addressed by security controls that take effect before issue.
        </t>
      </section>
      <section title="Denial of Service">
        <t>
          A certificate Issuer could issue a certificate that intentionally
          specified a security policy that they knew the server could not support.
        </t>
        <t>
          The risks of such refusal would appear to be negligible since a
          Certificate Authority could equally refuse to issue the certificate.
        </t>
      </section>
      <section title="Cipher Suite Downgrade Attack">
        <t>
          The TLS Security Policy extension does not provide protection
          against a cipher suite downgrade attack. This is left to the 
          existing controls in the TLS protocol itself.
        </t>
      </section>
    </section>

    <section title="For discussion.">
      <t>
        [RFC EDITOR: DELETE PRIOR TO PUBLICATION]
      </t>
      <t>
        During the design of the extension, various proposals were made to
        add functionality. This section explains the reasons that
        particular functionality was chosen to be supported. It should be deleted
        by the RFC editor prior to publication.
      </t>
      <section title="Cipher Suite Downgrade Attack">
        <t>
          The TLS protocol provides controls designed to prevent a cipher suite
          downgrade attack. Should these be found to be inadequate, the appropriate 
          response would be a modification of the TLS protocol and assignment of a 
          new minor version number or a required extension.
        </t>
      </section>
      <section title="Remove Version attribute">
        <t>
          The TLS protocol arguably provides a sufficient degree of protection
          against a version number downgrade attack and thus it could be argued that 
          this particular attribute is unnecessary. 
        </t>
        <t>
          The reason the attribute was included is that it provides a failsafe
          for the single most important aspect of the protocol. While TLS is intended
          to be secure against downgrade attack this is not established by means
          of a formal proof, nor is it likely that such proof would be possible without
          making assumptions as to the security of the cryptographic algorithms 
          used to authenticate packets.
        </t>
        <t>
          Another argument for including the version is that the arguments that
          apply to TLS version downgrade attacks may not apply to other protocols
          for which security policy extensions are defined and it is probably useful to
          have some consistency in approach.
        </t>
      </section>
      <section title="Mandated client behavior">
        <t>
          Many certificate issuers (including this one) would like to mandate
          a particular set of client behavior when a certificate is processed.
          For example, requiring that a certificate 'hard fail' in cases where the
          server is unable to obtain OCSP status. 
        </t>
        <t>
          Desirable though this functionality is to certificate issuers, it
          is hard to see how client providers are likely to provide support. In 
          particular the browser providers are already aware that CAs would prefer that 
          they 'hard fail' on OCSP status. Will expressing that request in a 
          certificate make them any more likely to comply?
        </t>
      </section>
      <section title="OCSP Analog">
        <t>
          A related extension for OCSP may also be useful. In particular an
          OCSP security policy extension might specify that the service supported
          particular OCSP extensions such as the digest locator.
        </t>
      </section>
      <section title="Other protocols and applications">
        <t>
          Should we describe a similar extension for code signing?
        </t>
        <t>
          While such an extension would clearly be useful, execution would require
          a specification for code signing to refer to. 
        </t>
      </section>
    </section>
    <section title="IANA Considerations">
      <t>
        No action by IANA is required.
      </t>
    </section>

  </middle>



    <back>
        <references title="Normative References">
            &RFC1035;
            &RFC2119;
          &RFC4366;

            <reference anchor="X.509">
                <front>
                    <title>
                        ITU-T Recommendation X.509 (11/2008): Information
                        technology - Open systems interconnection - The
                        Directory: Public-key and attribute certificate
                        frameworks
                    </title>
                    <author>
                        <organization>
                            International Telecommunication Union
                        </organization>
                    </author>
                    <date month="November" year="2008"/>
                </front>
                <seriesInfo name="ITU-T Recommendation" value="X.509"/>
                <format type="HTML" target="http://www.itu.int/itu-t/recommendations/rec.aspx?rec=X.509"/>
            </reference>
            <reference anchor="X.680">
                <front>
                    <title>
                        ITU-T Recommendation X.680 (11/2008): Information
                        technology - Abstract Syntax Notation One (ASN.1):
                        Specification of basic notation
                    </title>
                    <author>
                        <organization>
                            International Telecommunication Union
                        </organization>
                    </author>
                    <date month="November" year="2008"/>
                </front>
                <seriesInfo name="ITU-T Recommendation" value="X.680"/>
                <format type="HTML" target="http://www.itu.int/itu-t/recommendations/rec.aspx?rec=X.680"/>
            </reference>

        </references>
        <!--<references title="Non Normative References">

        </references>-->



    </back>
</rfc>
