Security Events Working Group | P. Hunt, Ed. |
Internet-Draft | Oracle |
Intended status: Standards Track | W. Denniss |
Expires: July 13, 2017 | |
M. Ansari | |
Cisco | |
M. Jones | |
Microsoft | |
January 9, 2017 |
Security Event Token (SET)
draft-hunt-idevent-token-08
This specification defines the Security Event Token, which may be distributed via a protocol such as HTTP. The Security Event Token (SET) specification profiles the JSON Web Token (JWT) and may be optionally signed and/or encrypted. A SET describes a statement of fact that may be shared by an event publisher with event subscribers.
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 http://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 July 13, 2017.
Copyright (c) 2017 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 (http://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) format which may 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].
For the purpose of this specification, an event is a statement of fact by a publisher (also known as the event issuer) that the state of a security subject (e.g., a web resource, token, IP address) it controls or is aware of, 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 may include direct changes of entity state, implicit changes to state or other higher-level security statements such as:
Based on some externally agreed criteria for an event feed, the publisher distributes events to the appropriate subscribers of a feed. While an event may be delivered via synchronous means (e.g., HTTP POST), the distribution of the event often happens asynchronously to the change of state which generated the security event. As an example, an OAuth2 Authorization Server [RFC6749], having received a token revocation request [RFC7009], may issue a token revocation event to downstream web resource providers. Having been informed of a token revocation, the OAuth2 web resource service provider may add the token identifier to its local revocation list assuming the token has not already expired.
A subscriber having received an event, validates and interprets the event and takes its own independent action, if any. For example, having been informed of a personal identifier now being associated with a different security subject (i.e., is being used by someone else), the subscriber may choose to ensure that the new user is not granted access to resources associated with the previous user. Or it may not have any relationship with the subject, and no action is taken.
While subscribers will often take actions upon receiving one or more events, events MUST NOT be assumed to be commands or requests. To do so requires complex bi-directional signals and error recovery mechanisms that fall outside the scope of this specification. The intent of this specification is to define a way of exchanging statements of fact that subscribers may interpret for their own purposes. Since events are typically historical statements by a publisher and are not commands, idempotency or lack thereof, does not apply.
Unless otherwise specified, this specification uses example events intended to serve as non-normative examples showing how an event may be constructed. It is expected that other "profiling" specifications will use this specification to define normative events within some specified context or protocol.
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.
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in [RFC2119]. These keywords are capitalized when used to unambiguously specify requirements of the protocol or application features and behavior that affect the inter-operability and security of implementations. When these words are not capitalized, they are meant in their natural-language sense.
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 conveys a statement (in the form of a JWT [RFC7519]) about a single security event in relation to a Security Subject that may be of interest to a Subscriber or set of Subscribers receiving SETs from a Feed Publisher.
The schema and structure of a SET follows the JWT [RFC7519] specification. A SET has the following structure:
The following is a non-normative example showing the JWT Claims Set for a hypothetical SCIM password reset SET. This example shows an extension (https://example.com/scim/event/passwordResetExt) that is used to convey additional information -- in this case, the current count of reset attempts:
{ "jti": "3d0c3cf797584bd193bd0fb1bd4e7d30", "iat": 1458496025, "iss": "https://scim.example.com", "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 event in the figure above expresses hypothetical password reset event for SCIM [RFC7644]. The JWT 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 actually part of its own JSON object associated with its own event URI attribute.
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
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:
{ "jti": "fb4e75b5411e4e19b6c0fe87950f7749", "sub": "248289761001", "iat": 1458496025, "iss": "https://my.examplemed.com", "aud": [ "https://rp.example.com" ], "events": { "https://openid.net/heart/specs/consent.html":{ "iss":"https://connect.example.com", "consentUri":[ "https://terms.examplemed.com/labdisclosure.html#Agree" ] } } }
Figure 3: Example Consent Event
The following are claims that are based on [RFC7519] claim definitions and are profiled for use in an event token:
The following are new claims defined by this specification:
A SET is a JWT [RFC7519] that is constructed by building a JSON structure that constitutes an event object and which is then used as the body of a JWT.
While this specification uses JWT to convey a SET, implementers SHALL NOT use SETs to convey authentication or authorization assertions.
The following is an example JWT Claims Set for a security event token (which has been formatted for readability):
{ "jti": "4d3559ec67504aaba65d40b0363faad8", "iat": 1458496404, "iss": "https://scim.example.com", "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 4: Example Event Claims
When transmitted, the above JSON body must be converted into a JWT as per [RFC7519].
The following is an example of a SCIM Event expressed as an unsecured JWT. The JWT header of:
{"alg":"none"}
Base64url encoding of the octets of the UTF-8 representation of the header yields:
eyJhbGciOiJub25lIn0
The example JSON Event Data is encoded as follows:
e3sgIAogICJqdGkiOiAiNGQzNTU5ZWM2NzUwNGFhYmE2NWQ0MGIwMzYzZmFhZDgiLAog ICJpYXQiOiAxNDU4NDk2NDA0LAogICJpc3MiOiAiaHR0cHM6Ly9zY2ltLmV4YW1wbGUu Y29tIiwgIAogICJhdWQiOiBbCiAgICJodHRwczovL3NjaW0uZXhhbXBsZS5jb20vRmVl ZHMvOThkNTI0NjFmYTViYmM4Nzk1OTNiNzc1NCIsCiAgICJodHRwczovL3NjaW0uZXhh bXBsZS5jb20vRmVlZHMvNWQ3NjA0NTE2YjFkMDg2NDFkNzY3NmVlNyIKICBdLCAgCiAg CiAgImV2ZW50cyI6IHsKICAgICJ1cm46aWV0ZjpwYXJhbXM6c2NpbTpldmVudDpjcmVh dGUiOiB7CiAgICAgICJyZWYiOgogICAgICAgICJodHRwczovL3NjaW0uZXhhbXBsZS5j b20vVXNlcnMvNDRmNjE0MmRmOTZiZDZhYjYxZTc1MjFkOSIsCiAgICAgICJhdHRyaWJ1 dGVzIjpbImlkIiwgIm5hbWUiLCAidXNlck5hbWUiLCAicGFzc3dvcmQiLCAiZW1haWxz Il0KICAgIH0KICB9Cn0
The encoded JWS signature is the empty string. Concatenating the parts yields:
eyJhbGciOiJub25lIn0 . e3sgIAogICJqdGkiOiAiNGQzNTU5ZWM2NzUwNGFhYmE2NWQ0MGIwMzYzZmFhZDgiLAog ICJpYXQiOiAxNDU4NDk2NDA0LAogICJpc3MiOiAiaHR0cHM6Ly9zY2ltLmV4YW1wbGUu Y29tIiwgIAogICJhdWQiOiBbCiAgICJodHRwczovL3NjaW0uZXhhbXBsZS5jb20vRmVl ZHMvOThkNTI0NjFmYTViYmM4Nzk1OTNiNzc1NCIsCiAgICJodHRwczovL3NjaW0uZXhh bXBsZS5jb20vRmVlZHMvNWQ3NjA0NTE2YjFkMDg2NDFkNzY3NmVlNyIKICBdLCAgCiAg CiAgImV2ZW50cyI6IHsKICAgICJ1cm46aWV0ZjpwYXJhbXM6c2NpbTpldmVudDpjcmVh dGUiOiB7CiAgICAgICJyZWYiOgogICAgICAgICJodHRwczovL3NjaW0uZXhhbXBsZS5j b20vVXNlcnMvNDRmNjE0MmRmOTZiZDZhYjYxZTc1MjFkOSIsCiAgICAgICJhdHRyaWJ1 dGVzIjpbImlkIiwgIm5hbWUiLCAidXNlck5hbWUiLCAicGFzc3dvcmQiLCAiZW1haWxz Il0KICAgIH0KICB9Cn0 .
Figure 5: Example Unsecured Security Event Token
For the purpose of a simpler example in Figure 5 an unencrypted token was shown. When SETs are not signed or encrypted, the subscriber MUST depend upon TLS and HTTP to authenticate the sender and the security of the channel to authenticate the SET and its sender.
When validation (i.e. auditing), or additional transmission security is required, JWS Signing and JWS Encryption MAY be used. To create and or validate a signed or encrypted SET, follow the instructions in section 7 of [RFC7519].
SETs may often 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] 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.
Security Events distributed without authentication over the channel, such as via TLS ([RFC5246] and [RFC6125]), and/or OAuth2 [RFC6749], or Basic Authentication [RFC7617], MUST be signed using JWS [RFC7515] so that individual events MAY be authenticated and validated by the subscriber.
This specification does not define a delivery mechanism by itself. In addition to confidentiality and integrity (discussed above), implementers and profile 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.
As defined in this specification, there is no defined way to order multiple SETs in a sequence. Depending on the type and nature of SET event, order may or may not matter. For example, in provisioning, event order is critical -- an object could not be modified before it was created. In other SET types, such as a token revocation, the order of SETs for revoked tokens does not matter. If however, the event was described as a log-in or logged-out status for a user subject, then order becomes important.
Extension specifications and implementers SHOULD take caution when using timestamps such as iat to define order. Distributed systems will have some amount of clock-skew and thus time by itself will not guarantee order.
Specifications profiling SET SHOULD define a mechanism for detecting order or sequence of events. For example, the txn claim could contain an ordered value (e.g., a counter) that the publisher defines.
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 Subscriber in advance or well behind the process that caused the event. For example, a user having been required to logout 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 allows 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 token might be confused as an access or authorization token in the case where a SET is mistakenly or intentionally intercepted and presented as an access token. To avoid this, it is recommended that implementers consider one or more of the following:
If a SET needs to be retained for audit purposes, JWS MAY be used to provide verification of its authenticity.
Event Publishers SHOULD attempt to specialize feeds so that the content is targeted to the specific business and protocol needs of subscribers.
When sharing personally identifiable information or information that is otherwise considered confidential to affected users, the publishers and subscribers MUST have the appropriate legal agreements and user consent in place.
The propagation of subject identifiers can be perceived as personally identifiable information. Where possible, publishers and subscribers should devise approaches that prevent propagation -- for example, the passing of a hash value that requires the subscriber to already know the subject.
This specification registers the events and txn claims in the IANA "JSON Web Token Claims" registry [IANA.JWT.Claims] established by [RFC7519].
[RFC7009] | Lodderstedt, T., Dronia, S. and M. Scurtescu, "OAuth 2.0 Token Revocation", RFC 7009, DOI 10.17487/RFC7009, August 2013. |
[RFC7515] | Jones, M., Bradley, J. and N. Sakimura, "JSON Web Signature (JWS)", RFC 7515, DOI 10.17487/RFC7515, May 2015. |
[RFC7516] | Jones, M. and J. Hildebrand, "JSON Web Encryption (JWE)", RFC 7516, DOI 10.17487/RFC7516, May 2015. |
[RFC7517] | Jones, M., "JSON Web Key (JWK)", RFC 7517, DOI 10.17487/RFC7517, May 2015. |
[RFC7644] | Hunt, P., Grizzle, K., Ansari, M., Wahlstroem, E. and C. Mortimore, "System for Cross-domain Identity Management: Protocol", RFC 7644, DOI 10.17487/RFC7644, September 2015. |
The editors would like to thank the participants in the IETF id-event mailing list and related working groups for their support of this specification.
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 -