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

<!-- [CS] updated by Chris 03/30/23 -->

<!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-identity-header-errors-handling-08" number="0000" submissionType="IETF" category="std" consensus="true" tocInclude="true" sortRefs="true" symRefs="true" updates="" obsoletes="" xml:lang="en" version="3">

  <!-- xml2rfc v2v3 conversion 3.17.0 -->
  <front>
    <title abbrev="Identity Errors">Identity Header Errors Handling for STIR</title>
    <seriesInfo name="RFC" value="0000"/>
    <author initials="C." surname="Wendt" fullname="Chris Wendt">
      <organization>Somos Inc.</organization>
      <address>
        <email>chris-ietf@chriswendt.net</email>
      </address>
    </author>
    <date year="2023" month="May"/>
    <area>art</area>
    <workgroup>stir</workgroup>
    <keyword>Identity</keyword>
    <abstract>
      <t>This document extends STIR and the Authenticated Identity Management in the Session Initiation Protocol (SIP) error handling procedures to include the mapping of verification failure reasons to STIR defined 4xx codes so the failure reason of an Identity header field can be conveyed to the upstream authentication service when local policy dictates that the call should continue in the presence of a verification failure. This document also defines procedures that enable a failure reason to be mapped to a specific Identity header field for scenarios that use multiple Identity header fields where some may have errors and others may not and the handling of those situations is defined.</t>
    </abstract>
  </front>
  <middle>
    <section anchor="introduction">
      <name>Introduction</name>
      <t>The STIR framework as described in <xref target="RFC7340"/> is an authentication framework for asserting a telephone number or URI based identity using a digital signature and certificate based framework as described in <xref target="RFC8225"/> and <xref target="RFC8226"/> respectively.  <xref target="RFC8224"/> describes the use of the STIR framework in the SIP protocol <xref target="RFC3261"/> and defines both the authentication service that creates a PASSporT, defined in <xref target="RFC8225"/>, and delivers it in an Identity header field and the verification service that correspondingly verifies the PASSporT and embedded originating identity.</t>
      <t>This document is concerned with errors in validating PASSporTs and Identity header fields and how they are communicated in special cases and defines a solution to help address the potential issue of multiple Identity header fields and the plurality of potential verification errors. Additionally, it addresses the issue of the current 4xx error response and that when there is a verification error, the call is terminated. In some deployments, it may be the case that the policy for handling errors dictates that calls should continue even if there is a verification error. In many cases of, for example, inadvertent or operational errors that do not represent any identity falsification type of attempt, the policy of continuing the call even though the identity is not verified, may be the preferred policy. In these cases, the authentication service should still be notified of the error so that corrective action can be taken to fix any issues. This specification will discuss the use of the Reason header field in subsequent provisional (1xx) responses in order to deliver the error back to the authentication service or other SIP path network equipment responsible for error handling.</t>
      <t>For the handling of multiple Identity header fields and the potential situation that some of the Identity header fields in a call may pass verification but others may have errors, this document defines the method of adding an identifier so that the authentication service can uniquely identify which Identity header field is being referred to in the case of an error.</t>
    </section>
    <section anchor="terminology">
      <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="reason-header-field-protocol-stir">
      <name>Reason header field protocol "STIR"</name>
      <t>This document defines a new Reason header field <xref target="RFC3326"/> protocol "STIR" for STIR applications using SIP as defined in <xref target="RFC8224"/>. The use of "STIR" as a reason header field protocol with the <xref target="RFC8224"/> defined error cause codes allows the use of multiple Reason header fields defined in <xref target="RFC3326"/> and updated in <xref target="RFC9366"/>. Any provisional SIP Response message or final response message, with the exception of a 100 (Trying), <bcp14>MAY</bcp14> contain one or more Reason header fields with a STIR related cause code defined in <xref target="RFC8224"/> or future specifications. The use of multiple Reason header field is discussed in more detail later in the document.</t>
    </section>
    <section anchor="use-of-provisional-response-to-signal-errors-without-terminating-the-call">
      <name>Use of provisional response to signal errors without terminating the call</name>
      <t>In cases where local policy dictates that a call should continue regardless of any verification errors that may have occured, including 4XX errors described in <xref sectionFormat="of" target="RFC8224" section="6.2.2"/>, then the verification service <bcp14>MUST NOT</bcp14> send the 4XX as a response, but rather include the error response code and reason phrase in a Reason header field, defined in <xref target="RFC3326"/>, in the next provisional or final responses sent to the authentication service.</t>
      <t>Example Reason header field:</t>
      <sourcecode><![CDATA[
Reason: STIR ;cause=436 ;text="Bad Identity Info"
]]></sourcecode>
    </section>
    <section anchor="handling-of-a-verification-error-when-there-are-multiple-identity-header-fields">
      <name>Handling of a verification error when there are multiple Identity header fields</name>
      <t>In cases where a SIP message includes multiple Identity header fields and one of those Identity header fields has an error, the verification service <bcp14>MUST</bcp14> include the error response code and reason phrase associated with the error in a Reason header field, defined in <xref target="RFC3326"/>, in the next provisional or final responses sent to the authentication service. The reason cause in the Reason header field <bcp14>MUST</bcp14> represent the error that occurred when verifying the contents of the Identity header field. For a SIP INVITE containing multiple Identity header fields, the "ppi" parameter for the Reason header field is <bcp14>RECOMMENDED</bcp14>. As defined in <xref target="RFC8224"/>, the STIR error codes used in responses are based on an error associated with a specific identity header field representing a single error occurring with the verification and processing of that identity header field. The association of a "ppi" parameter with a Reason header field using "STIR" protocol <bcp14>MUST</bcp14> only identify a single cause code in the context of a call dialog defined in <xref target="RFC8224"/> or in future documents defining STIR related errors. The associated PASSporT object can be included either in full form or in compact form, where only the signature of the PASSporT is included with two periods as a prefix as defined in <xref target="RFC8225" sectionFormat="of" section="7"/> to identify the reported Identity header field with an error. Compact form is the recommended form as full form may include information that could have privacy or security implications in some call scenarios as discussed in <xref target="Security"/>.</t>
      <t>Example Reason header field with full form PASSporT:</t>
      <sourcecode><![CDATA[
Reason: STIR ;cause=436 ;text="Bad Identity Info" ;ppi= \
"eyJhbGciOiJFUzI1NiIsInR5cCI6InBhc3Nwb3J0IiwieDV1I \
joiaHR0cHM6Ly9jZXJ0LmV4YW1wbGUub3JnL3Bhc3Nwb3J0LmNlciJ9.eyJ \
kZXN0Ijp7InVyaSI6WyJzaXA6YWxpY2VAZXhhbXBsZS5jb20iXX0sImlhdC \
I6IjE0NDMyMDgzNDUiLCJvcmlnIjp7InRuIjoiMTIxNTU1NTEyMTIifX0.r \
q3pjT1hoRwakEGjHCnWSwUnshd0-zJ6F1VOgFWSjHBr8Qjpjlk-cpFYpFYs \
ojNCpTzO3QfPOlckGaS6hEck7w"
]]></sourcecode>
      <t>Example Reason header field with compact form PASSporT:</t>
      <sourcecode><![CDATA[
Reason: STIR ;cause=436 ;text="Bad Identity Info" ;ppi= \
"..rq3pjT1akEGjHCnWSwUnshd0-zJ6F1VOgFWSjHBr8Qjpjlk-cpFYpFYs \
ojNCpTzO3QfPOlckGaS6hEck7w"
]]></sourcecode>
    </section>
    <section anchor="handling-multiple-verification-errors">
      <name>Handling multiple verification errors</name>
      <t>If there are multiple Identity header field verification errors being reported the verification service <bcp14>MUST</bcp14> include a corresponding number of Reason header fields per error.  These Reason header fields should include a "ppi" parameters including the full or compact form of the PASSporT with cause and text parameters identifying each error. As mentioned previously, the potential use of multiple Reason header fields defined in <xref target="RFC3326"/> is updated in <xref target="RFC9366"/> allowing multiple Reason header fields with the same protocol value. For this specification, "STIR" should be used for any STIR error defined in <xref target="RFC8224"/> or future specifications.</t>
      <t>Example Reason header fields for two identity info errors:</t>
      <sourcecode><![CDATA[
Reason: STIR ;cause=436 ;text="Bad Identity Info" ;ppi=     \
"..rq3pjT1hoRwakEGjHCnWSwUnshd0-zJ6F1VOgFWSjHBr8Qjpjlk-cpFY \
pFYsojNCpTzO3QfPOlckGaS6hEck7w"

Reason: STIR ;cause=438 ;text="Invalid Identity Header" ;ppi=  \
"..rJ6F1VOgFWSjHBr8Qjpjlk-cpFYpFYsq3pjT1hoRwakEGjHCnWSwUnsh \
d0-zckGaS6hEck7wojNCpTzO3QfPOl"
]]></sourcecode>
    </section>
    <section anchor="removal-of-the-reason-header-field-by-authentication-service">
      <name>Removal of the Reason header field by Authentication Service</name>
      <t>When an Authentication Service <xref target="RFC8224"/> receives the Reason header field with a PASSporT it generated as part of an Identity header field and the authentication of a call, it should first follow local policy to recognize and acknowledge the error (e.g. perform operational actions like logging or alarming), but then <bcp14>MUST</bcp14> remove the identified Reason header field to avoid the PASSporT information from going upstream to a UAC or UAS that may not be authorized to see claim information contained in the PASSporT for privacy or other reasons.</t>
    </section>
    <section anchor="iana-considerations">
      <name>IANA Considerations</name>
      <t>This document requests the definition of a new protocol value (and associated protocol cause) to be registered by the IANA into the "Reason Protocols" sub-registry under <eref target="http://www.iana.org/assignments/sip-parameters" brackets="angle"/> as follows:</t>

<table anchor="iana1"> 
  <name></name>    
  <thead>
    <tr>
      <th>Protocol Value</th>   
      <th>Protocol Cause</th>
      <th>Reference</th>
    </tr>
  </thead>
  <tbody>         
    <tr>
      <td>STIR</td>
      <td>STIR Error code</td>
      <td><xref target="RFC8224"/></td>
    </tr>
  </tbody>
</table>

      <t>This document also requests the definition of a new header field parameter name to be registered by IANA into the Header Field Parameters and Parameter Values sub-registry under https://www.iana.org/assignments/sip-parameters as follows:</t>

<table anchor="iana2">
  <name></name>
  <thead>
    <tr>
      <th>Header Field</th>   
<th>Parameter Name</th> 
<th>Predefined Values</th>
      <th>Reference</th>
    </tr>
  </thead>
  <tbody>         
    <tr>
      <td>Reason</td>
      <td>ppi</td>
      <td>No</td>
      <td>[RFCXXXX]</td>
    </tr>
  </tbody>
</table>

    </section>
    <section anchor="Security">
      <name>Security Considerations</name>
      <t>This specification discusses the use of a PASSporT as an identifier for cases where there are multiple identity header field errors occuring as part of the Reason header field response. For some call scenarios (e.g. diversion based call flows) the signer of the PASSporT(s) may not be the first hop initiator of the call. In those cases, there may be some security or privacy concerns associated with PASSporT information that is passed upstream beyond the authentication service that originally signed the PASSporT(s) in the resulting error Reason header field. This specification states the authentication service <bcp14>MUST</bcp14> remove the Reason header field with the PASSporT to protect the security (e.g. use of potentially still fresh PASSporT for replay attacks) and privacy of any potential information that could be passed beyond the authentication service response back in the direction of the call initiator. While this specification allows for both full and compact form of the PASSporT to be used as the error identifier, use of the compact form is <bcp14>RECOMMENDED</bcp14> to avoid  the potential exposure of call information contained in the full form of the PASSporT.</t>
    </section>
  </middle>
  <back>
    <references>
      <name>References</name>
      <references>
        <name>Normative References</name>

<!-- [I-D.ietf-sipcore-multiple-reasons] Published as RFC 9366 -->

        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.9366.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.3261.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.3326.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8224.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8225.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8226.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml"/>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.8174.xml"/>
      </references>
      <references>
        <name>Informative References</name>
        <xi:include href="https://bib.ietf.org/public/rfc/bibxml/reference.RFC.7340.xml"/>
      </references>
    </references>
    <section anchor="acknowledgements" numbered="false">
      <name>Acknowledgements</name>
      <t>The author would like to thank <contact fullname="David Hancock"/> for help to identify these error scenarios and additionally <contact fullname="Jon Peterson"/>, <contact fullname="Roman Shpount"/>, <contact fullname="Robert Sparks"/>, <contact fullname="Christer Holmberg"/> and others in the STIR working group for their helpful feedback and discussion.</t>
    </section>
  </back>
</rfc>
