RFC 8417

Security Event Token (SET)

πŸ“… published July 2018, from ietf

Security Event Token (SET) πŸ¦‹

Okay bestie, let's set the scene πŸ’… This is RFC 8417, titled Security Event Token (SET), and it's a Standards Track document, so it's the real deal πŸ”₯ It was published by the IETF in July 2018 and carries ISSN 2070-1721. The authors are P. Hunt (Ed.) from Oracle, M. Jones from Microsoft, W. Denniss from Google, and M. Ansari from Cisco. The header doesn't list anything it obsoletes or updates, so it's standing on its own 🌸


Abstract

This spec defines the Security Event Token (SET) data structure πŸŽ€ A SET is basically a "here's a fact" message from an issuer's point of view about a subject. These facts describe an event that happened directly to a security subject, or about one. Think of a statement about a token being issued or revoked for someone. The whole point is to represent security- and identity-related events ✨ A SET is a JSON Web Token (JWT), which can be optionally signed and/or encrypted, and SETs can be sent around with protocols like HTTP πŸ¦‹


Status of This Memo

This is an Internet Standards Track document. ⭐

This document is a product of the Internet Engineering Task Force (IETF). It represents the consensus of the IETF community, it got public review, and the Internet Engineering Steering Group (IESG) approved it for publication 🫢 If you want more info on Internet Standards, check out Section 2 of RFC 7841. For the current status, any errata, and how to give feedback, head to https://www.rfc-editor.org/info/rfc8417 πŸ’œ


Copyright (c) 2018 IETF Trust and the persons identified as the document authors. All rights reserved. 🌈

This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/license-info) as they stood on the publication date. Read these carefully, because they spell out your rights and restrictions for this document πŸ“œ Any Code Components pulled out of this doc must include Simplified BSD License text, as described in Section 4.e of the Trust Legal Provisions, and they come without warranty, just like the Simplified BSD License says πŸ”₯


Table of Contents 🧚

1.  Introduction and Overview . . . . . . . . . . . . . . . . . .   4
  1.1.  Notational Conventions  . . . . . . . . . . . . . . . . .   5
  1.2.  Definitions . . . . . . . . . . . . . . . . . . . . . . .   5
2.  The Security Event Token (SET)  . . . . . . . . . . . . . . .   6
  2.1.  Illustrative Examples . . . . . . . . . . . . . . . . . .   7
    2.1.1.  SCIM Example  . . . . . . . . . . . . . . . . . . . .   7
    2.1.2.  Logout Example  . . . . . . . . . . . . . . . . . . .   9
    2.1.3.  Consent Example . . . . . . . . . . . . . . . . . . .  10
    2.1.4.  RISC Example  . . . . . . . . . . . . . . . . . . . .  11
  2.2.  Core SET Claims . . . . . . . . . . . . . . . . . . . . .  11
  2.3.  Explicit Typing of SETs . . . . . . . . . . . . . . . . .  13
  2.4.  Security Event Token Construction . . . . . . . . . . . .  14
3.  Requirements for SET Profiles . . . . . . . . . . . . . . . .  16
4.  Preventing Confusion between SETs and Other JWTs  . . . . . .  17
  4.1.  Distinguishing SETs from ID Tokens  . . . . . . . . . . .  17
  4.2.  Distinguishing SETs from Access Tokens  . . . . . . . . .  18
  4.3.  Distinguishing SETs from Other Kinds of JWTs  . . . . . .  18
5.  Security Considerations . . . . . . . . . . . . . . . . . . .  19
  5.1.  Confidentiality and Integrity . . . . . . . . . . . . . .  19
  5.2.  Delivery  . . . . . . . . . . . . . . . . . . . . . . . .  20
  5.3.  Sequencing  . . . . . . . . . . . . . . . . . . . . . . .  20
  5.4.  Timing Issues . . . . . . . . . . . . . . . . . . . . . .  20
  5.5.  Preventing Confusion  . . . . . . . . . . . . . . . . . .  21
6.  Privacy Considerations  . . . . . . . . . . . . . . . . . . .  21
7.  IANA Considerations . . . . . . . . . . . . . . . . . . . . .  22
  7.1.  JSON Web Token Claims Registration  . . . . . . . . . . .  22
    7.1.1.  Registry Contents . . . . . . . . . . . . . . . . . .  22
  7.2.  Structured Syntax Suffix Registration . . . . . . . . . .  22
    7.2.1.  Registry Contents . . . . . . . . . . . . . . . . . .  23
  7.3.  Media Type Registration . . . . . . . . . . . . . . . . .  24
    7.3.1.  Registry Contents . . . . . . . . . . . . . . . . . .  24
8.  References  . . . . . . . . . . . . . . . . . . . . . . . . .  25
  8.1.  Normative References  . . . . . . . . . . . . . . . . . .  25
  8.2.  Informative References  . . . . . . . . . . . . . . . . .  26
Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . .  27
Authors' Addresses  . . . . . . . . . . . . . . . . . . . . . . .  28

1. Introduction and Overview ✨

Here's the core idea πŸ’– This spec defines an extensible Security Event Token (SET) data structure that can be exchanged over protocols like HTTP. It builds on the JSON Web Token (JWT) format [RFC7519] to give you a self-contained token. That token can optionally be signed using JSON Web Signature (JWS) [RFC7515] and/or encrypted using JSON Web Encryption (JWE) [RFC7516] πŸ¦‹

This spec profiles how JWT gets used for issuing SETs 🌸 It gives a base format that profiling specifications use to define actual events and what they mean. It also includes non-normative example events so you can see how events get built 🧚

This spec is scoped to security- and identity-related events. SETs could be used for other things, but this spec only looks at the security and privacy concerns tied to identity and personal information πŸ”

Security events are not commands issued between parties πŸ™ˆ A SET is a statement of fact from the issuer's point of view about a subject, like a web resource, a token, an IP address, or the issuer itself. These statements describe a logical event that occurred directly to or about a security subject, for example a statement about a token being issued or revoked on behalf of a subject. A security subject can be permanent (like a user account) or temporary (like an HTTP session). A state change could describe a direct change of entity state, an implicit change of state, or other higher-level security statements, such as:

  • The creation, modification, removal of a resource.
  • The resetting or suspension of an account.
  • The revocation of a security token prior to its expiry.
  • The logout of a user session.
  • An indication that a user has been given control of an email identifier that was previously controlled by another user.

Subject state changes are often triggered by a user agent or a security subsystem, but the issuing and sending of an event can happen asynchronously, over a back channel, relative to the action that caused the change πŸ’Œ After that, a SET recipient gets the SET, validates and interprets it, and takes its own independent actions, if any. For example, if the recipient is told that a personal identifier is now associated with a different security subject (say, an email address is being used by someone else), the SET recipient may choose to make sure the new user doesn't get access to resources tied to the previous user. Or the SET recipient may have no relationship with the subject at all, and then no action is taken πŸ€·β€β™€οΈ

SET recipients will often take action when they get a SET, but security events can't be assumed to be commands or requests πŸ™…β€β™€οΈ The whole goal of this spec is to define a syntax for statements of fact that recipients can interpret for their own purposes πŸ‘‘


1.1. Notational Conventions

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here πŸ“– Lowercase versions don't count, so they're just regular words πŸ’…

For readability, the examples aren't URL encoded. Still, Implementers MUST percent-encode URLs as described in Section 2.1 of [RFC3986] πŸ”—

Throughout this document, figures may contain spaces and extra line wrapping so they fit and read nicely. Some URIs inside the examples have also been shortened for space and readability ✨


1.2. Definitions

These are the definitions used with SETs 🧠

Security Event Token (SET) A SET is a JWT [RFC7519] conforming to this specification. πŸ’–

SET Issuer A service provider that creates SETs to be sent to other service providers known as SET recipients. πŸŽ€

SET Recipient A SET recipient is an entity that receives SETs through some distribution method. A SET recipient is the same entity referred to as a "recipient" in [RFC7519] or "receiver" in related specifications. πŸ¦‹

Subject A SET describes an event or state change that has occurred to a subject. A subject might, for instance, be a principal (e.g., Section 4.1.2 of [RFC7519]), a web resource, an entity such as an IP address, or the issuer of the SET. 🌸

Event Identifier A member name for an element of the JSON object that is the value of the "events" claim in a SET. This member name MUST be a URI. πŸ”‘

Event Payload A member value for an element of the JSON object that is the value of the "events" claim in a SET. This member value MUST be a JSON object. πŸ“¦

Profiling Specification A specification that profiles the SET data structure to define one or more specific event types and their associated claims and processing rules. 🧚

2. The Security Event Token (SET) ✨

okay so a SET is a JWT [RFC7519] data structure πŸŽ€ that represents one or more related aspects of a security event that happened to a subject. the JWT Claims Set inside a SET has this vibe:

  • the top-level claims are called the SET "envelope" πŸ’Œ some show up in every single SET, and others are specific to particular SET profiles or profile families. claims in the envelope SHOULD be registered in the "JSON Web Token Claims" registry [IANA.JWT.Claims] or be Public Claims or Private Claims, as defined in [RFC7519].
  • the envelope claims that this spec profiles and defines are used to validate the SET and to give info about the event data inside it. the "events" claim holds the event identifiers and the event-specific data about the security subject πŸ‘‘ the envelope MAY include event-specific or profile-specific data. the "events" claim value MUST be a JSON object that has at least one member.
  • each member of the "events" object is a name/value pair. the name is a URI string (that's the event identifier), and the value is a JSON object called the event "payload" 🧚 the payload holds claims about that event identifier, and they don't have to be registered as JWT claims. the profiling spec that defines the event decides what those claims are. an event with no payload claims SHALL be represented as the empty JSON object ("{}").
  • when a SET has multiple event identifiers, they represent different aspects of the same state transition that happened to the security subject πŸ”₯ they are definitely not for stacking up distinct events about the same subject. beyond that, how SETs with multiple event identifiers get interpreted is out of scope for this spec. profiling specs MAY define their own rules for using SETs with multiple event identifiers, as described in Section 3. possible uses of multiple values include, but are not limited to:
    • classification info, like threat type or level πŸ™ˆ
    • additions to existing event representations
    • values used to link potential series of events
    • specific-purpose event URIs used between particular SET issuers and SET recipients

2.1. Illustrative Examples

okay examples time πŸ¦‹ this section shows some possible uses of SETs. these are non-normative, so think of them as vibes, not rules.

2.1.1. SCIM Example

here's a hypothetical System for Cross-domain Identity Management (SCIM) [RFC7644] password reset SET πŸ” a receiver might use it as a trigger to reset the active user-agent sessions tied to the identified user.

{
  "iss": "https://scim.example.com",
  "iat": 1458496025,
  "jti": "3d0c3cf797584bd193bd0fb1bd4e7d30",
  "aud": [
    "https://jhub.example.com/Feeds/98d52461fa5bbc879593b7754",
    "https://jhub.example.com/Feeds/5d7604516b1d08641d7676ee7"
  ],
  "sub": "https://scim.example.com/Users/44f6142df96bd6ab61e7521d9",
  "events": {
    "urn:ietf:params:scim:event:passwordReset": {
      "id": "44f6142df96bd6ab61e7521d9"
    },
    "https://example.com/scim/event/passwordResetExt": {
      "resetAttempts": 5
    }
  }
}

Figure 1: Example SCIM Password Reset Event

the JWT Claims Set usage looks like this:

  • the "events" claim has the hypothetical SCIM URN ("urn:ietf:params:scim:event:passwordReset") for a password reset, plus a second value, https://example.com/scim/event/passwordResetExt, which adds extra event info like the current count of resets πŸ“
  • the "iss" claim is the SET issuer.
  • the "sub" claim is the SCIM resource URI that was affected.
  • the "aud" claim is the intended audiences for the event. (The syntax of the "aud" claim is defined in Section 4.1.3 of [RFC7519].)

the SET has two event payloads:

  • the "id" claim is SCIM's unique identifier for a subject.
  • the second payload, identified by https://example.com/scim/event/passwordResetExt, has a "resetAttempts" payload claim that conveys the current count of reset attempts. the count is a simple fact from the issuer's side, but what the number means is up to the receiver. for example, the receiver could use it to infer increasing risk πŸ‘€

so in this example, the SCIM event says a password has been updated and the current password reset count is 5. notice that the "resetAttempts" value lives in the event payload of the event that carries this info πŸ’…

2.1.2. Logout Example

another example, and this one is for a Logout Token 🌸

{
  "iss": "https://server.example.com",
  "sub": "248289761001",
  "aud": "s6BhdRkqt3",
  "iat": 1471566154,
  "jti": "bWJq",
  "sid": "08a5019c-17e1-4977-8f42-65a12843ea02",
  "events": {
    "http://schemas.openid.net/event/backchannel-logout": {}
  }
}

Figure 2: Example OpenID Back-Channel Logout Event

the SET above has an empty JSON object and uses the JWT claims "sub" and "sid" to identify the subject that got logged out. right now, as I'm writing this, the example matches the logout token defined in the OpenID Connect Back-Channel Logout 1.0 [OpenID.BackChannel] specification πŸ¦‹

in this example, a fictional medical service collects consent for medical actions and lets other parties know 🩺 the individual was originally authenticated via OpenID Connect. the issuer of this security event is an application, not the OpenID provider, so it's giving plot twist πŸŽ€

{
  "iss": "https://my.med.example.org",
  "iat": 1458496025,
  "jti": "fb4e75b5411e4e19b6c0fe87950f7749",
  "aud": [
    "https://rp.example.com"
  ],
  "events": {
    "https://openid.net/heart/specs/consent.html": {
      "iss": "https://connect.example.com",
      "sub": "248289761001",
      "consentUri": [
        "https://terms.med.example.org/labdisclosure.html#Agree"
      ]
    }
  }
}

Figure 3: Example Consent Event

in the example above, the "iss" inside the payload for https://openid.net/heart/specs/consent.html points to the issuer of the security subject ("sub"), not the SET issuer https://my.med.example.org. they're different things! the top-level "iss" always refers to the issuer of the event, which here is a medical consent service that's a relying party to the OpenID Provider 🧠

2.1.4. RISC Example

the next example is an account disabled event πŸ”₯ right now, this example matches the account disabled event defined in the OpenID RISC Event Types 1.0 [OpenID.RISC.Events] specification.

{
  "iss": "https://idp.example.com/",
  "jti": "756E69717565206964656E746966696572",
  "iat": 1508184845,
  "aud": "636C69656E745F6964",
  "events": {
"https://schemas.openid.net/secevent/risc/event-type/account-disabled"
        : {
      "subject": {
        "subject_type": "iss-sub",
        "iss": "https://idp.example.com/",
        "sub": "7375626A656374"
      },
      "reason": "hijacking"
    }
  }
}

Figure 4: Example RISC Event

notice that the event's parameters go in the event payload. in this case, that's the "reason" and "cause-time" values 🫢 the subject of the event is identified with the "subject" payload value, which is its own JSON object πŸ’œ

2.2. Core SET Claims πŸŽ€

okay so these are the claims we borrow from [RFC7519] and tailor for SETs, plus the new ones this spec adds πŸ’…

iss (Issuer) Claim 🏒

As defined by Section 4.1.1 of [RFC7519], this claim is a string naming the service provider that publishes the SET (the issuer). The issuer of the SET won't always be the issuer tied to the security subject of the SET, so implementers can't assume they're the same unless the profiling specification says they are for SETs following that profile. πŸ™…β€β™€οΈ This claim is REQUIRED.

iat (Issued At) Claim ⏰

As defined by Section 4.1.6 of [RFC7519], this claim holds a value for when the SET was issued. This claim is REQUIRED.

jti (JWT ID) Claim πŸ†”

As defined by Section 4.1.7 of [RFC7519], this claim is a unique identifier for the SET. The identifier MUST be unique within a particular event feed, and MAY be used by clients to track whether a particular SET has already been received. This claim is REQUIRED.

aud (Audience) Claim 🎯

As defined by Section 4.1.3 of [RFC7519], this claim contains one or more audience identifiers for the SET. This claim is RECOMMENDED.

sub (Subject) Claim 🧍

As defined by Section 4.1.2 of [RFC7519], this claim holds a StringOrURI value for the principal that is the subject of the SET. It's usually the entity whose "state" changed. For example:

  • an IP Address was added to a blacklist;
  • a URI representing a user resource that was modified; or,
  • a token identifier (e.g. "jti") for a revoked token.

If used, the profiling specification MUST define the content and format semantics for the value. This claim is OPTIONAL, since the principal for any given profile may already be identified without a subject claim. Also, some SET profiles MAY choose to convey event subject information in the event payload (either using the "sub" member name or another name), particularly if the subject information is relative to issuer information that is also conveyed in the event payload, which may be the case for some identity SET profiles. πŸͺ„

exp (Expiration Time) Claim βŒ›

As defined by Section 4.1.4 of [RFC7519], this claim is the time after which the JWT MUST NOT be accepted for processing. For a SET though, this doesn't usually apply, since a SET represents something that already happened and is historical in nature. So its use is NOT RECOMMENDED. (Also, see Section 4.1 for additional reasons not to use the "exp" claim in some SET use cases.) πŸ™ƒ

The following new claims are defined by this specification: 🌟

events (Security Events) Claim 🌟

This claim contains a set of event statements that each provide information describing a single logical event that has occurred about a security subject (e.g., a state change to the subject). Multiple event identifiers with the same value MUST NOT be used. The "events" claim MUST NOT be used to express multiple independent logical events. 🚫

The value of the "events" claim is a JSON object whose members are name/value pairs, where the names are URIs identifying the event statements being expressed. Event identifiers SHOULD be stable values (e.g., a permanent URL for an event specification). For each name present, the corresponding value MUST be a JSON object. That JSON object MAY be an empty object ("{}"), or it MAY be a JSON object containing data described by the profiling specification. πŸ“¦

txn (Transaction Identifier) Claim 🧾

An OPTIONAL string value that represents a unique transaction identifier. When multiple related JWTs are issued, the transaction identifier claim can be used to correlate them. Note that this claim can be used in JWTs that are SETs and also in JWTs using non-SET profiles. πŸ”—

toe (Time of Event) Claim ⏳

A value that represents the date and time at which the event occurred. This value is a NumericDate (see Section 2 of [RFC7519]). By omitting this claim, the issuer indicates that they are not sharing an event time with the recipient. (Note that in some use cases the represented time might be approximate; statements about the accuracy of this field MAY be made by profiling specifications.) This claim is OPTIONAL. πŸ•°οΈ


2.3. Explicit Typing of SETs 🏷️

This specification registers the "application/secevent+jwt" media type, which can be used to indicate that the content is a SET. SETs MAY include this media type in the "typ" header parameter of the JWT representing the SET, to explicitly declare that the JWT is a SET. This MUST be included if the SET could be used in an application context where it could be confused with other kinds of JWTs. 🫢

Per the definition of "typ" in Section 4.1.9 of [RFC7515], it is RECOMMENDED that the "application/" prefix be omitted. Therefore, the "typ" value used SHOULD be "secevent+jwt". ✨


2.4. Security Event Token Construction 🧱

This section describes how to construct a SET. Let's build one!

The following is an example JWT Claims Set for a hypothetical SCIM SET:

{
  "iss": "https://scim.example.com",
  "iat": 1458496404,
  "jti": "4d3559ec67504aaba65d40b0363faad8",
  "aud": [
    "https://scim.example.com/Feeds/98d52461fa5bbc879593b7754",
    "https://scim.example.com/Feeds/5d7604516b1d08641d7676ee7"
  ],
  "events": {
    "urn:ietf:params:scim:event:create": {
      "ref":
          "https://scim.example.com/Users/44f6142df96bd6ab61e7521d9",
      "attributes": ["id", "name", "userName", "password", "emails"]
    }
  }
}

Figure 5: Example Event Claims πŸ“Έ

The JSON Claims Set is encoded per [RFC7519]. πŸ”

In this example, the SCIM SET claims are encoded in an unsecured JWT. The JOSE Header for this example is:

{"typ":"secevent+jwt","alg":"none"}

Base64url encoding (as defined by Section 2 of [RFC7515], including the omission of all trailing '=' characters) of the octets of the UTF-8 [RFC3629] representation of the JOSE Header yields:

eyJ0eXAiOiJzZWNldmVudCtqd3QiLCJhbGciOiJub25lIn0

The above example JWT Claims Set (with insignificant whitespace removed) is encoded as follows (with line breaks for display purposes only):

eyJpc3MiOiJodHRwczovL3NjaW0uZXhhbXBsZS5jb20iLCJpYXQiOjE0NTg0OTY0M
DQsImp0aSI6IjRkMzU1OWVjNjc1MDRhYWJhNjVkNDBiMDM2M2ZhYWQ4IiwiYXVkIj
pbImh0dHBzOi8vc2NpbS5leGFtcGxlLmNvbS9GZWVkcy85OGQ1MjQ2MWZhNWJiYzg
3OTU5M2I3NzU0IiwiaHR0cHM6Ly9zY2ltLmV4YW1wbGUuY29tL0ZlZWRzLzVkNzYw
NDUxNmIxZDA4NjQxZDc2NzZlZTciXSwiZXZlbnRzIjp7InVybjppZXRmOnBhcmFtc
zpzY2ltOmV2ZW50OmNyZWF0ZSI6eyJyZWYiOiJodHRwczovL3NjaW0uZXhhbXBsZS
5jb20vVXNlcnMvNDRmNjE0MmRmOTZiZDZhYjYxZTc1MjFkOSIsImF0dHJpYnV0ZXM
iOlsiaWQiLCJuYW1lIiwidXNlck5hbWUiLCJwYXNzd29yZCIsImVtYWlscyJdfX19

The encoded JWS signature is the empty string. πŸ«₯

Concatenating the three encoded parts (JOSE Header, JWT Claims Set, and JWS signature) in order, with period ('.') characters between the parts, yields this complete SET (with line breaks for display purposes only):

eyJ0eXAiOiJzZWNldmVudCtqd3QiLCJhbGciOiJub25lIn0
.
eyJpc3MiOiJodHRwczovL3NjaW0uZXhhbXBsZS5jb20iLCJpYXQiOjE0NTg0OTY0M
DQsImp0aSI6IjRkMzU1OWVjNjc1MDRhYWJhNjVkNDBiMDM2M2ZhYWQ4IiwiYXVkIj
pbImh0dHBzOi8vc2NpbS5leGFtcGxlLmNvbS9GZWVkcy85OGQ1MjQ2MWZhNWJiYzg
3OTU5M2I3NzU0IiwiaHR0cHM6Ly9zY2ltLmV4YW1wbGUuY29tL0ZlZWRzLzVkNzYw
NDUxNmIxZDA4NjQxZDc2NzZlZTciXSwiZXZlbnRzIjp7InVybjppZXRmOnBhcmFtc
zpzY2ltOmV2ZW50OmNyZWF0ZSI6eyJyZWYiOiJodHRwczovL3NjaW0uZXhhbXBsZS
5jb20vVXNlcnMvNDRmNjE0MmRmOTZiZDZhYjYxZTc1MjFkOSIsImF0dHJpYnV0ZXM
iOlsiaWQiLCJuYW1lIiwidXNlck5hbWUiLCJwYXNzd29yZCIsImVtYWlscyJdfX19
.

Figure 6: Example Unsecured Security Event Token πŸ¦‹

For the purpose of having a simpler example in Figure 6, an unsecured token is shown. When SETs are not signed or encrypted, other mechanisms such as TLS MUST be employed to provide integrity protection, confidentiality, and issuer authenticity, as needed by the application. πŸ”’

When validation (i.e., auditing) or additional transmission security is required, JWS signing and/or JWE encryption MAY be used. To create and/or validate a signed and/or encrypted SET, follow the instructions in Section 7 of [RFC7519]. πŸ›‘οΈ


3. Requirements for SET Profiles πŸ“‹

Profiling specifications of this specification define actual SETs to be used in particular use cases. These profiling specifications define the syntax and semantics of SETs conforming to that SET profile, and the rules for validating those SETs. Profiling specifications SHOULD define syntax, semantics, subject identification, and validation. πŸ—‚οΈ

Syntax πŸ“

The syntax of the SETs defined, including:

  • Top-Level Claims: claims and values in the JWT Claims Set. Examples are claims defined by the JWT specification [RFC7519], this specification, and the profiling specification.
  • Event Payload: the JSON data structure contents and format, containing event-specific information, if any (see Section 1.2).

Semantics 🧠

Defining the semantics of the SET contents for SETs utilizing the profile is equally important. Possibly most important is defining the procedures used to validate the SET issuer, and to obtain the keys controlled by the issuer that were used for cryptographic operations in the JWT representing the SET. For instance, some profiles may define an algorithm for retrieving the SET issuer's keys that uses the "iss" claim value as its input. Likewise, if the profile allows (or requires) that the JWT be unsecured, the means by which the integrity of the JWT is ensured MUST be specified. πŸ”‘

Subject Identification πŸ”

Profiling specifications MUST define how the event subject is identified in the SET, as well as how to differentiate between the event subject's issuer and the SET issuer, if applicable. It is NOT RECOMMENDED for profiling specifications to use the "sub" claim in cases in which the subject is not globally unique and has a different issuer from the SET itself. πŸ™…β€β™€οΈ

Validation βœ…

Profiling specifications MUST clearly specify the steps that a recipient of a SET utilizing that profile MUST perform to validate that the SET is both syntactically and semantically valid. πŸ’―

Among the syntax and semantics of SETs that a profiling specification may define is whether the value of the "events" claim may contain multiple members, and what processing instructions are employed in the single- and multiple-valued cases for SETs conforming to that profile. Many valid choices are possible. For instance, some profiles might allow multiple event identifiers to be present and specify that any that are not understood by recipients be ignored, thus enabling extensibility. Other profiles might allow multiple event identifiers to be present but require that all be understood if the SET is to be accepted. Some profiles might require that only a single value be present. All such choices are within the scope of profiling specifications to define. 🌈

4. Preventing Confusion between SETs and Other JWTs ✨

okay so, [RFC7519] says that "all claims that are not understood by implementations MUST be ignored," and bestie, that opens up a whole can of worms πŸ™ˆ. A SET could get mixed up with another kind of JWT from the same issuer. Unless we stop that confusion, an attacker holding a SET could use it somewhere another kind of JWT is expected, or the other way around 😭. This section gives concrete techniques for stopping confusion with a few specific kinds of JWTs, plus generic techniques for any other JWT that might get mixed up with a SET πŸ’….

4.1. Distinguishing SETs from ID Tokens πŸŽ€

A SET might get mistaken for an ID Token [OpenID.Core] if someone accidentally (or on purpose) uses it where an ID Token is required πŸ‘€. If a SET could otherwise pass as a valid ID Token (because it has the required ID Token claims and valid issuer and audience claim values for an ID Token), then that SET profile MUST require that the exp claim not be present in the SET. Since exp is a required claim in ID Tokens, valid ID Token implementations will reject such a SET if it's presented as an ID Token, so it's not gonna slip through πŸ™…β€β™€οΈ.

Leaving exp out of SETs that could be mistaken for ID Tokens is actually defense in depth πŸ›‘οΈ. In any OpenID Connect context where an attacker might try to swap a SET in for an ID Token, the SET would already be rejected as an ID Token anyway, because it wouldn't have the correct nonce claim value that an ID Token needs to be accepted in those contexts. Iconic layering, honestly πŸ’–.

Also, explicit typing (the stuff in Section 2.3) will NOT help tell ID Tokens and SETs apart, because the ID Token validation rules don't look at the typ header parameter value πŸ™ƒ.

4.2. Distinguishing SETs from Access Tokens πŸ¦‹

OAuth 2.0 [RFC6749] says access tokens are opaque 🫣. Still, some implementations make access tokens into JWTs anyway. Since the structure of those JWTs is up to each implementation, keeping a SET from being confused with such an access token is also mostly implementation specific, generally speaking ✨. Even so, it is RECOMMENDED that SET profiles use the following strategies to prevent possible swaps of SETs for access tokens wherever that might happen 🌸:

  • Prohibit use of the exp claim, same as we do to prevent ID Token confusion 🚫.
  • Where possible, use a separate aud claim value to tell apart the SET recipient and the protected resource that is the audience of an access token 🎯.
  • Modify access token validation systems to check for the presence of the events claim as a way to detect security event tokens πŸ”. This is especially useful if the same endpoint might receive both types of tokens πŸ‘‘.
  • Employ explicit typing, as described in Section 2.3, and modify access token validation systems to use the typ header parameter value πŸ’….

4.3. Distinguishing SETs from Other Kinds of JWTs 🌈

JWTs are showing up everywhere now, way beyond the identity apps where they first popped off πŸ’–. For example, the "Session Initiation Protocol (SIP) Via Header Field Parameter to Indicate Received Realm" [RFC8055] and "PASSporT: Personal Assertion Token" [RFC8225] specs both define JWT profiles that use mostly or completely different sets of claims than ID Tokens do 🧚. So if an attacker could otherwise swap a SET in for one of these (or some other kind of JWT), the SET profile must be defined so that any substituted SET gets rejected when validated as the intended kind of JWT πŸš«πŸ™…β€β™€οΈ.

The most direct way to stop the confusion is explicit typing, as described in Section 2.3, plus modifying the relevant token validation systems to use the typ header parameter value πŸŽ€. This works for new systems, but it might not fit existing ones πŸ₯².

Another option is having the JWT validation logic reject any JWT containing an events claim unless that JWT is meant to be a SET 🧐. This also works best for new systems and might not fit existing ones. Checking that the JWT has an events claim is effective at stopping attackers from passing off other kinds of JWTs as SETs πŸ”₯.

For lots of use cases, the simplest move is requiring that the SET NOT include claims that are required for the kind of JWT that might be targeted by an attack πŸ™Œ. For example, for [RFC8055], the sip_callid claim could be omitted, and for [RFC8225], the orig claim could be omitted πŸ“.

Honestly, in many contexts simple measures like these will do the job, if confusion is even possible in the first place ✨. Also, this topic is being explored more generally in "JSON Web Token Best Current Practices" [JWT-BCP], so check that out too πŸ“š. The best practices proposed in that document may also apply to particular SET profiles and use cases πŸ’œ.


5. Security Considerations πŸ”

Okay, this section is serious business, bestie 😀, so pay attention!!

5.1. Confidentiality and Integrity πŸ”’

SETs may carry sensitive info 😬. So methods for distributing events SHOULD require a transport-layer security mechanism when events are being distributed πŸ›‘οΈ. Parties MUST support TLS 1.2 [RFC5246] or a higher version, and they MAY support additional transport-layer mechanisms that meet its security requirements πŸ”. When using TLS, the client MUST perform a TLS server certificate check, per [RFC6125] 🧐. Implementation security considerations for TLS can be found in "Recommendations for Secure Use of Transport Layer Security (TLS) and Datagram Transport Layer Security (DTLS)" [RFC7525] πŸ“–.

Security events that get distributed through third parties or that carry personally identifiable information MUST be encrypted using JWE [RFC7516] or secured for confidentiality by other means 🚨. No exceptions, periodt πŸ’€.

Unless the integrity of the JWT is ensured by other means, it MUST be signed using JWS [RFC7515] by an issuer that is trusted to do so for the use case, so the SET can be authenticated and validated by the SET recipient πŸ–‹οΈβœ¨.

5.2. Delivery πŸ“¬

This specification does NOT define a delivery mechanism for SETs πŸ™…β€β™€οΈ. On top of confidentiality and integrity (we just talked about those), implementers and profiling specifications must think through the consequences of delivery mechanisms that aren't secure and/or aren't assured 😰. For example, even if a SET is end-to-end secured using JWE-encrypted SETs, without (mutual) TLS there's no assurance that the correct endpoint received the SET or that it could be processed successfully 😭.

5.3. Sequencing πŸ”’

This specification defines NO means of ordering multiple SETs in a sequence πŸ™ˆ. Depending on the type and nature of the events the SETs represent, order may or may not matter πŸ€·β€β™€οΈ. For example, in provisioning, event order is critical, because an object can't be modified before it's created πŸ™…β€β™€οΈ. For other SET types, like a token revocation, the order of SETs for revoked tokens doesn't matter πŸ’β€β™€οΈ. But if the event conveys a logged-in or logged-out status for a user subject, then order becomes important 🚨.

Profiling specifications and implementers SHOULD take caution when using timestamps such as iat to define order πŸ•°οΈ. Distributed systems will have some amount of clock skew, so time by itself will NOT guarantee order πŸ˜΅β€πŸ’«.

Specifications profiling SET SHOULD define a mechanism for detecting order or sequence of events when order matters πŸ”. For example, the txn claim could contain an ordered value (like a counter) that the issuer includes. Just like with timestamps though, making sure of ordering can be tricky in distributed systems πŸ₯΄πŸ’«.

5.4. Timing Issues ⏰

When SETs are delivered asynchronously and/or out-of-band with respect to the original action that caused the security event, it's important to remember that a SET might reach the SET recipient before or after the process that caused the event πŸƒβ€β™€οΈ. For example, say a user was required to log out and then log back in again. That could cause a "token revoked" SET to be issued, which typically makes the receiver reset all active sessions related to that user 😱. If a revocation SET shows up at the same moment the user agent logs back in, the timing could cause problems by wrongly treating the new user session as logged out πŸ’€.

Profiling specifications SHOULD be careful to consider both SET expression and timing issues 🧠. For example, it might be more appropriate to revoke a specific session or ID Token rather than issuing a general logout statement about a "user" 🎯. Alternatively, profiling specifications could use timestamps that let new sessions start right after a stated logout event time ⏱️✨.

5.5. Preventing Confusion πŸ™ˆ

Also, check out Section 4 above for more security considerations and normative text on preventing SETs from being confused with other kinds of JWTs πŸ”πŸ’….

6. Privacy Considerations πŸ•΅οΈβ€β™€οΈ

If a SET needs to be kept for audit purposes, the signature can be used to verify its authenticity 🧾.

SET issuers SHOULD try to specialize SETs so their content is targeted to the specific business and protocol needs of the intended SET recipients 🎯.

When sharing personally identifiable information, or information otherwise considered confidential, with affected users, SET issuers and recipients should have the appropriate legal agreements, user consent, and/or terms of service in place πŸ“πŸ«Ά.

Propagating subject identifiers can be perceived as personally identifiable information 😬. Where possible, SET issuers and recipients SHOULD devise approaches that prevent propagation, for example by passing a salted hash value that requires the SET recipient to know the subject πŸ§‚πŸ”.

In some cases, a SET recipient might be able to correlate different events and thereby learn things about a subject that the SET issuer didn't mean to share πŸ‘€. For example, a SET recipient might be able to use iat values or highly precise toe values to figure out that two events that seem unrelated actually belong to the same real-world event πŸ•΅οΈ. Combining information from both events could let a SET recipient de-anonymize data or recognize that unrelated identifiers belong to the same individual 😱. SET issuers SHOULD take steps to minimize the chance of event correlation when that correlation would be a privacy violation πŸ›‘οΈ. For instance, they could use approximate values for the toe claim or arbitrarily delay SET issuance, where that delay can be tolerated β³πŸ’–.

7. IANA Considerations πŸ“‹

7.1. JSON Web Token Claims Registration πŸŽ€

IANA has registered the "events", "toe", and "txn" claims in the IANA "JSON Web Token Claims" registry [IANA.JWT.Claims], which was established by [RFC7519] 🌸.

7.1.1. Registry Contents πŸ“

  • Claim Name: "events"
  • Claim Description: Security Events
  • Change Controller: IESG
  • Specification Document(s): Section 2.2 of [RFC8417]
  • Claim Name: "toe"
  • Claim Description: Time of Event
  • Change Controller: IESG
  • Specification Document(s): Section 2.2 of [RFC8417]
  • Claim Name: "txn"
  • Claim Description: Transaction Identifier
  • Change Controller: IESG
  • Specification Document(s): Section 2.2 of [RFC8417]

7.2. Structured Syntax Suffix Registration πŸŽ€

IANA has registered the "+jwt" structured syntax suffix [RFC6838] in the "Structured Syntax Suffix" registry [IANA.StructuredSuffix] in the manner described in [RFC6838], which can be used to indicate that the media type is encoded as a JWT. ✨ Okay so this is basically IANA saying "+jwt" is officially a suffix you can slap on a media type to say "hey, this bad boy is a JWT" πŸ’…

7.2.1. Registry Contents πŸ¦‹

  • Name: JSON Web Token (JWT) 🌸
  • +suffix: +jwt
  • References: Section 3 of [RFC7519], Section 7.2 of [RFC8417]
  • Encoding Considerations: binary; JWT values are encoded as a series of base64url-encoded values (with trailing '=' characters removed), some of which may be the empty string, separated by period ('.') characters. πŸ”₯
  • Interoperability Considerations: N/A
  • Fragment Identifier Considerations: The syntax and semantics of fragment identifiers specified for +jwt SHOULD be as specified for "application/jwt". (At publication of this document, there is no fragment identification syntax defined for "application/jwt".) πŸ™ˆ

The syntax and semantics for fragment identifiers for a specific "xxx/yyy+jwt" SHOULD be processed as follows: πŸ’–

For cases defined in +jwt where the fragment identifier resolves per the +jwt rules, process as specified in +jwt.

For cases defined in +jwt where the fragment identifier does not resolve per the +jwt rules, process as specified in "xxx/yyy+jwt".

For cases not defined in +jwt, process as specified in "xxx/yyy+jwt".

  • Security Considerations: See Section 11 of [RFC7519]. πŸ”
  • Contact: Michael B. Jones, mbj@microsoft.com πŸ“§
  • Author/Change Controller: Security Events Working Group. The IESG has change control over this registration. πŸ‘‘

7.3. Media Type Registration 🧚

7.3.1. Registry Contents πŸ’œ

This section registers the "application/secevent+jwt" media type [RFC2046] in the "Media Types" registry [IANA.MediaTypes] in the manner described in [RFC6838], which can be used to indicate that the content is a SET. This is the one that says "yep, this is a Security Event Token" πŸ¦‹

  • Type name: application
  • Subtype name: secevent+jwt
  • Required parameters: N/A
  • Optional parameters: N/A
  • Encoding considerations: binary; A SET is a JWT; JWT values are encoded as a series of base64url-encoded values (with trailing '=' characters removed), some of which may be the empty string, separated by period ('.') characters. 🌈
  • Security considerations: See Section 5 of [RFC8417] πŸ›‘οΈ
  • Interoperability considerations: N/A
  • Published specification: Section 2.3 of [RFC8417]
  • Applications that use this media type: Applications that exchange SETs
  • Fragment identifier considerations: N/A
  • Additional information:
    • Magic number(s): N/A
    • File extension(s): N/A
    • Macintosh file type code(s): N/A
  • Person & email address to contact for further information: Michael B. Jones, mbj@microsoft.com
  • Intended usage: COMMON
  • Restrictions on usage: none
  • Author: Michael B. Jones, mbj@microsoft.com
  • Change controller: IESG
  • Provisional registration? No

8. References πŸ“š

8.1. Normative References πŸŽ€

[IANA.JWT.Claims]
           IANA, "JSON Web Token Claims",
           <http://www.iana.org/assignments/jwt>.

[IANA.MediaTypes]
           IANA, "Media Types",
           <http://www.iana.org/assignments/media-types>.

[IANA.StructuredSuffix]
           IANA, "Structured Syntax Suffix",
           <https://www.iana.org/assignments/
           media-type-structured-suffix/>.

[RFC2119]  Bradner, S., "Key words for use in RFCs to Indicate
           Requirement Levels", BCP 14, RFC 2119,
           DOI 10.17487/RFC2119, March 1997,
           <https://www.rfc-editor.org/info/rfc2119>.

[RFC3629]  Yergeau, F., "UTF-8, a transformation format of ISO
           10646", STD 63, RFC 3629, DOI 10.17487/RFC3629, November
           2003, <https://www.rfc-editor.org/info/rfc3629>.

[RFC3986]  Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform
           Resource Identifier (URI): Generic Syntax", STD 66,
           RFC 3986, DOI 10.17487/RFC3986, January 2005,
           <https://www.rfc-editor.org/info/rfc3986>.

[RFC5246]  Dierks, T. and E. Rescorla, "The Transport Layer Security
           (TLS) Protocol Version 1.2", RFC 5246,
           DOI 10.17487/RFC5246, August 2008,
           <https://www.rfc-editor.org/info/rfc5246>.

[RFC6125]  Saint-Andre, P. and J. Hodges, "Representation and
           Verification of Domain-Based Application Service Identity
           within Internet Public Key Infrastructure Using X.509
           (PKIX) Certificates in the Context of Transport Layer
           Security (TLS)", RFC 6125, DOI 10.17487/RFC6125, March
           2011, <https://www.rfc-editor.org/info/rfc6125>.

[RFC6749]  Hardt, D., Ed., "The OAuth 2.0 Authorization Framework",
           RFC 6749, DOI 10.17487/RFC6749, October 2012,
           <https://www.rfc-editor.org/info/rfc6749>.

[RFC7515]  Jones, M., Bradley, J., and N. Sakimura, "JSON Web
           Signature (JWS)", RFC 7515, DOI 10.17487/RFC7515, May
           2015, <https://www.rfc-editor.org/info/rfc7515>.

[RFC7516]  Jones, M. and J. Hildebrand, "JSON Web Encryption (JWE)",
           RFC 7516, DOI 10.17487/RFC7516, May 2015,
           <https://www.rfc-editor.org/info/rfc7516>.

[RFC7519]  Jones, M., Bradley, J., and N. Sakimura, "JSON Web Token
           (JWT)", RFC 7519, DOI 10.17487/RFC7519, May 2015,
           <https://www.rfc-editor.org/info/rfc7519>.

[RFC7525]  Sheffer, Y., Holz, R., and P. Saint-Andre,
           "Recommendations for Secure Use of Transport Layer
           Security (TLS) and Datagram Transport Layer Security
           (DTLS)", BCP 195, RFC 7525, DOI 10.17487/RFC7525, May
           2015, <https://www.rfc-editor.org/info/rfc7525>.

[RFC8174]  Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC
           2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174,
           May 2017, <https://www.rfc-editor.org/info/rfc8174>.

8.2. Informative References 🌸

[JWT-BCP]  Sheffer, Y., Hardt, D., and M. Jones, "JSON Web Token Best
           Current Practices", Work in Progress,
           draft-ietf-oauth-jwt-bcp-03, May 2018.

[OpenID.BackChannel]
           Jones, M. and J. Bradley, "OpenID Connect Back-Channel
           Logout 1.0", January 2017, <http://openid.net/specs/
           openid-connect-backchannel-1_0.html>.

[OpenID.Core]
           Sakimura, N., Bradley, J., Jones, M., de Medeiros, B., and
           C. Mortimore, "OpenID Connect Core 1.0", November 2014,
           <http://openid.net/specs/openid-connect-core-1_0.html>.

[OpenID.RISC.Events]
           Scurtescu, M., Backman, A., Hunt, P., and J. Bradley,
           "OpenID RISC Event Types 1.0", April 2018,
           <http://openid.net/specs/
           openid-risc-event-types-1_0.html>.

[RFC2046]  Freed, N. and N. Borenstein, "Multipurpose Internet Mail
           Extensions (MIME) Part Two: Media Types", RFC 2046,
           DOI 10.17487/RFC2046, November 1996,
           <https://www.rfc-editor.org/info/rfc2046>.

[RFC6838]  Freed, N., Klensin, J., and T. Hansen, "Media Type
           Specifications and Registration Procedures", BCP 13,
           RFC 6838, DOI 10.17487/RFC6838, January 2013,
           <https://www.rfc-editor.org/info/rfc6838>.

[RFC7644]  Hunt, P., Ed., Grizzle, K., Ansari, M., Wahlstroem, E.,
           and C. Mortimore, "System for Cross-domain Identity
           Management: Protocol", RFC 7644, DOI 10.17487/RFC7644,
           September 2015, <https://www.rfc-editor.org/info/rfc7644>.

[RFC8055]  Holmberg, C. and Y. Jiang, "Session Initiation Protocol
           (SIP) Via Header Field Parameter to Indicate Received
           Realm", RFC 8055, DOI 10.17487/RFC8055, January 2017,
           <https://www.rfc-editor.org/info/rfc8055>.

[RFC8225]  Wendt, C. and J. Peterson, "PASSporT: Personal Assertion
           Token", RFC 8225, DOI 10.17487/RFC8225, February 2018,
           <https://www.rfc-editor.org/info/rfc8225>.

Acknowledgments 🫢

The editors would like to thank the members of the IETF SCIM working group, which began discussions of provisioning events starting with draft-hunt-scim-notify-00 in 2015. The editors would like to thank the participants in the IETF id-event mailing list, the Security Events working group, and related working groups for their contributions to this specification. The specification incorporates suggestions made by many people, including Annabelle Backman, John Bradley, Alissa Cooper, Ned Freed, Dick Hardt, Russ Housley, Benjamin Kaduk, Mirja Kuehlewind, Mark Lizar, Alexey Melnikov, Andrew Nash, Eric Rescorla, Adam Roach, Justin Richer, Nat Sakimura, Marius Scurtescu, Yaron Sheffer, and Martin Vigoureux. βœ¨πŸ™Œ

Authors' Addresses πŸ’–

Phil Hunt (editor)
Oracle Corporation

Email: phil.hunt@yahoo.com


Michael B. Jones
Microsoft

Email: mbj@microsoft.com
URI:   http://self-issued.info/


William Denniss
Google

Email: rfc8417@wdenniss.com
URI:   https://wdenniss.com/SET


Morteza Ansari
Cisco

Email: morteza.ansari@cisco.com
πŸ“¦ where this page comes from