<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE rfc [
  <!ENTITY nbsp    "&#160;">
  <!ENTITY zwsp   "&#8203;">
  <!ENTITY nbhy   "&#8209;">
  <!ENTITY wj     "&#8288;">
]>


<rfc xmlns:xi="http://www.w3.org/2001/XInclude" ipr="trust200902" docName="draft-ietf-stir-enhance-rfc8226-05" number="9118" updates="8226" obsoletes="" submissionType="IETF" category="std" consensus="true" xml:lang="en" tocInclude="true" sortRefs="true" symRefs="true" version="3">

  <!-- xml2rfc v2v3 conversion 3.9.1 -->

 
  <front>
    <title abbrev="EnhancedJWTClaimConstraints">Enhanced JSON Web Token (JWT) Claim Constraints for Secure Telephone Identity Revisited (STIR) Certificates</title>
<seriesInfo name="RFC" value="9118"/>
    <author initials="R." surname="Housley" fullname="Russ Housley">
      <organization abbrev="Vigil Security">Vigil Security, LLC</organization>
      <address>
        <postal>
          <street>516 Dranesville Road</street>
          <city>Herndon</city>
	  <region>VA</region>
          <code>20170</code>
          <country>United States of America</country>
        </postal>
        <email>housley@vigilsec.com</email>
      </address>
    </author>
    <date year="2021" month="August"/>
    <area>ART</area>
    <workgroup>STIR</workgroup>
    <keyword>X.509 Certificate Extension</keyword>
    <abstract>
      <t>RFC 8226 specifies the use of certificates for Secure Telephone Identity
Credentials; these certificates are often called "Secure Telephone Identity 
Revisited (STIR) Certificates".
RFC 8226 provides a certificate extension to constrain the JSON Web Token
(JWT) claims that can be included in the Personal Assertion Token (PASSporT),
as defined in RFC 8225.  If the PASSporT signer includes a JWT claim outside
the constraint boundaries, then the PASSporT recipient will reject the entire
PASSporT. This document updates RFC 8226; it provides all of the capabilities
available in the original certificate extension as well as an additional way
to constrain the allowable JWT claims.  The enhanced extension can also
provide a list of claims that are not allowed to be included in the PASSporT.</t>
    </abstract>
  </front>
  <middle>
    <section anchor="intro" numbered="true" toc="default">
      <name>Introduction</name>
      <t>The use of certificates <xref target="RFC5280" format="default"/> in establishing authority over
telephone numbers is described in <xref target="RFC8226" format="default"/>.  These certificates are
often called "STIR Certificates".  STIR certificates are an important
element of the overall system that prevents the impersonation of
telephone numbers on the Internet.</t>
      <t><xref target="RFC8226" sectionFormat="of" section="8"/> provides a certificate extension to constrain
the JSON Web Token (JWT) claims that can be included in the Personal
Assertion Token (PASSporT) <xref target="RFC8225" format="default"/>.  If the PASSporT signer includes
a JWT claim outside the constraint boundaries, then the PASSporT recipient
will reject the entire PASSporT.</t>
      <t>This document defines an enhanced JWTClaimConstraints certificate extension,
which provides all of the capabilities available in the original certificate
extension as well as an additional way to constrain the allowable JWT
claims.  That is, the enhanced extension can provide a list of claims that
are not allowed to be included in the PASSporT.</t>
      <t>The Enhanced JWT Claim Constraints certificate extension is needed to limit
the authority when a parent STIR certificate delegates to a subordinate STIR
certificate.  For example, <xref target="RFC9060" format="default"/> describes the
situation where service providers issue a STIR certificate to enterprises or
other customers to sign PASSporTs, and the Enhanced JWT Claim Constraints
certificate extension can be used to prevent specific claims from being
included in PASSporTs and accepted as valid by the PASSporT recipient.</t>
      <t>The JWT Claim Constraints certificate extension defined in <xref target="RFC8226" format="default"/>
provides a list of claims that must be included in a valid PASSporT as well
as a list of permitted values for selected claims.  The Enhanced JWT Claim
Constraints certificate extension defined in this document includes those
capabilities and adds a list of claims that must not be included in a
valid PASSporT.</t>
    </section>
    <section anchor="terms" numbered="true" toc="default">
      <name>Terminology</name>
        <t>
    The key words "<bcp14>MUST</bcp14>", "<bcp14>MUST NOT</bcp14>", "<bcp14>REQUIRED</bcp14>", "<bcp14>SHALL</bcp14>", "<bcp14>SHALL
    NOT</bcp14>", "<bcp14>SHOULD</bcp14>", "<bcp14>SHOULD NOT</bcp14>", "<bcp14>RECOMMENDED</bcp14>", "<bcp14>NOT RECOMMENDED</bcp14>",
    "<bcp14>MAY</bcp14>", and "<bcp14>OPTIONAL</bcp14>" in this document are to be interpreted as
    described in BCP&nbsp;14 <xref target="RFC2119"/> <xref target="RFC8174"/> 
    when, and only when, they appear in all capitals, as shown here.
        </t>
    </section>
    <section anchor="syntax" numbered="true" toc="default">
      <name>Enhanced JWT Claim Constraints Syntax</name>
      <t>The Enhanced JWT Claim Constraints certificate extension is non-critical,
applicable only to end-entity certificates, and defined with
ASN.1 <xref target="X.680" format="default"/>.  The syntax of the JWT claims in a PASSporT is
specified in <xref target="RFC8225" format="default"/>.</t>
      <t>The Enhanced JWT Claim Constraints certificate extension is optional, but,
when present, it constrains the JWT claims that authentication services may
include in the PASSporT objects they sign.  Constraints are applied by
certificate issuers and enforced by recipients when validating PASSporT
claims as follows:</t>
      <ol spacing="normal" type="1">
	<li>mustInclude indicates JWT claims that <bcp14>MUST</bcp14> appear in the PASSporT
	in addition to the iat, orig, and dest claims.  The baseline PASSporT
	claims ("iat", "orig", and "dest") are considered to be required by
	<xref target="RFC8225" format="default"/>, and these claims <bcp14>SHOULD NOT</bcp14>
	be part of the mustInclude
	list.  If mustInclude is absent, the iat, orig, and dest claims <bcp14>MUST</bcp14>
	appear in the PASSporT.</li>
        <li>permittedValues indicates that, if the claim name is present, the
	claim <bcp14>MUST</bcp14> exactly match one of the listed values.</li>
        <li>mustExclude indicates JWT claims that <bcp14>MUST NOT</bcp14> appear in the
	PASSporT. The baseline PASSporT claims ("iat", "orig", and "dest") are always
	permitted, and these claims <bcp14>MUST NOT</bcp14> be part of the mustExclude list. 
	If one of these baseline PASSporT claims appears in the mustExclude list, then the
	certificate <bcp14>MUST</bcp14> be treated as if the extension was not present.</li>
      </ol>
      <t>Following the precedent in <xref target="RFC8226" format="default"/>, JWT Claim Names <bcp14>MUST</bcp14> be ASCII strings,
which are also known as strings using the International Alphabet No. 5 <xref target="ISO646" format="default"/>.</t>
      <t>The Enhanced JWT Claim Constraints certificate extension is identified by the
      following object identifier (OID):</t>
      <sourcecode type="asn.1"><![CDATA[
    id-pe-eJWTClaimConstraints OBJECT IDENTIFIER ::= { id-pe 33 }
]]></sourcecode>
      <t>The Enhanced JWT Claim Constraints certificate extension has the following syntax:</t>
      <sourcecode type="asn.1"><![CDATA[
    EnhancedJWTClaimConstraints ::= SEQUENCE {
      mustInclude [0] JWTClaimNames OPTIONAL,
        -- The listed claim names MUST appear in the PASSporT
        -- in addition to iat, orig, and dest.  If absent, iat, orig,
        -- and dest MUST appear in the PASSporT.
      permittedValues [1] JWTClaimValuesList OPTIONAL,
        -- If the claim name is present, the claim MUST contain one
        -- of the listed values.
      mustExclude [2] JWTClaimNames OPTIONAL }
        -- The listed claim names MUST NOT appear in the PASSporT.
    ( WITH COMPONENTS { ..., mustInclude PRESENT } |
      WITH COMPONENTS { ..., permittedValues PRESENT } |
      WITH COMPONENTS { ..., mustExclude PRESENT } )

    JWTClaimValuesList ::= SEQUENCE SIZE (1..MAX) OF JWTClaimValues

    JWTClaimValues ::= SEQUENCE {
      claim JWTClaimName,
      values SEQUENCE SIZE (1..MAX) OF UTF8String }

    JWTClaimNames ::= SEQUENCE SIZE (1..MAX) OF JWTClaimName

    JWTClaimName ::= IA5String
]]></sourcecode>
    </section>
    <section anchor="usage-examples" numbered="true" toc="default">
      <name>Usage Examples</name>
      <t>Consider these usage examples with a PASSporT claim called "confidence" with
values "low", "medium", and "high".  These examples illustrate the constraints
that are imposed by mustInclude, permittedValues, and mustExclude:</t>
      <ul spacing="normal">
        <li>If a certification authority (CA) issues a certificate to an authentication
service that includes
an Enhanced JWT Claim Constraints certificate extension that contains the
mustInclude JWTClaimName "confidence", then an authentication service is
required to include the "confidence" claim in all PASSporTs it generates
and signs.  A verification service will treat any PASSporT it
receives without a "confidence" PASSporT claim as invalid.</li>
        <li>If a CA issues a certificate to an authentication service that includes
an Enhanced JWT Claim Constraints certificate extension that contains the
permittedValues JWTClaimName "confidence" and a permitted "high" value,
then a verification service will treat any PASSporT
it receives with a PASSporT "confidence" claim with a value other than
"high" as invalid.  However, a verification service will not treat a
PASSporT it receives without a PASSporT "confidence" claim at all as invalid, unless
"confidence" also appears in mustInclude.</li>
        <li>If a CA issues a certificate to an authentication service that includes
an Enhanced JWT Claim Constraints certificate extension that contains the
mustExclude JWTClaimName "confidence", then a verification service will
treat any PASSporT it receives with a PASSporT "confidence"
claim  as invalid regardless of the claim value.</li>
      </ul>
    </section>
    <section anchor="certificate-extension-example" numbered="true" toc="default">
      <name>Certificate Extension Example</name>
      <t>A certificate containing an example of the EnhancedJWTClaimConstraints
certificate extension is provided in <xref target="ex-certificate" format="default"/>.  The certificate is
provided in the format described in <xref target="RFC7468" format="default"/>.  The example of the
EnhancedJWTClaimConstraints extension from the certificate
is shown in <xref target="ex-extension" format="default"/>.  
The example imposes three constraints:</t>
      <ol spacing="normal" type="1">
	<li>The "confidence" claim must be present in the PASSporT.</li>
        <li>The "confidence" claim must have a value of "high" or "medium".</li>
        <li>The "priority" claim must not be present in the PASSporT.</li>
      </ol>
<figure anchor="ex-certificate">
  <name>Example Certificate</name>
       <artwork name="" type="" align="left" alt=""><![CDATA[
-----BEGIN CERTIFICATE-----
MIICpzCCAk2gAwIBAgIUH7Zd3rQ5AsvOlzLnzUHhrVhDSlswCgYIKoZIzj0EAwIw
KTELMAkGA1UEBhMCVVMxGjAYBgNVBAMMEUJPR1VTIFNIQUtFTiBST09UMB4XDTIx
MDcxNTIxNTIxNVoXDTIyMDcxNTIxNTIxNVowbDELMAkGA1UEBhMCVVMxCzAJBgNV
BAgMAlZBMRAwDgYDVQQHDAdIZXJuZG9uMR4wHAYDVQQKDBVCb2d1cyBFeGFtcGxl
IFRlbGVjb20xDTALBgNVBAsMBFZvSVAxDzANBgNVBAMMBlNIQUtFTjBZMBMGByqG
SM49AgEGCCqGSM49AwEHA0IABNR6C6nBWRA/fXTglV03aXkXy8hx9oBttVLhsTZ1
IYVRBao4OZhVf/Xv1a3xLsZ6KfdhuylSeAKuCoSbVGojYDGjggEOMIIBCjAMBgNV
HRMBAf8EAjAAMA4GA1UdDwEB/wQEAwIHgDAdBgNVHQ4EFgQUDlG3dxHyzKL/FZfS
PI7rpuueRbswHwYDVR0jBBgwFoAUlToKtrQeFrwwyXpMj1qu3TQEeoEwQgYJYIZI
AYb4QgENBDUWM1RoaXMgY2VydGlmaWNhdGUgY2Fubm90IGJlIHRydXN0ZWQgZm9y
IGFueSBwdXJwb3NlLjAWBggrBgEFBQcBGgQKMAigBhYEMTIzNDBOBggrBgEFBQcB
IQRCMECgDjAMFgpjb25maWRlbmNloSAwHjAcFgpjb25maWRlbmNlMA4MBGhpZ2gM
Bm1lZGl1baIMMAoWCHByaW9yaXR5MAoGCCqGSM49BAMCA0gAMEUCIQCbNR4QK1um
+0vq2CE1B1/W3avYeREsPi/7RKHffL+5eQIgarHot+X9Rl7SOyNBq5X5JyEMx0SQ
hRLkCY3Zoz2OCNQ=
-----END CERTIFICATE-----
]]></artwork>
</figure>
<figure anchor="ex-extension">
  <name>Example EnhancedJWTClaimConstraints Extension</name>
      <artwork name="" type="" align="left" alt=""><![CDATA[
  0  64: SEQUENCE {
  2  14:   [0] {
  4  12:     SEQUENCE {
  6  10:       IA5String 'confidence'
       :       }
       :     }
 18  32:   [1] {
 20  30:     SEQUENCE {
 22  28:       SEQUENCE {
 24  10:         IA5String 'confidence'
 36  14:         SEQUENCE {
 38   4:           UTF8String 'high'
 44   6:           UTF8String 'medium'
       :           }
       :         }
       :       }
       :     }
 52  12:   [2] {
 54  10:     SEQUENCE {
 56   8:       IA5String 'priority'
       :       }
       :     }
       :   }
]]></artwork>
</figure>
    </section>
    <section anchor="guidance-to-certification-authorities" numbered="true" toc="default">
      <name>Guidance to Certification Authorities</name>
      <t>The EnhancedJWTClaimConstraints extension specified in this document and the 
JWTClaimConstraints extension specified in <xref target="RFC8226" format="default"/> <bcp14>MUST NOT</bcp14> both appear
in the same certificate.</t>
      <t>If the situation calls for mustExclude constraints, then the
EnhancedJWTClaimConstraints extension is the only extension that
can express the constraints.</t>
      <t>On the other hand, if the situation does not call for mustExclude constraints,
then either the EnhancedJWTClaimConstraints extension or the JWTClaimConstraints
extension can express the constraints.  Until such time as support for the
EnhancedJWTClaimConstraints extension becomes widely implemented, the use of
the JWTClaimConstraints extension may be more likely to be supported.  This
guess is based on the presumption that the first specified extension will be
implemented more widely in the next few years.</t>
    </section>
    <section anchor="iana-considerations" numbered="true" toc="default">
      <name>IANA Considerations</name>
      <t>This document makes use of object identifiers for the Enhanced JWT
Claim Constraints certificate extension defined in <xref target="syntax" format="default"/> and the
ASN.1 module identifier defined in <xref target="asn1-module" format="default"/>.  Therefore, IANA has
made the following assignments within the "Structure of Management Information (SMI) Numbers (MIB Module Registrations)" registry.</t>
      <t>For the Enhanced JWT Claim Constraints certificate extension in the
"SMI Security for PKIX Certificate Extension" (1.3.6.1.5.5.7.1) registry:</t>
<table align="center">
  <thead>
    <tr>
      <th>Decimal</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>33</td>
      <td>id-pe-eJWTClaimConstraints</td>
    </tr>
  </tbody>
</table>
      <t>For the ASN.1 module identifier in the "SMI Security for PKIX Module
Identifier" (1.3.6.1.5.5.7.0) registry:</t>
<table align="center">
  <thead>
    <tr>
      <th>Decimal</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>101</td>  
      <td>id-mod-eJWTClaimConstraints-2021</td>
    </tr>
  </tbody>
</table>
    </section>
    <section anchor="security-considerations" numbered="true" toc="default">
      <name>Security Considerations</name>
      <t>For further information on certificate security and practices,
see <xref target="RFC5280" format="default"/>, especially the Security Considerations section.</t>
      <t>Since non-critical certificate extensions are ignored by implementations
that do not recognize the extension object identifier (OID), constraints
on PASSporT validation will only be applied by relying parties
that recognize the EnhancedJWTClaimConstraints extension.</t>
      <t>The Enhanced JWT Claim Constraints certificate extension can be
used by certificate issuers to provide limits on the acceptable
PASSporTs that can be accepted by verification services. Enforcement
of these limits depends upon proper implementation by the verification
services.  The digital signature on the PASSporT data structure will
be valid even if the limits are violated.</t>
      <t>Use of the Enhanced JWT Claim Constraints certificate extension
permittedValues constraint is most useful when the claim definition
allows a specified set of values.  In this way, all of the values
that are not listed in the JWTClaimValuesList are prohibited in a
valid PASSporT.</t>
      <t>Certificate issuers must take care when imposing constraints on the
PASSporT claims and the claim values that can be successfully validated;
some combinations can prevent any PASSporT from being successfully
validated by the certificate.  For example, an entry in mustInclude and
an entry in mustExclude for the same claim will prevent successful
validation on any PASSporT.</t>
      <t>Certificate issuers <bcp14>SHOULD NOT</bcp14> include an entry in mustExclude for the
"rcdi" claim for a certificate that will be used with the PASSporT
Extension for Rich Call Data defined in <xref target="I-D.ietf-stir-passport-rcd" format="default"/>.
Excluding this claim would prevent the integrity protection mechanism
from working properly.</t>
      <t>Certificate issuers must take care when performing certificate renewal <xref target="RFC4949" format="default"/>
to include exactly the same Enhanced JWT Claim Constraints certificate extension
in the new certificate as the old one.  Renewal usually takes place before the
old certificate expires, so there is a period of time where both the new
certificate and the old certificate are valid.  If different constraints
appear in the two certificates with the same public key, some PASSporTs
might be valid when one certificate is used and invalid when the other
one is used.</t>
    </section>
  </middle>
  <back>

<displayreference target="I-D.ietf-stir-passport-rcd" to="STIR-PASSPORT-RCD"/>
   
 <references>
      <name>References</name>
      <references>
        <name>Normative References</name>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.5280.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.5912.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8174.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8225.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8226.xml"/>

        <reference anchor="X.680">
          <front>
            <title>Information technology - Abstract Syntax Notation One (ASN.1): Specification of basic notation</title>
            <author>
              <organization>ITU-T</organization>
            </author>
            <date year="2021" month="February"/>
          </front>
          <seriesInfo name="ITU-T Recommendation" value="X.680"/>
        </reference>
      </references>
      <references>
        <name>Informative References</name>

        <reference anchor="ISO646">
          <front>
            <title>Information technology - ISO 7-bit coded character set for information interchange</title>
            <author>
              <organization>ISO</organization>
            </author>
            <date year="1991" month="December"/>
          </front>
          <seriesInfo name="ISO/IEC" value="646:1991"/>
        </reference>
	
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.4949.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.7468.xml"/>
        <xi:include href="https://datatracker.ietf.org/doc/bibxml3/reference.I-D.ietf-stir-passport-rcd.xml"/>
<reference anchor='RFC9060'>
<front>
<title>Secure Telephone Identity Revisited (STIR) Certificate Delegation</title>
<author initials='J' surname='Peterson' fullname='Jon Peterson'>
<organization />
</author>
<date year='2021' month='August' />
</front>
<seriesInfo name="RFC" value="9060"/>
<seriesInfo name="DOI" value="10.17487/RFC9060"/>
</reference>

      </references>
    </references>
    <section anchor="asn1-module" numbered="true" toc="default">
      <name>ASN.1 Module</name>
      <t>This appendix provides the ASN.1 <xref target="X.680" format="default"/> definitions for
the Enhanced JWT Claim Constraints certificate extension.  The module
defined in this appendix is compatible with the ASN.1 specifications
published in 2015.</t>
<t>This ASN.1 module imports ASN.1 from <xref target="RFC5912" format="default"/>.</t>

      <sourcecode type="asn.1" markers="true"><![CDATA[
EnhancedJWTClaimConstraints-2021
  { iso(1) identified-organization(3) dod(6) internet(1)
    security(5) mechanisms(5) pkix(7) id-mod(0)
    id-mod-eJWTClaimConstraints-2021(101) }

DEFINITIONS EXPLICIT TAGS ::= BEGIN

IMPORTS

id-pe
FROM PKIX1Explicit-2009  -- From RFC 5912
  { iso(1) identified-organization(3) dod(6) internet(1)
    security(5) mechanisms(5) pkix(7) id-mod(0)
    id-mod-pkix1-explicit-02(51) }

EXTENSION
FROM PKIX-CommonTypes-2009  -- From RFC 5912
  { iso(1) identified-organization(3) dod(6) internet(1)
    security(5) mechanisms(5) pkix(7) id-mod(0)
    id-mod-pkixCommon-02(57) } ;

-- Enhanced JWT Claim Constraints Certificate Extension

ext-eJWTClaimConstraints EXTENSION ::= {
  SYNTAX EnhancedJWTClaimConstraints
  IDENTIFIED BY id-pe-eJWTClaimConstraints }

id-pe-eJWTClaimConstraints OBJECT IDENTIFIER ::= { id-pe 33 }

EnhancedJWTClaimConstraints ::= SEQUENCE {
  mustInclude [0] JWTClaimNames OPTIONAL,
    -- The listed claim names MUST appear in the PASSporT
    -- in addition to iat, orig, and dest.  If absent, iat, orig,
    -- and dest MUST appear in the PASSporT.
  permittedValues [1] JWTClaimValuesList OPTIONAL,
    -- If the claim name is present, the claim MUST contain one
    -- of the listed values.
  mustExclude [2] JWTClaimNames OPTIONAL }
    -- The listed claim names MUST NOT appear in the PASSporT.
( WITH COMPONENTS { ..., mustInclude PRESENT } |
  WITH COMPONENTS { ..., permittedValues PRESENT } |
  WITH COMPONENTS { ..., mustExclude PRESENT } )

JWTClaimValuesList ::= SEQUENCE SIZE (1..MAX) OF JWTClaimValues

JWTClaimValues ::= SEQUENCE {
  claim JWTClaimName,
  values SEQUENCE SIZE (1..MAX) OF UTF8String }

JWTClaimNames ::= SEQUENCE SIZE (1..MAX) OF JWTClaimName

JWTClaimName ::= IA5String
 
END

]]></sourcecode>
    </section>
    <section anchor="acknowledgements" numbered="false" toc="default">
      <name>Acknowledgements</name>
      <t>Many thanks to <contact fullname="Chris Wendt"/> for his insight into the need for
      the for the Enhanced JWT Claim Constraints certificate extension.</t>
      <t>Thanks to
<contact fullname="Ben Campbell"/>,
<contact fullname="Theresa Enghardt"/>,
<contact fullname="Ben Kaduk"/>,
<contact fullname="Erik Kline"/>,
<contact fullname="Éric Vyncke"/>, and
<contact fullname="Rob Wilton"/>
for their thoughtful review and comments.  The document is much
better as a result of their efforts.</t>
    </section>
  </back>
</rfc>
