Security Events Working Group | P. Hunt, Ed. |
Internet-Draft | Oracle |
Intended status: Standards Track | M. Jones |
Expires: September 1, 2018 | Microsoft |
W. Denniss | |
M. Ansari | |
Cisco | |
February 28, 2018 |
Security Event Token (SET)
draft-ietf-secevent-token-06
This specification defines the Security Event Token (SET) data structure. A SET describes a statement of fact from the perspective of an issuer about the state of a security subject, which is intended to be shared with one or more recipients. This statement of fact represents an event that occurred to the security subject. In some use cases, the security subject may be a digitial identity, but SETs are also applicable to non-identity use cases. A SET is a JSON Web Token (JWT), which can be optionally signed and/or encrypted. SETs can be distributed via protocols such as HTTP.
This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79.
Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet-Drafts is at https://datatracker.ietf.org/drafts/current/.
Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress."
This Internet-Draft will expire on September 1, 2018.
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) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License.
This specification defines an extensible Security Event Token (SET) data structure, which can be exchanged using protocols such as HTTP. The specification builds on the JSON Web Token (JWT) format [RFC7519] in order to provide a self-contained token that can be optionally signed using JSON Web Signature (JWS) [RFC7515] and/or encrypted using JSON Web Encryption (JWE) [RFC7516].
This specification profiles the use of JWT for the purpose of issuing Security Event Tokens (SETs). This specification defines a base format used by profiling specifications to define actual events and their meanings. This specification uses non-normative example events to demonstrate how events can be constructed.
This specification is scoped to security and identity related events. While Security Event Tokens may be used for other purposes, the specification only considers security and privacy concerns relevant to identity and personal information.
Security events are not commands issued between parties. A security event is a statement of fact from the perspective of an issuer about the state of a security subject (e.g., a web resource, token, IP address, the issuer itself) that the issuer controls or is aware of, that has changed in some way (explicitly or implicitly). A security subject may be permanent (e.g., a user account) or temporary (e.g., an HTTP session) in nature. A state change could describe a direct change of entity state, an implicit change of state, or other higher-level security statements such as:
While subject state changes are often triggered by a user agent or security subsystem, the issuance and transmission of an event may occur asynchronously and in a back channel to the action that caused the change that generated the security event. Subsequently, a SET recipient, having received a SET, validates and interprets the received SET and takes its own independent actions, if any. For example, having been informed of a personal identifier being associated with a different security subject (e.g., an email address is being used by someone else), the SET recipient may choose to ensure that the new user is not granted access to resources associated with the previous user. Or, the SET recipient may not have any relationship with the subject, and no action is taken.
While SET recipients will often take actions upon receiving SETs, security events cannot be assumed to be commands or requests. The intent of this specification is to define a syntax for statements of fact that SET recipients may interpret for their own purposes.
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.
For purposes of readability, examples are not URL encoded. Implementers MUST percent encode URLs as described in Section 2.1 of [RFC3986].
Throughout this document, all figures MAY contain spaces and extra line-wrapping for readability and space limitations. Similarly, some URIs contained within examples have been shortened for space and readability reasons.
The following definitions are used with SETs:
A SET is a JWT [RFC7519] data structure that represents one or more related aspects of a security event that occurred to a subject. The JWT Claims Set in a SET has the following structure:
The following is a non-normative example showing the JWT Claims Set for a hypothetical SCIM [RFC7644] password reset SET. This example uses a second events value (https://example.com/scim/event/passwordResetExt) to convey additional information about the state change -- in this case, the current count of reset attempts:
{ "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 consists of:
In this example, the SCIM event indicates that a password has been updated and the current password reset count is 5. Notice that the value for resetAttempts is in the event payload of an event used to convey this information.
Here is another example JWT Claims Set for a security event token, this one 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
Note that the above SET has an empty JSON object and uses the JWT registered claims sub and sid to identify the subject that was logged out.
In the following example JWT Claims Set, a fictional medical service collects consent for medical actions and notifies other parties. The individual for whom consent is identified was originally authenticated via OpenID Connect. In this case, the issuer of the security event is an application rather than the OpenID provider:
{ "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 above example, the attribute iss contained within the payload for the event https://openid.net/heart/specs/consent.html refers to the issuer of the security subject (sub) rather than the SET issuer https://my.med.example.org. They are distinct from the top-level value of iss, which always refers to the issuer of the event -- a medical consent service that is a relying party to the OpenID Provider.
The following example JWT Claims Set is for an account disabled event. This example was taken from a working draft of the RISC events specification, where RISC is the OpenID RISC (Risk and Incident Sharing and Coordination) working group [RISC]. The example is subject to change.
{ "iss": "https://idp.example.com/", "jti": "756E69717565206964656E746966696572", "iat": 1508184845, "aud": "636C69656E745F6964", "events": { "http://schemas.openid.net/secevent/risc/event-type/\ account-disabled": { "subject": { "subject_type": "iss-sub", "iss": "https://idp.example.com/", "sub": "7375626A656374" }, "reason": "hijacking", "cause-time": 1508012752 } } }
Figure 4: Example RISC Event
Notice that parameters to the event are included in the event payload, in this case, the reason and cause-time values. The subject of the event is identified using the subject payload value, which itself is a JSON object.
The following claims from [RFC7519] are profiled for use in SETs:
The following new claims are defined by this specification:
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 in which 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.
This section describes how to construct a SET.
The following is an example JWT Claims Set for a hypothetical SCIM SET (which has been formatted for readability):
{ "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 of the octets of the UTF-8 representation of the JOSE Header yields:
eyJ0eXAiOiJzZWNldmVudCtqd3QiLCJhbGciOiJub25lIn0
The above example JWT Claims Set is encoded as follows:
eyJqdGkiOiI0ZDM1NTllYzY3NTA0YWFiYTY1ZDQwYjAzNjNmYWFkOCIsImlhdCI6MTQ1 ODQ5NjQwNCwiaXNzIjoiaHR0cHM6Ly9zY2ltLmV4YW1wbGUuY29tIiwiYXVkIjpbImh0 dHBzOi8vc2NpbS5leGFtcGxlLmNvbS9GZWVkcy85OGQ1MjQ2MWZhNWJiYzg3OTU5M2I3 NzU0IiwiaHR0cHM6Ly9zY2ltLmV4YW1wbGUuY29tL0ZlZWRzLzVkNzYwNDUxNmIxZDA4 NjQxZDc2NzZlZTciXSwiZXZlbnRzIjp7InVybjppZXRmOnBhcmFtczpzY2ltOmV2ZW50 OmNyZWF0ZSI6eyJyZWYiOiJodHRwczovL3NjaW0uZXhhbXBsZS5jb20vVXNlcnMvNDRm NjE0MmRmOTZiZDZhYjYxZTc1MjFkOSIsImF0dHJpYnV0ZXMiOlsiaWQiLCJuYW1lIiwi dXNlck5hbWUiLCJwYXNzd29yZCIsImVtYWlscyJdfX19
The encoded JWS signature is the empty string. Concatenating the parts yields this complete SET:
eyJ0eXAiOiJzZWNldmVudCtqd3QiLCJhbGciOiJub25lIn0. eyJqdGkiOiI0ZDM1NTllYzY3NTA0YWFiYTY1ZDQwYjAzNjNmYWFkOCIsImlhdCI6MTQ1 ODQ5NjQwNCwiaXNzIjoiaHR0cHM6Ly9zY2ltLmV4YW1wbGUuY29tIiwiYXVkIjpbImh0 dHBzOi8vc2NpbS5leGFtcGxlLmNvbS9GZWVkcy85OGQ1MjQ2MWZhNWJiYzg3OTU5M2I3 NzU0IiwiaHR0cHM6Ly9zY2ltLmV4YW1wbGUuY29tL0ZlZWRzLzVkNzYwNDUxNmIxZDA4 NjQxZDc2NzZlZTciXSwiZXZlbnRzIjp7InVybjppZXRmOnBhcmFtczpzY2ltOmV2ZW50 OmNyZWF0ZSI6eyJyZWYiOiJodHRwczovL3NjaW0uZXhhbXBsZS5jb20vVXNlcnMvNDRm NjE0MmRmOTZiZDZhYjYxZTc1MjFkOSIsImF0dHJpYnV0ZXMiOlsiaWQiLCJuYW1lIiwi dXNlck5hbWUiLCJwYXNzd29yZCIsImVtYWlscyJdfX19.
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, 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].
Profiling specifications for SETs define the syntax and semantics of SETs conforming to that SET profile and rules for validating those SETs. The syntax defined by profiling specifications includes what claims and event payload values are used by SETs utilizing the profile.
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 used 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.
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.
Among the syntax and semantics of SETs that profiling specifications define is whether and how multiple members of the JSON object that is the value of the events claim are used for SETs conforming to those profiles. 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.
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.
SETs may contain sensitive information. Therefore, methods for distribution of events SHOULD require the use of a transport-layer security mechanism when distributing events. Parties MUST support TLS 1.2 [RFC5246] or a higher version and MAY support additional transport-layer mechanisms meeting its security requirements. When using TLS, the client MUST perform a TLS/SSL server certificate check, per [RFC6125]. Implementation security considerations for TLS can be found in "Recommendations for Secure Use of TLS and DTLS" [RFC7525].
Security events distributed through third parties or that carry personally identifiable information SHOULD be encrypted using JWE [RFC7516] or secured for confidentiality by other means.
Unless integrity of the JWT is ensured by other means, it MUST be signed using JWS [RFC7515] so that the SET can be authenticated and validated by the SET recipient.
This specification does not define a delivery mechanism for SETs. In addition to confidentiality and integrity (discussed above), implementers and profiling specifications MUST consider the consequences of delivery mechanisms that are not secure and/or not assured. For example, while a SET may be end-to-end secured using JWE encrypted SETs, without TLS, there is no assurance that the correct endpoint received the SET and that it could be successfully processed.
This specification defines no means of ordering multiple SETs in a sequence. Depending on the type and nature of the events represented by SETs, order may or may not matter. For example, in provisioning, event order is critical -- an object cannot be modified before it is created. In other SET types, such as a token revocation, the order of SETs for revoked tokens does not matter. If, however, 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. Thus, time by itself will not guarantee order.
Specifications profiling SET SHOULD define a mechanism for detecting order or sequence of events when the order matters. For example, the txn claim could contain an ordered value (e.g., a counter) that the issuer includes.
When SETs are delivered asynchronously and/or out-of-band with respect to the original action that incurred the security event, it is important to consider that a SET might be delivered to a SET recipient in advance of or behind the process that caused the event. For example, a user having been required to log out and then log back in again, may cause a logout SET to be issued that may arrive at the same time as the user agent accesses a web site having just logged in. If timing is not handled properly, the effect would be to erroneously treat the new user session as logged out. Profiling specifications SHOULD be careful to anticipate timing and subject selection information. For example, it might be more appropriate to cancel a "session" rather than a "user". Alternatively, the specification could use timestamps that allow new sessions to be started immediately after a stated logout event time.
Because [RFC7519] states that "all claims that are not understood by implementations MUST be ignored", there is a consideration that a SET might be confused with ID Token [OpenID.Core] if a SET is mistakenly or maliciously used in a context requiring an ID Token. If a SET could otherwise be interpreted as a valid ID Token (because it includes the required claims for an ID Token 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. Because exp is a required claim in ID Tokens, valid ID Token implementations will reject such a SET if presented as if it were an ID Token.
Excluding exp from SETs that could otherwise be confused with ID Tokens is actually defense in depth. In any OpenID Connect contexts in which an attacker could attempt to substitute a SET for an ID Token, the SET would actually already be rejected as an ID Token because it would not contain the correct nonce claim value for the ID Token to be accepted in contexts for which substitution is possible.
Note that the use of explicit typing, as described in Section 2.3, will not achieve disambiguation between ID Tokens and SETs, as the ID Token validation rules do not use the typ header parameter value.
OAuth 2.0 [RFC6749] defines access tokens as being opaque. Nonetheless, some implementations implement access tokens as JWTs. Because the structure of these JWTs is implementation-specific, ensuring that a SET cannot be confused with such an access token is therefore likewise, in general, implementation specific. Nonetheless, it is recommended that SET profiles employ the following strategies to prevent possible substitutions of SETs for access tokens in contexts in which that might be possible:
JWTs are now being used in application areas beyond the identity applications in which they first appeared. For instance, the Session Initiation Protocol (SIP) Via Header Field [RFC8055] and Personal Assertion Token (PASSporT) [I-D.ietf-stir-passport] specifications both define JWT profiles that use mostly or completely different sets of claims than are used by ID Tokens. If it would otherwise be possible for an attacker to substitute a SET for one of these (or other) kinds of JWTs, then the SET profile must be defined in such a way that any substituted SET will result in its rejection when validated as the intended kind of JWT.
The most direct way to prevent confusion is to employ explicit typing, as described in Section 2.3, and modify applicable token validation systems to use the typ header parameter value. This approach can be employed for new systems but may not be applicable to existing systems.
Another way to ensure that a SET is not confused with another kind of JWT is to have the JWT validation logic reject JWTs containing an events claim unless the JWT is intended to be a SET. This approach can be employed for new systems but may not be applicable to existing systems.
For many use cases, the simplest way to prevent substitution is requiring that the SET not include claims that are required for the kind of JWT that might be the target of an attack. For example, for [RFC8055], the sip_callid claim could be omitted and for [I-D.ietf-stir-passport], the orig claim could be omitted.
In many contexts, simple measures such as these will accomplish the task, should confusion otherwise even be possible. Note that this topic is being explored in a more general fashion in JSON Web Token Best Current Practices [I-D.ietf-oauth-jwt-bcp]. The proposed best practices in that draft may also be applicable for particular SET profiles and use cases.
If a SET needs to be retained for audit purposes, the signature can be used to provide verification of its authenticity.
SET issuers SHOULD attempt to specialize SETs so that their content is targeted to the specific business and protocol needs of the intended SET recipients.
When sharing personally identifiable information or information that is otherwise considered confidential to affected users, SET issuers and recipients MUST have the appropriate legal agreements and user consent and/or terms of service in place.
The propagation of subject identifiers can be perceived as personally identifiable information. Where possible, SET issuers and recipients SHOULD devise approaches that prevent propagation -- for example, the passing of a hash value that requires the SET recipient to know the subject.
In some cases, it may be possible for a SET recipient to correlate different events and thereby gain information about a subject that the SET issuer did not intend to share. For example, a SET recipient might be able to use iat values or highly precise toe values to determine that two otherwise un-relatable events actually relate to the same real-world event. The union of information from both events could allow a SET recipient to de-anonymize data or recognize that unrelated identifiers relate to the same individual. SET issuers SHOULD take steps to minimize the chance of event correlation, when such correlation would constitute a privacy violation. For instance, they could use approximate values for the toe claim or arbitrarily delay SET issuance, where such delay can be tolerated.
This specification registers the events, toe, and txn claims in the IANA "JSON Web Token Claims" registry [IANA.JWT.Claims] established by [RFC7519].
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.
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.
[[ to be removed by the RFC Editor before publication as an RFC ]]
From the original draft-hunt-idevent-token:
Draft 01 - PH - Renamed eventUris to events
Draft 00 - PH - First Draft
Draft 01 - PH - Fixed some alignment issues with JWT. Remove event type attribute.
Draft 02 - PH - Renamed to Security Events, removed questions, clarified examples and intro text, and added security and privacy section.
Draft 03 - PH events claim, and proof-reading corrections.
- mbj - Registered
Draft 04 - PH -
Draft 05 - PH - Fixed find/replace error that resulted in claim being spelled claimc
Draft 06 - PH -
Draft 07 -
Draft 08 - PH -
From draft-ietf-secevent-token:
Draft 00 - PH - First WG Draft based on draft-hunt-idevent-token
Draft 01 - PH - Changes as follows:
Draft 02 - Changes are as follows:
Draft 03 - Changes are as follows:
Draft 04 - mbj - Changes were as follows:
Draft 05 - mbj - Changes were as follows:
Draft 06 - mbj - Changes were as follows: