<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE rfc SYSTEM "rfc2629-xhtml.ent">

<rfc xmlns:xi="http://www.w3.org/2001/XInclude" category="std"
     docName="draft-ietf-secevent-http-push-14" ipr="trust200902" obsoletes=""
     updates="" submissionType="IETF" xml:lang="en" tocInclude="true"
     tocDepth="3" symRefs="true" sortRefs="true" version="3" consensus="yes"
     number="8935">

  <front>
    <title abbrev="Push-Based SET Using HTTP">Push-Based Security Event Token (SET) Delivery Using HTTP</title>
    <seriesInfo name="RFC" value="8935"/>
    <author fullname="Annabelle Backman" initials="A." surname="Backman" role="editor">
      <organization>Amazon</organization>
      <address>
        <email>richanna@amazon.com</email>
      </address>
    </author>
    <author fullname="Michael B. Jones" initials="M." surname="Jones" role="editor">
      <organization>Microsoft</organization>
      <address>
        <email>mbj@microsoft.com</email>
        <uri>https://self-issued.info/</uri>
      </address>
    </author>
    <author fullname="Marius Scurtescu" initials="M." surname="Scurtescu">
      <organization>Coinbase</organization>
      <address>
        <email>marius.scurtescu@coinbase.com</email>
      </address>
    </author>
    <author fullname="Morteza Ansari" initials="M." surname="Ansari">
      <organization>Independent</organization>
      <address>
        <email>morteza@sharppics.com</email>
      </address>
    </author>
    <author fullname="Anthony Nadalin" initials="A." surname="Nadalin">
      <organization>Independent</organization>
      <address>
        <email>nadalin@prodigy.net</email>
      </address>
    </author>
    <date year="2020" month="November"/>
    <area>Security</area>
    <workgroup>Security Events Working Group</workgroup>

<keyword>JSON Web Token</keyword>
<keyword>JWT</keyword>
<keyword>Security Event Token</keyword>
<keyword>SET</keyword>
<keyword>Delivery</keyword>
<keyword>JavaScript Object Notation</keyword>
<keyword>JSON</keyword>

    <abstract>
      <t>
        This specification defines how a Security Event Token (SET) can be
        delivered to an intended recipient using HTTP POST over TLS.  The SET
        is transmitted in the body of an HTTP POST request to an endpoint
        operated by the recipient, and the recipient indicates successful or
        failed transmission via the HTTP response.
      </t>
    </abstract>
  </front>
  <middle>

    <section anchor="intro" toc="default" numbered="true">
      <name>Introduction and Overview</name>
      <t>
                This specification defines a mechanism by which a transmitter of a
                <xref target="RFC8417" format="default">Security Event Token (SET)</xref> can deliver
                the SET to an intended SET Recipient via <xref target="RFC7231" format="default">HTTP POST</xref>
		over TLS.
		This is an alternative SET delivery method to the one defined in
		<xref target="RFC8936" format="default"/>.
      </t>
      <t>
                Push-based SET delivery over HTTP POST is intended for scenarios where all of
                the following apply:
      </t>
      <ul spacing="normal">
        <li>The transmitter of the SET is capable of making outbound HTTP requests.</li>
        <li>
                        The recipient is capable of hosting a TLS-enabled HTTP endpoint that is accessible
                        to the transmitter.
                    </li>
        <li>
		      The transmitter and recipient are willing to exchange data with one another.
		    </li>
      </ul>
      <t>
		In some scenarios, either push-based or poll-based delivery could be used,
		and in others, only one of them would be applicable.
      </t>
      <t>
                A mechanism for exchanging configuration metadata such as endpoint URLs,
                cryptographic keys,
		and possible implementation constraints such as buffer size limitations
		between the transmitter and recipient is
                out of scope for this specification. How SETs are defined and the process
                by which security events are identified for SET Recipients are specified
                in <xref target="RFC8417" format="default"/>.
      </t>
      <section anchor="notat" toc="default" numbered="true">
        <name>Notational Conventions</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>
        <t>
	 Throughout this document, all figures may contain spaces and extra
	 line wrapping for readability and due to space limitations.
        </t>
      </section>
      <section anchor="defs" toc="default" numbered="true">
        <name>Definitions</name>
        <t>
                    This specification utilizes the following terms defined in <xref target="RFC8417" format="default"/>:
                    "Security Event Token (SET)", "SET Issuer", "SET Recipient", and "Event Payload",
                    as well as the term defined below:
        </t>

        <dl newline="false" spacing="normal">
          <dt>SET Transmitter:</dt>
          <dd>
          An entity that delivers SETs in its possession to one or more SET
          Recipients.
          </dd>
        </dl>

      </section>

    </section>
    <section anchor="Delivery" numbered="true" toc="default">
      <name>SET Delivery</name>
      <t>
                To deliver a SET to a given SET Recipient, the SET Transmitter
                makes a SET Transmission Request to the SET Recipient, with the SET
                itself contained within the request. The SET Recipient replies to
                this request with a response either acknowledging successful
                transmission of the SET or indicating that an error occurred
                while receiving, parsing, and/or validating the SET.

      </t>
      <t>
                Upon receipt of a SET, the SET Recipient <bcp14>SHALL</bcp14> validate that all of
                the following are true:
      </t>
      <ul spacing="normal">
        <li>The SET Recipient can parse the SET.</li>
        <li>
                        The SET is authentic (i.e., it was issued by the issuer
                        specified within the SET,
			and if signed, was signed by a key belonging to the issuer).
                    </li>
        <li>
                        The SET Recipient is identified as an intended audience of
                        the SET.
                    </li>
        <li>
                        The SET Issuer is recognized as an issuer that the SET Recipient
                        is willing to receive SETs from (e.g., the issuer is listed as allowed
                        by the SET Recipient).
                    </li>
        <li>
		      The SET Recipient is willing to accept this SET from this SET Transmitter
		      (e.g., the SET Transmitter is expected to send SETs
		      with the issuer and subject of the SET in question).
                    </li>
      </ul>


      <t>
                The mechanisms by which the SET Recipient performs this validation
                are out of scope for this document. SET parsing, issuer identification,
		and audience identification are defined in <xref target="RFC8417" format="default"/>.
                The mechanism for validating the authenticity of a SET is deployment
                specific and may vary depending on the authentication mechanisms in
                use and whether the SET is signed and/or encrypted (See <xref target="aa" format="default"/>).
      </t>
      <t>
                SET Transmitters <bcp14>MAY</bcp14> transmit SETs issued by another entity. The SET
                Recipient may accept or reject (i.e., return an error response such as
                <tt>access_denied</tt>) a SET at its own discretion.
      </t>
      <t>
                The SET Recipient persists the SET in a way that
                is sufficient to meet the SET Recipient's own reliability requirements.
		The level and method of retention of SETs
		by SET Recipients is out of scope of this specification.
                Once the SET has been validated and persisted, the SET Recipient <bcp14>SHOULD</bcp14>
                immediately return a response indicating that the SET was successfully
                delivered. The SET Recipient <bcp14>SHOULD NOT</bcp14> perform further processing of the SET
		beyond the required validation steps prior to sending this response.
                Any additional steps <bcp14>SHOULD</bcp14> be executed asynchronously from delivery
		to minimize the time the SET Transmitter is waiting for a response.
      </t>
      <t>
                The SET Transmitter <bcp14>MAY</bcp14> transmit the same SET to the SET Recipient multiple
                times, regardless of the response from the SET Recipient. The SET Recipient
                <bcp14>MUST</bcp14> respond as it would if the SET had not been previously received by the 
                SET Recipient. The SET Recipient <bcp14>MUST NOT</bcp14> expect or depend on a SET Transmitter
                to retransmit a SET or otherwise make a SET available to the SET Recipient
                once the SET Recipient acknowledges that it was received successfully.
      </t>
      <t>
                The SET Transmitter should not retransmit a SET unless the SET Transmitter
                suspects that previous transmissions may have failed due to potentially
                recoverable errors (such as network outage or temporary service interruption at
                either the SET Transmitter or SET Recipient). In all other cases, the SET
                Transmitter <bcp14>SHOULD NOT</bcp14> retransmit a SET. The SET
                Transmitter <bcp14>SHOULD</bcp14> delay retransmission for an appropriate amount of time
                to avoid overwhelming the SET Recipient (see <xref target="reliability" format="default"/>).
      </t>
      <section anchor="httpPost" numbered="true" toc="default">
        <name>Transmitting a SET</name>
        <t>
                    To transmit a SET to a SET Recipient, the SET Transmitter makes
                    an HTTP POST request to a TLS-enabled HTTP endpoint provided by the SET Recipient.  The
                    <tt>Content-Type</tt> header field of this request <bcp14>MUST</bcp14>
                    be <tt>application/secevent+jwt</tt> as defined in
                    Sections <xref target="RFC8417"
		    sectionFormat="bare" section="2.3"/> and <xref target="RFC8417"
		    sectionFormat="bare" section="7.2"/> of <xref target="RFC8417"
		    sectionFormat="bare"/>, and the
                    <tt>Accept</tt> header field <bcp14>MUST</bcp14> be <tt>application/json</tt>.  The
                    request body <bcp14>MUST</bcp14> consist of the SET itself, represented as a
                    <xref target="RFC7519" format="default">JSON Web Token (JWT)</xref>.
        </t>
        <t>
                    The SET Transmitter <bcp14>MAY</bcp14> include in the request an <tt>Accept-Language</tt>
                    header field to indicate to the SET Recipient the preferred language(s) in which to
                    receive error messages.
        </t>
        <t>
                    The mechanisms by which the SET Transmitter determines the HTTP endpoint to
                    use when transmitting a SET to a given SET Recipient are not defined by this
                    specification and are deployment specific.
        </t>
        <t keepWithNext="true">
                        The following is a non-normative example of a SET Transmission Request:
        </t>
        <figure anchor="postSet">
          <name>Example SET Transmission Request</name>

          <sourcecode name="" type="http-message"><![CDATA[
  POST /Events HTTP/1.1
  Host: notify.rp.example.com
  Accept: application/json
  Accept-Language: en-US, en;q=0.5
  Content-Type: application/secevent+jwt

  eyJ0eXAiOiJzZWNldmVudCtqd3QiLCJhbGciOiJIUzI1NiJ9Cg
  .
  eyJpc3MiOiJodHRwczovL2lkcC5leGFtcGxlLmNvbS8iLCJqdGkiOiI3NTZFNjk
  3MTc1NjUyMDY5NjQ2NTZFNzQ2OTY2Njk2NTcyIiwiaWF0IjoxNTA4MTg0ODQ1LC
  JhdWQiOiI2MzZDNjk2NTZFNzQ1RjY5NjQiLCJldmVudHMiOnsiaHR0cHM6Ly9zY
  2hlbWFzLm9wZW5pZC5uZXQvc2VjZXZlbnQvcmlzYy9ldmVudC10eXBlL2FjY291
  bnQtZGlzYWJsZWQiOnsic3ViamVjdCI6eyJzdWJqZWN0X3R5cGUiOiJpc3Mtc3V
  iIiwiaXNzIjoiaHR0cHM6Ly9pZHAuZXhhbXBsZS5jb20vIiwic3ViIjoiNzM3NT
  YyNkE2NTYzNzQifSwicmVhc29uIjoiaGlqYWNraW5nIn19fQ
  .
  Y4rXxMD406P2edv00cr9Wf3_XwNtLjB9n-jTqN1_lLc
]]></sourcecode>
        </figure>
      </section>
      <section anchor="successResponse" numbered="true" toc="default">
        <name>Success Response</name>
        <t>If the SET is determined to be valid, the SET Recipient <bcp14>SHALL</bcp14>
                    acknowledge successful transmission by responding with HTTP
                    Response Status Code 202 (Accepted) (see <xref target="RFC7231" sectionFormat="of" section="6.3.3"/>).
		    The body of the response <bcp14>MUST</bcp14> be empty.
        </t>
        <t keepWithNext="true">The following is a non-normative example of a successful
                        receipt of a SET.</t>
        <figure anchor="goodPostResponse">
          <name>Example Successful Delivery Response</name>
          <sourcecode name="" type="http-message"><![CDATA[
  HTTP/1.1 202 Accepted
]]></sourcecode>
        </figure>
      </section>
      <section anchor="failureResponse" numbered="true" toc="default">
        <name>Failure Response</name>
        <t>In the event of a general HTTP error condition, the SET Recipient
                    responds with the applicable HTTP Status Code, as defined in
                    <xref target="RFC7231" sectionFormat="of" section="6"/>.</t>
        <t>
                    When the SET Recipient detects an error parsing,
                    validating, or authenticating a SET transmitted in a SET
                    Transmission Request, the SET Recipient
                    <bcp14>SHALL</bcp14> respond with an HTTP Response Status
                    Code of 400 (Bad Request).  The <tt>Content-Type</tt>
                    header field of this response <bcp14>MUST</bcp14> be
                    <tt>application/json</tt>, and the body <bcp14>MUST</bcp14> be a
                    UTF-8 encoded <xref target="RFC8259"
                    format="default">JSON</xref> object containing the
                    following name/value pairs:
        </t>
        <dl newline="false" spacing="normal">
          <dt>err:</dt>
          <dd>
                            A Security Event Token Error Code (see <xref target="error_codes" format="default"/>).
                        </dd>
          <dt>description:</dt>
          <dd>
                            A UTF-8 string containing a human-readable description of the error
                            that may provide additional diagnostic information. The exact content
                            of this field is implementation specific.
                        </dd>
        </dl>
        <t>
                    The response <bcp14>MUST</bcp14> include a
                    <tt>Content-Language</tt> header field whose value
                    indicates the language of the error descriptions included
                    in the response body. If the SET Recipient can provide
                    error descriptions in multiple languages, they
                    <bcp14>SHOULD</bcp14> choose the language to use according
                    to the value of the <tt>Accept-Language</tt> header field
                    sent by the SET Transmitter in the transmission request,
                    as described in <xref target="RFC7231" sectionFormat="of"
                    section="5.3.5"/>. If the SET Transmitter did not send an
                    <tt>Accept-Language</tt> header field, or if the SET
                    Recipient does not support any of the languages included
                    in the header field, the SET Recipient <bcp14>MUST</bcp14>
                    respond with messages that are understandable by an
                    English-speaking person, as described in <xref
                    target="RFC2277" sectionFormat="of" section="4.5"/>.
        </t>
        <t keepWithNext="true">The following is a non-normative example error response indicating
                        that the key used to encrypt the SET has been revoked.</t>
        <figure anchor="errorResponseInvalidKey">
          <name>Example Error Response (invalid_key)</name>
          <sourcecode name="http-message" type=""><![CDATA[
  HTTP/1.1 400 Bad Request
  Content-Language: en-US
  Content-Type: application/json

  {
    "err": "invalid_key",
    "description": "Key ID 12345 has been revoked."
  }
]]></sourcecode>
        </figure>
        <t keepWithNext="true">The following is a non-normative example error response indicating
                        that the access token included in the request is expired.</t>
        <figure anchor="errorResponseExpiredToken">
          <name>Example Error Response (authentication_failed)</name>
          <sourcecode name="" type="http-message"><![CDATA[
  HTTP/1.1 400 Bad Request
  Content-Language: en-US
  Content-Type: application/json

  {
    "err": "authentication_failed",
    "description": "Access token has expired."
  }
]]></sourcecode>
        </figure>
        <t keepWithNext="true">The following is a non-normative example error response indicating
                        that the SET Receiver is not willing to accept SETs issued by the specified
                        issuer from this particular SET Transmitter.</t>
        <figure anchor="errorResponseBadIssuer">
          <name>Example Error Response (access_denied)</name>

          <sourcecode name="" type="http-message"><![CDATA[
HTTP/1.1 400 Bad Request
Content-Language: en-US
Content-Type: application/json

{
  "err": "invalid_issuer",
  "description": "Not authorized for issuer https://iss.example.com/"
}
]]></sourcecode>
        </figure>
      </section>
      <section anchor="error_codes" numbered="true" toc="default">
        <name>Security Event Token Error Codes</name>
        <t>Security Event Token Error Codes are strings that identify a
                    specific category of error that may occur when parsing or validating a SET.


                    Every Security Event Token Error Code <bcp14>MUST</bcp14> have a unique name
                    registered in the IANA "Security Event Token Error Codes"
                    registry established by <xref target="iana_set_errors" format="default"/>.</t>



        <t>The following table presents the initial set of Error Codes that are registered
                    in the IANA "Security Event Token Error Codes" registry:</t>
        <table anchor="reqErrors" align="center">
          <name>SET Error Codes</name>
          <thead>
            <tr>
              <th align="left">Error Code</th>
              <th align="left">Description</th>
            </tr>
          </thead>
          <tbody>
            <tr>
              <td align="left">invalid_request</td>
              <td align="left">The request body cannot be parsed as a SET, or the
                        Event Payload within the SET does not conform to the event's definition.</td>
            </tr>
            <tr>
              <td align="left">invalid_key</td>
              <td align="left">One or more keys used to encrypt or sign the SET is
                        invalid or otherwise unacceptable to the SET Recipient (expired,
                        revoked, failed certificate validation, etc.).</td>
            </tr>
            <tr>
              <td align="left">invalid_issuer</td>
              <td align="left">The SET Issuer is invalid for the SET Recipient.</td>
            </tr>
            <tr>
              <td align="left">invalid_audience</td>
              <td align="left">The SET Audience does not correspond to the SET Recipient.</td>
            </tr>
            <tr>
              <td align="left">authentication_failed</td>
              <td align="left">The SET Recipient could not authenticate the
                        SET Transmitter.</td>
            </tr>
            <tr>
              <td align="left">access_denied</td>
              <td align="left">The SET Transmitter is not authorized to transmit the
                        SET to the SET Recipient.</td>
            </tr>
          </tbody>
        </table>
        <t>
		  Other Error Codes may also be received,
		  as the set of Error Codes is extensible
		  via the IANA "Security Event Token Error Codes" registry
		  established in <xref target="iana_set_errors" format="default"/>.
        </t>
      </section>
    </section>


    <section anchor="aa" toc="default" numbered="true">
      <name>Authentication and Authorization</name>
      <t>The SET delivery method described in this specification is based upon
      HTTP over TLS <xref target="RFC2818" format="default"/> and standard
      HTTP authentication and authorization schemes, as per <xref
      target="RFC7235" format="default"/>.  The TLS server certificate
      <bcp14>MUST</bcp14> be validated using DNS-ID <xref target="RFC6125"
      format="default"/> and/or DNS-Based Authentication of Named Entities
      (DANE) <xref target="RFC6698" format="default"/>.
      </t>
      <t>
	      Authorization for the eligibility to provide actionable SETs can be determined by
	      using the identity of the SET Issuer,
	      the identity of the SET Transmitter, perhaps using mutual TLS,
	      or via other employed authentication methods.
	      Because SETs are
	      not commands, SET Recipients are free to ignore SETs that
	      are not of interest.
      </t>
    </section>
    <section anchor="reliability" toc="default" numbered="true">
      <name>Delivery Reliability</name>
      <t>
                Delivery reliability requirements may vary depending upon the use cases.
		This specification defines the response from the SET
                Recipient in such a way as to provide the SET Transmitter with the
                information necessary to determine what further action is required,
                if any, in order to meet their requirements.  SET Transmitters with
                high reliability requirements may be tempted to always retry failed
                transmissions. However, it should be noted that for many types of SET
                delivery errors, a retry is extremely unlikely to be successful.  For
                example, <tt>invalid_request</tt> indicates a structural
                error in the content of the request body that is likely to remain when
                retransmitting the same SET.  Others such as <tt>access_denied</tt>
                may be transient, for example, if the SET Transmitter refreshes expired
                credentials prior to retransmission.
      </t>
      <t>
                The SET Transmitter may be unaware of whether or not a SET has been delivered
                to a SET Recipient. For example, a network interruption could prevent the
                SET Transmitter from receiving the success response, or a service outage could
                prevent the SET Transmitter from recording the fact that the SET was delivered. 
                It is left to the implementer to decide how to handle such cases, based on
                their requirements. For example, it may be appropriate for the SET Transmitter to
                retransmit the SET to the SET Recipient, erring on the side of guaranteeing delivery,
                or it may be appropriate to assume delivery was successful, erring on the side of
                not spending resources retransmitting previously delivered SETs. Other options,
                such as sending the SET to a "dead letter queue" for manual examination may also
                be appropriate.
      </t>
      <t>
                Implementers <bcp14>SHOULD</bcp14> evaluate the reliability requirements of their use cases and the
                impact of various retry mechanisms and retransmission policies on the performance
                of their systems to determine an appropriate strategy for handling various error
                conditions.
      </t>
    </section>
    <section anchor="Security" toc="default" numbered="true">
      <name>Security Considerations</name>
      <section anchor="payloadAuthentication" numbered="true" toc="default">
        <name>Authentication Using Signed SETs</name>
        <t>
		  JWS signed SETs can be
		  used (see <xref target="RFC7515" format="default"/> and
		  <xref target="RFC8417" sectionFormat="of" section="5"/>)
		  to enable the SET Recipient
		  to validate that the SET Issuer is authorized to provide actionable SETs.
        </t>
      </section>
      <section anchor="HTTP" numbered="true" toc="default">
        <name>HTTP Considerations</name>
        <t>SET delivery depends on the use of Hypertext Transfer Protocol and
        is thus subject to the security considerations of HTTP (<xref
        target="RFC7230" sectionFormat="of" section="9"/>) and its related
        specifications.</t>
      </section>
      <section anchor="Confidentiality" numbered="true" toc="default">
        <name>Confidentiality of SETs</name>
        <t>
		  SETs may contain sensitive information, including Personally
		  Identifiable Information (PII), or be distributed through
		  third parties.  In such cases, SET Transmitters and SET
		  Recipients <bcp14>MUST</bcp14> protect the confidentiality
		  of the SET contents.  TLS <bcp14>MUST</bcp14> be used to
		  secure the transmitted SETs.  In some use cases, encrypting
		  the SET as described in <xref target="RFC7516"
		  format="default">JWE</xref> will also be required.  The
		  Event delivery endpoint <bcp14>MUST</bcp14> support at least
		  TLS version 1.2 <xref target="RFC5246" format="default"/>
		  and <bcp14>SHOULD</bcp14> support the newest version of TLS
		  that meets its security requirements, which as of the time
		  of this publication is TLS 1.3 <xref target="RFC8446"
		  format="default"/>.  The client <bcp14>MUST</bcp14> perform
		  a TLS/SSL server certificate check using DNS-ID <xref
		  target="RFC6125" format="default"/> and/or DANE <xref
		  target="RFC6698" format="default"/>.  How a SET Transmitter
		  determines the expected service identity to match the SET
		  Recipient's server certificate against is out of scope for
		  this document.  The implementation security considerations
		  for TLS in "Recommendations for Secure Use of Transport
		  Layer Security (TLS) and Datagram Transport Layer Security
		  (DTLS)" <xref target="RFC7525" format="default"/>
		  <bcp14>MUST</bcp14> be followed.
        </t>
      </section>
      <section anchor="DoS" numbered="true" toc="default">
        <name>Denial of Service</name>
        <t>
                    The SET Recipient may be vulnerable to a denial-of-service attack where a
                    malicious party makes a high volume of requests containing invalid SETs,
                    causing the endpoint to expend significant resources on cryptographic
                    operations that are bound to fail. This may be mitigated by authenticating
                    SET Transmitters with a mechanism such as mutual TLS.
		    Rate-limiting problematic transmitters is also a possible means of mitigation.
        </t>
      </section>
      <section anchor="Persisted" numbered="true" toc="default">
        <name>Authenticating Persisted SETs</name>
        <t>
                    At the time of receipt, the SET Recipient can rely upon TLS
                    mechanisms, HTTP authentication methods, and/or other context from the
                    transmission request to authenticate the SET Transmitter and validate the
                    authenticity of the SET.  However, this context is typically unavailable to
                    systems to which the SET Recipient forwards the SET, or to systems that
                    retrieve the SET from storage.  If the SET Recipient requires the ability to
                    validate SET authenticity outside of the context of the transmission request,
                    then the SET Recipient <bcp14>SHOULD</bcp14> ensure that such SETs have been signed in
                    accordance with <xref target="RFC7515" format="default"/>.
		    Needed context could also be stored with the SET and retrieved with it.
        </t>
      </section>
    </section>
    <section anchor="Privacy" numbered="true" toc="default">
      <name>Privacy Considerations</name>
      <t>
                SET Transmitters should attempt to deliver SETs that are targeted to the specific
                business and protocol needs of subscribers.
      </t>
      <t>When sharing personally identifiable information or information
                that is otherwise considered confidential to affected users, SET
                Transmitters and Recipients <bcp14>MUST</bcp14> have the appropriate legal agreements
                and user consent or terms of service in place.
		Furthermore, data that needs confidentiality protection <bcp14>MUST</bcp14> be encrypted,
		at least with TLS
		and sometimes also using JSON Web Encryption (JWE) <xref target="RFC7516" format="default"/>.
      </t>
      <t>
	      In some cases, subject identifiers themselves may be considered sensitive
	      information, such that their inclusion within a SET may be considered a violation
	      of privacy.  SET Issuers and SET Transmitters should consider the ramifications of sharing a
	      particular subject identifier with a SET Recipient (e.g., whether doing so could
	      enable correlation and/or de-anonymization of data) and choose appropriate
	      subject identifiers for their use cases.
      </t>
    </section>
    <section anchor="IANA" numbered="true" toc="default">
      <name>IANA Considerations</name>
      <section anchor="iana_set_errors" numbered="true" toc="default">
        <name>Security Event Token Error Codes</name>
        <t>
                    This document defines Security Event Token Error
                    Codes, for which IANA has created and now maintains a
                    new registry titled "Security Event Token Error
                    Codes".  Initial values for the "Security Event Token
                    Error Codes" registry are defined in <xref
                    target="reqErrors" format="default"/> and registered
                    below.  Future assignments are to be made through the
                    Specification Required registration policy <xref
                    target="RFC8126" format="default"/> and shall follow the
                    template below.
        </t>
        <t>
                    Error Codes are intended to be interpreted by automated
                    systems; therefore, they <bcp14>SHOULD</bcp14> identify
                    classes of errors to which an automated system could
                    respond in a meaningfully distinct way (e.g., by
                    refreshing authentication credentials and retrying the
                    request).
        </t>
        <t>
		  Error Code names are case sensitive.
		  Names may not match other registered names in a case-insensitive manner
		  unless the Designated Experts state that there is a compelling reason
		  to allow an exception.
        </t>
        <t>
		  Criteria that should be applied by the Designated Experts includes
		  determining whether the proposed registration duplicates existing functionality,
		  whether it is likely to be of general applicability
		  or whether it is useful only for a single application,
		  and whether the registration description is clear.
        </t>

        <t>
		  It is suggested that multiple Designated Experts be
		  appointed who are able to represent the perspectives of
		  different applications using this specification in order to
		  enable broadly informed review of registration decisions.
		  In cases where a registration decision could be perceived as
		  creating a conflict of interest for a particular expert,
		  that expert should defer to the judgment of the other
		  experts.
        </t>
        <section anchor="iana_set_errors_template" numbered="true" toc="default">
          <name>Registration Template</name>
          <dl newline="true" spacing="normal">
            <dt>Error Code</dt>
            <dd>
                                The name of the Security Event Token 
                                Error Code, as described in <xref
                                target="error_codes" format="default"/>. The
                                name <bcp14>MUST</bcp14> be a case-sensitive
                                ASCII string consisting only of letters,
                                digits, and underscore; these are the
                                characters whose codes fall within the
                                inclusive ranges 0x30-39, 0x41-5A, 0x5F, and
                                0x61-7A.
                            </dd>
            <dt>Description</dt>
            <dd>
                                A brief human-readable description of the Security Event Token 
                                Error Code.
                            </dd>
            <dt>Change Controller</dt>
            <dd>
                                For error codes registered by the IETF or its working groups, list "IETF".
				For all other error codes, list the name of the
                                party responsible for the registration.  Contact information such as
                                mailing address, email address, or phone number may also be provided.
                            </dd>
            <dt>Reference</dt>
            <dd>
                                A reference to the document or documents that define the Security Event
                                Token Error Code. The definition <bcp14>MUST</bcp14> specify the name and
                                description of the error code and explain under what circumstances the
                                error code may be used. URIs that can be used to retrieve copies of each
                                document at no cost <bcp14>SHOULD</bcp14> be included.
                            </dd>
          </dl>
        </section>
        <section anchor="InitialContents" numbered="true" toc="default">
          <name>Initial Registry Contents</name>
          <dl newline="false" spacing="compact">
            <dt>Error Code:</dt><dd>invalid_request</dd>

            <dt>Description:</dt><dd>The request body cannot be parsed as a SET or the Event
                          Payload within the SET does not conform to the event's definition.</dd>

            <dt>Change Controller:</dt><dd>IETF</dd>

            <dt>Reference:</dt><dd>
		      <xref target="error_codes" format="default"/> of RFC 8935
		      </dd>
          </dl>

          <dl newline="false" spacing="compact">
            <dt>Error Code:</dt><dd>invalid_key</dd>
            <dt>Description:</dt><dd>One or more keys used to encrypt or sign the SET is invalid
                          or otherwise unacceptable to the SET Recipient (expired, revoked,
                          failed certificate validation, etc.).</dd>
            <dt>Change Controller:</dt><dd>IETF</dd>
            <dt>Reference:</dt><dd>
		      <xref target="error_codes" format="default"/> of RFC 8935
		      </dd>
          </dl>

          <dl newline="false" spacing="compact">
            <dt>Error Code:</dt><dd>invalid_issuer</dd>
            <dt>Description:</dt><dd>The SET Issuer is invalid for the SET Recipient.</dd>
            <dt>Change Controller:</dt><dd>IETF</dd>
            <dt>Reference:</dt><dd>
		      <xref target="error_codes" format="default"/> of RFC 8935
		      </dd>
          </dl>

          <dl newline="false" spacing="compact">
            <dt>Error Code:</dt><dd>invalid_audience</dd>
            <dt>Description:</dt><dd>The SET Audience does not correspond to the SET Recipient.</dd>
            <dt>Change Controller:</dt><dd>IETF</dd>
            <dt>Reference:</dt><dd>
		      <xref target="error_codes" format="default"/> of RFC 8935
		      </dd>
          </dl>

          <dl newline="false" spacing="compact">
            <dt>Error Code:</dt><dd>authentication_failed</dd>
            <dt>Description:</dt><dd>The SET Recipient could not authenticate the SET Transmitter.</dd>
            <dt>Change Controller:</dt><dd>IETF</dd>
            <dt>Reference:</dt><dd>
		      <xref target="error_codes" format="default"/> of RFC 8935
		      </dd>
          </dl>
          <dl newline="false" spacing="compact">
            <dt>Error Code:</dt><dd>access_denied</dd>
            <dt>Description:</dt><dd>The SET Transmitter is not authorized to transmit the
                          SET to the SET Recipient.</dd>
            <dt>Change Controller:</dt><dd>IETF</dd>
            <dt>Reference:</dt><dd> 
		      <xref target="error_codes" format="default"/> of RFC 8935
		      </dd>
          </dl>
        </section>
      </section>
    </section>
  </middle>
  <back>

    <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.2277.xml"/>

            <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.2818.xml"/>

            <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.5246.xml"/>


            <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.6125.xml"/>

            <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.6698.xml"/>


	    <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.7230.xml"/>

            <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.7231.xml"/>

            <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.7515.xml"/>

            <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.7516.xml"/>

            <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.7519.xml"/>

            <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.7525.xml"/>


            <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8126.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.8259.xml"/>

            <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8417.xml"/>

	    <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8446.xml"/>

        </references>
      <references>
        <name>Informative References</name>


<reference anchor="RFC8936" target="https://www.rfc-editor.org/info/rfc8936">

<front>
<title>Poll-Based Security Event Token (SET) Delivery Using HTTP</title>

<author initials='A' surname='Backman' fullname='Annabelle Backman' role='editor'>
    <organization />
</author>

<author initials='M' surname='Jones' fullname='Michael Jones' role="editor">
    <organization />
</author>

<author initials='M' surname='Scurtescu' fullname='Marius Scurtescu'>
    <organization />
</author>

<author initials='M' surname='Ansari' fullname='Morteza Ansari'>
    <organization />
</author>

<author initials='A' surname='Nadalin' fullname='Anthony Nadalin'>
    <organization />
</author>

<date month='November' year='2020' />

</front>

<seriesInfo name="RFC" value="8936"/>
<seriesInfo name="DOI" value="10.17487/RFC8936"/>
</reference>


        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.7235.xml"/>

        </references>
    </references>
    <section anchor="Unencrypted" numbered="true" toc="default">
      <name>Unencrypted Transport Considerations</name>
      <t>
	    Earlier versions of this specification made the use of TLS optional
	    and described security and privacy considerations resulting from use
	    of unencrypted HTTP as the underlying transport.
	    When the working group decided to mandate usage of HTTP over TLS,
	    it also decided to preserve the description of these considerations
	    in this non-normative appendix.
      </t>
      <t>
	    SETs may contain sensitive information that is considered
	    Personally Identifiable Information (PII).
	    In such cases, SET Transmitters and
	    SET Recipients <bcp14>MUST</bcp14> protect the confidentiality of the SET contents.
	    When TLS is not used, this means that the SET <bcp14>MUST</bcp14> be encrypted
	    as described in <xref target="RFC7516" format="default">JWE</xref>.
      </t>
      <t>
	    If SETs were allowed to be transmitted over unencrypted channels, some privacy-sensitive
	    information about them might leak, even though the SETs themselves are encrypted.
	    For instance, an attacker may be able to determine whether or not a SET was accepted and the reason for its rejection
	    or may be able to derive information from being able to observe the size of the encrypted SET.
	    (Note that even when TLS is utilized, some information leakage is still possible;
	    message padding algorithms to prevent side channels remain an open research topic.)
      </t>
    </section>

    <section anchor="Acknowledgments" numbered="false" toc="default">
      <name>Acknowledgments</name>
      <t>
	    The editors would like to thank the members of the SCIM Working Group, which
	    began discussions of provisioning events starting with draft-hunt-scim-notify-00 in 2015.
	    We would like to thank <contact fullname="Phil Hunt"/> and the other authors of draft-ietf-secevent-delivery-02,
	    upon which this specification is based.
	    We would like to thank the participants in the SecEvents
	    Working Group for their contributions to this specification.
      </t>
      <t>
	    Additionally, we would like to thank the following individuals for their reviews of the specification:
	    <contact fullname="Joe Clarke"/>,
	    <contact fullname="Roman Danyliw"/>,
	    <contact fullname="Vijay Gurbani"/>,
	    <contact fullname="Benjamin Kaduk"/>,
	    <contact fullname="Erik Kline"/>,
	    <contact fullname="Murray Kucherawy"/>,
	    <contact fullname="Barry Leiba"/>,
	    <contact fullname="Yaron Sheffer"/>,
	    <contact fullname="Robert Sparks"/>,
	    <contact fullname="Valery Smyslov"/>,
	    <contact fullname="Éric Vyncke"/>,
	    and
	    <contact fullname="Robert Wilton"/>.
      </t>
    </section>

  </back>
</rfc>
