SET Token Delivery Using HTTPOracle Corporationphil.hunt@yahoo.comGooglemscurtescu@google.comCiscomorteza.ansari@cisco.comMicrosofttonynad@microsoft.comAmazonrichanna@amazon.comInternet-Draft
This specification defines how a series of security event tokens
(SETs) may be delivered to a previously registered receiver
using HTTP POST over TLS initiated as a push to the receiver, or
as a poll by the receiver. The specification also defines how delivery
can be assured subject to the SET Token Receiver's need for assurance.
This specification defines how a stream of SETs (see )
can be transmitted to a previously registered
Event Receiver using HTTP
over TLS. The specification defines a method to push SETs via
HTTP POST and another method to poll for SETs using HTTP POST.
This specification defines two methods of SET delivery in what
is known as Event Streams.This specification does not define the method by which Event
Streams are defined, provisioned, managed, monitored,
and configured and is out of scope of this specification.
[[This work is TBD by the SECEVENTS WG]]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
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
.
Throughout this documents all figures MAY contain spaces and
extra
line-wrapping for readability and space limitations. Similarly, some
URI's contained within examples, have been shortened for space and
readability reasons.
This specification assumes terminology defined in the Security
Event Token specification
.
The following definitions are defined for Security Event distribution:
A service provider that delivers SETs to other providers known
as Event Receivers. An Event Transmitter
is responsible for offering a service that allows the Event
Receiver to check the Event Stream configuration and status
known as the "Control Plane".
A service provider that registers to receive SETs from
an Event Transmitter and provides an endpoint to receive
SETs via HTTP POST.
Event Receivers
can check current Event Stream configuration and status by
accessing the Event Transmitters "Control Plane".
An Event Stream is a defined location, distribution method
and whereby an Event Transmitter and Event Receiver
exchange a pre-defined family of SETs. A Stream is assumed
to have configuration data such as HTTP endpoints, timeouts,
public key sets for signing and encryption, and
Event Families.
The security subject around which a security event has
occurred. For example, a security subject might per a user,
a person, an email address, a service provider entity, an
IP address, an OAuth Client, a mobile device, or any identifiable
thing referenced in security and authorization systems.
An Event is defined to be an
event as represented by a security event token (SET).
See .
A JSON numeric value representing the number of seconds from
1970-01-01T00:00:00Z UTC until the specified UTC date/time,
ignoring leap seconds. This is equivalent to the
IEEE Std 1003.1, 2013 Edition
definition "Seconds Since the Epoch", in which each day is
accounted for by exactly 86400 seconds, other than that
non-integer values can be represented. See
for details regarding date/times
in general and UTC in particular.An Event Stream represents the communication channel over which a
series of SETs are delivered to a configured Event Receiver. When an Event occurs, the Event Transmitter constructs a SET
token that describes the
Event. The Event Transmitter determines the Event Streams over which the
SET should be distributed to.
How SETs are defined and the process by which Events are identified for
Event Receivers is out-of-scope of this specification.
When a SET is available for an Event Receiver, the Event Transmitter
attempts to deliver the SET based on the Event Receiver's registered
delivery mechanism:
The Event Transmitter uses an HTTP/1.1 POST to the Event
Receiver endpoint to deliver the SET;
The Event Transmitter queues up the SET in a buffer so that
an Event Receiver MAY poll for SETs using HTTP/1.1 POST.Or, the Event Transmitter delivers the Event through a different
method not defined by this specification.
Delivery of SETs MAY be delivered using one of two modes:
In which SETs are delivered
one at a time using HTTP POST requests by an Event Transmitter
to an Event Receiver. The HTTP request body is a JSON Web Token
with a Content-Type
header of application/secevent+jwt
as defined in Section 2.2 and 6.2 of
. Upon receipt, the
Event Receiver acknowledges receipt with a response with HTTP
Status 202, as described below in .Where
multiple SETs are delivered in a JSON document
to an Event Receiver in response to an HTTP POST request to the
Event Transmitter. Then in a following request, the Event Receiver
acknowledges received SETs and MAY poll for more. In POLLING mode,
all requests and responses are JSON documents and use a
Content-Type of
application/json as described in
.After successful (acknowledged) SET delivery, Event
Transmitters SHOULD NOT be required to maintain or record SETs for
recovery. Once a SET is acknowledged, the Event Receiver SHALL be
responsible for retention and recovery.Transmitted SETs SHOULD be self-validating (e.g. signed)
if there is a requirement to verify they were issued by the Event
Transmitter at a later date when de-coupled from the original
delivery where authenticity could be checked via the HTTP or
TLS mutual authentication.
Upon receiving a SET, the Event Receiver reads the SET and validates
it. The Event Receiver MUST acknowledge receipt to the Event Transmitter, using the
defined acknowledgement or error method depending on the method of
transfer.The Event Receiver SHALL NOT use the Event acknowledgement mechanism
to report Event errors other than relating to the parsing and validation
of the SET.This method allows an Event Transmitter to use HTTP POST
(Section 4.3.3) to deliver
SETs to a previously registered web callback URI supplied by the
Event Receiver as part of an Event Stream configuration process
(not defined by this document).The SET to be delivered MAY be signed
and/or encrypted as defined in .The Event Stream configuration defines a URI of an Event
Receiver provided endpoint which accepts HTTP POST requests (e.g.
https://rp.example.com/Events).The HTTP Content-Type (see
Section 3.1.1.5) for the HTTP POST is
application/secevent+jwt and SHALL consist of
a single SET (see ).
As per Section 5.3.2, the expected
media type (Accept header) response is
application/json.Upon receipt of the request, the Event Receiver SHALL
validate the JWT structure of the SET as defined in
Section 7.2. The Event Receiver
SHALL also validate the SET information as described
in Section 2.If the SET is determined to be valid, the Event Receiver SHALL
"acknowledge" successful submission by responding with HTTP Status
202 as Accepted
(see Section 6.3.3).In order
to maintain compatibility with other methods of transmission, the
Event Receiver SHOULD NOT include an HTTP response body representation
of the submitted SET or what the SET's pending status is when
acknowledging success. In the case of an error (e.g. HTTP Status 400),
the purpose of the HTTP response body is to indicate any SET parsing,
validation, or cryptographic errors.Note that the purpose of the "acknowledgement" response is to let the
Event Transmitter know that a SET has been delivered and the
information no longer needs to be retained by the Event Transmitter.
Before acknowledgement, Event Receivers SHOULD ensure they have
validated received SETs and retained them in a manner appropriate
to information retention requirements appropriate to the SET
event types signaled. The level and method of retention of SETs
by Event Receivers is out-of-scope of this specification.In the Event of a general HTTP error condition, the Event Receiver
MAY respond with an appropriate HTTP Status code as defined in
Section 6.When the Event Receiver detects an error parsing or
validating a received SET (as defined by ),
the Event Receiver SHALL indicate an HTTP Status 400 error with an
error code as described in .
This method allows an Event Receiver to use HTTP POST
(Section 4.3.3) to acknowledge
SETs and to check for and receive zero or more SETs. Requests
MAY be made at a periodic interval (short polling) or requests
MAY wait pending availability of new SETs using long polling
(see Section 2).The delivery of SETs in this method is facilitated by HTTP
POST requests initiated by the Event Receiver in which:The Event Receiver makes a request for available SETs
using an HTTP POST to a pre-arranged endpoint provided by the Event
Transmitter. Or,After validating previously received SETs, the Event Receiver
initiates another poll request using HTTP POST that includes
acknowledgement of previous SETs, and waits for the next batch
of SETs.The purpose of the "acknowledgement" is to inform the
Event Transmitter that has successfully been delivered and attempts
to re-deliver are no longer required. Before acknowledgement, Event
Receivers SHOULD ensure received SETs have been validated and
retained in a manner appropriate to the receiver's
retention requirements. The level and method of retention of SETs
by Event Receivers is out-of-scope of this specification.When initiating a poll request, the Event Receiver constructs
a JSON document that consists of polling request parameters
and SET acknowledgement parameters in the form of JSON attributes.The request payloads are delivered in one of two forms as described
in and When making a request, the HTTP header Content-Type
is set to application/json.The following JSON Attributes are used in a polling request:
an OPTIONAL JSON integer value
indicating the maximum number of unacknowledged SETs that
SHOULD be returned. If more than the maximum number of SETs
are available, the oldest SETs available SHOULD be returned
first. A value of 0 MAY be used by
Event Receivers that would like to perform an acknowledge only
request. This enables the Receiver to use separate HTTP requests
for acknowledgement and reception of SETs. When zero returned
events is requested, the value of the attribute
returnImmediately SHALL be ignored
as an immediate response is expected.
An OPTIONAL JSON
boolean value that indicates the Event Transmitter SHOULD return
an immediate response even if no results are available
(short polling). The default value is false
indicates the request is to be treated as an HTTP Long Poll (see
Section 2). The time out for the
request is part of the Stream configuration which is out of
scope of this specification.Which is an array of Strings that each
correspond to the jti of a
successfully received SET. If there are no
outstanding SETs to acknowledge, the attribute MAY be omitted.
When acknowledging a SET, the Event Transmitter is released from
any obligation to retain the SET (e.g. for a future re-try to
receive).A JSON Object that contains
one or more nested JSON attributes that correspond to the
jti of each invalid SET received.
The value of each is a JSON object whose contents is an
err attribute and
description attribute whose value
correspond to the errors described in .In response to a poll request, the Event Transmitter checks for
available SET events and responds with a JSON document containing
the following JSON attributes:
A JSON object that contains zero
or more nested JSON attributes. Each nested attribute
corresponds to the jti of a SET to
be delivered and whose value is a JSON String containing the
value of the encoded corresponding SET. If there are no
outstanding SETs to be transmitted, the JSON object SHALL be
empty.A JSON boolean value that
indicates if more unacknowledged SETs are available to be returned.
When making a response, the HTTP header Content-Type
is set to application/json.The Event Receiver performs an HTTP POST (see
Section 4.3.4) to a pre-arranged
polling endpoint URI to check for SETs that are available.
Because the Event Receiver has no prior SETs to
acknowledge, the ack and
errs request parameters are omitted.If after a period of time, negotiated between the Event
Transmitter and Receiver, an Event Transmitter MAY re-issue SETs
it has previously delivered. The Event Receiver SHOULD accept
repeat SETs and acknowledge the SETs regardless of whether the
Receiver believes it has already acknowledged the SETs previously.
An Event Transmitter MAY limit the number of times it attempts to
deliver a SET. Upon abandoning delivery of a SET, the Event Transmitter
SHOULD have a method to notify the Event Receiver of the loss
such as through a status service (not defined by this specification).
If the Event Receiver has received SETs from the
Event Transmitter, the Event Receiver SHOULD parse and validate
received SETs to meet its own requirements and SHOULD acknowledge
receipt in a timely (e.g. minutes) fashion so that the Event
Transmitter may mark the SETs as received. Event Receivers SHOULD
acknowledge receipt before taking any local actions based on
the SETs to avoid unnecessary delay in acknowledgement where
possible.Poll requests have three variations:
In which an Event Receiver
asks for the next set of Events where no previous SET deliveries
are acknowledged (such as in the initial poll request).In which an Event
Receiver sets the maxEvents
attribute to 0 along with
ack and
err attributes indicating the
Event Receiver is acknowledging previously received SETs and
does not want to receive any new SETs in response to the
request. In
which an Event Receiver is both acknowledging previously
received SETs using the ack and
err attributes
and will wait for the next group of SETs in the Event Transmitters
response.In the case where no SETs were received in a previous poll (see
), the Event Receiver simply
polls without acknowledgement parameters (sets
and setErrs).The following is an example request made by an Event Receiver
that has no outstanding SETs to acknowledge and is polling
for available SETs.An Event Receiver MAY poll with no parameters at all by passing
an empty JSON object.In this variation, the Event Receiver acknowledges previously
received SETs and indicates it does not want to receive SETs in
response by setting the maxEvents
attribute to 0.This variation is typically used when an Event Receiver needs to
acknowledge received SETs independently (e.g. on separate threads)
from the process of receiving SETs.This variation allows a receiver thread to simultaneously
acknowledge previously received SETs and wait for the next
group of SETs in a single request.In the above acknowledgement, the Event Receiver has acknowledged
receipt of two SETs and has indicated it wants to wait until
the next SET is available.In the case where errors were detected in previously
delivered SETs, the Event Receiver MAY use the
setErrs attribute to indicate errors
in the following poll request.
In response to a poll request, the service provider MAY
respond immediately if SETs are available to be delivered.
If no SETs are available at the time of the request, the
Event Transmitter SHALL delay responding until a SET is
available unless the poll request parameter
returnImmediately is true.As described in a JSON document
is returned containing a number of attributes including
sets which SHALL contain zero or more
SETs.In the above example, a two SETs whose jti
are 4d3559ec67504aaba65d40b0363faad8
and 3d0c3cf797584bd193bd0fb1bd4e7d30
are delivered.Upon receiving the JSON document (e.g. as shown in
), the Event Receiver parses
and verifies the received SETs and notifies the Event Transmitter
via the next poll request to the Event Transmitter as described in
or .If a SET is invalid, the following error codes are defined:Err ValueDescriptionjsonInvalid JSON object.jwtParseInvalid or unparsable JWT or JSON structure.jwtHdrIn invalid JWT header was detected.jwtCryptoUnable to parse due to unsupported algorithm.jwsSignature was not validated.jweUnable to decrypt JWE encoded data.jwtAudInvalid audience value.jwtIssIssuer not recognized.setTypeAn unexpected Event type was received.setParseInvalid structure was encountered such as an
inability to parse or an incomplete set of Event claims.setDataSET event claims incomplete or invalid.dupA duplicate SET was received and has been ignored.An error response SHALL include a JSON
object which provides details about the error. The JSON object
includes the JSON attributes: A value which is a keyword that
describes the error (see ).A human-readable text that provides
additional diagnostic information.
When included as part of an HTTP Status 400 response, the above
JSON is the HTTP response body (see ).
When included as part of a batch of SETs, the above JSON is included
as part of the setErrs attribute as
defined in and The SET delivery methods described in this specification are
based upon HTTP and depend on the use of TLS and/or standard
HTTP authentication and authorization schemes as per
. For example, the following
methodologies could be used among others: Event delivery
endpoints MAY request TLS mutual client authentication.
See Section 7.3. Bearer tokens
MAY be used when combined with TLS and a token
framework such as OAuth 2.0 .
For security considerations regarding the use of bearer tokens in
SET delivery see .Usage of basic
authentication should be avoided due to its use of a single factor
that is based upon a relatively static, symmetric secret.
Implementers SHOULD combine the use of basic authentication with
other factors. The security considerations of HTTP BASIC, are well
documented in and SHOULD be considered
along with using signed SETs (see SET Payload Authentication below).In scenarios
where SETs are signed and
the delivery method is HTTP POST (see ),
Event Receivers MAY elect to use Basic Authentication or not
to use HTTP or TLS based authentication at all. See
for considerations.As per Section 4.1 of, a SET
delivery endpoint SHALL indicate supported HTTP authentication
schemes via the WWW-Authenticate header.Because SET Delivery describes a simple function, authorization
for the ability to pick-up or deliver SETs can be derived by
considering the identity of the SET issuer, or via an authentication
method above. This specification considers authentication as a
feature to prevent denial-of-service attacks. Because SETs are
not commands (see ), Event Receivers are free to ignore SETs that
are not of interest.For illustrative purposes only, SET delivery examples show an OAuth2
bearer token value in the authorization header.
This is not intended to imply that bearer tokens are
preferred. However, the use of bearer tokens in the specification does
reflect common practice. When using bearer tokens or proof-of-possession tokens that
represent an authorization grant such as issued by OAuth (see ), implementers SHOULD consider the type of
authorization granted, any authorized scopes (see Section 3.3 of ), and the security subject(s) that SHOULD be mapped
from the authorization when considering local access control rules.
Section 6 of the OAuth Assertions draft , documents common scenarios for
authorization including:Clients using an assertion to authenticate and/or act on behalf
of itself;Clients acting on behalf of a user; and,A Client acting on behalf of an anonymous user (e.g., see next
section).When using OAuth authorization tokens, implementers MUST take
into account the threats and countermeasures documented in the
security considerations for the use of client authorizations (see
Section 8 of ). When using
other token formats or frameworks, implementers MUST take into account
similar threats and countermeasures, especially those documented by
the relevant specifications.In scenarios where HTTP authorization or TLS mutual authentication
are not used or are considered weak, JWS signed SETs SHOULD be
used (see and
Security Considerations). This enables the Event Receiver
to validate that the SET issuer is authorized to deliver SETs.
SET delivery depends on the use of Hypertext Transfer Protocol and thus
subject to the security considerations of HTTP Section 9 and its related specifications.As stated in Section 2.7.1, an
HTTP requestor MUST NOT generate the userinfo
(i.e., username and password) component (and its "@" delimiter) when
an "http" URI reference is generated with a message as they are now
disallowed in HTTP.SETs contain sensitive information that is considered PII
(e.g. subject claims). Therefore, Event Transmitters and
Event Receivers MUST require the use of a transport-layer
security mechanism. Event delivery endpoints MUST support TLS
1.2 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 . Implementation
security considerations for TLS can be found in "Recommendations for
Secure Use of TLS and DTLS" .When using authorization tokens such as those issued by OAuth 2.0
, implementers MUST take into account threats
and countermeasures documented in Section 8 of .Due to the possibility of interception, Bearer tokens MUST be
exchanged using TLS.Bearer tokens MUST have a limited lifetime that can be determined
directly or indirectly (e.g., by checking with a validation service)
by the service provider. By expiring tokens, clients are forced to
obtain a new token (which usually involves re-authentication) for
continued authorized access. For example, in OAuth2, a client MAY use
OAuth token refresh to obtain a new bearer token after authenticating
to an authorization server. See Section 6 of .Implementations supporting OAuth bearer tokens need to factor in
security considerations of this authorization method . Since security is only as good
as the weakest link, implementers also need to consider authentication
choices coupled with OAuth bearer tokens. The security considerations
of the default authentication method for OAuth bearer tokens, HTTP
BASIC, are well documented in , therefore implementers
are encouraged to prefer stronger authentication methods. Designating
the specific methods of authentication and authorization are
out-of-scope for the delivery of SET tokens, however this
information is provided as a resource to implementers.If a SET needs to be retained for audit purposes, JWS MAY
be used to provide verification of its authenticity.Event Transmitters SHOULD attempt to specialize Event Streams
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, Event
Transmitters and Receivers MUST have the appropriate legal agreements
and user consent or terms of service in place.The propagation of subject identifiers can be perceived as personally
identifiable information. Where possible, Event Transmitters and Receivers
SHOULD devise approaches that prevent propagation -- for example, the
passing of a hash value that requires the subscriber to already know
the subject.There are no IANA considerations.The Open Group Base Specifications Issue 7Institute of Electrical and Electronics EngineersOpenID Connect Core 1.0NRIAssertions and Protocols for the OASIS Security Assertion Markup Language (SAML) V2.0Internet2[[EDITORS NOTE: This section to be removed prior to publication]]The following pub/sub, queuing, streaming systems were reviewed
as possible solutions or as input to the current draft:XMPP EventsThe WG considered the XMPP events ands its ability to provide a single
messaging solution without the need for both polling and push modes.
The feeling was the size and methodology of XMPP was to far apart from
the current capabilities of the SECEVENTs community which focuses in
on HTTP based service delivery and authorization.Amazon Simple Notification ServiceSimple Notification Service, is a pub/sub messaging product from
AWS. SNS supports a variety of subscriber types: HTTP/HTTPS endpoints,
AWS Lambda functions, email addresses (as JSON or plain text), phone
numbers (via SMS), and AWS SQS standard queues. It doesn’t directly
support pull, but subscribers can get the pull model by creating an
SQS queue and subscribing it to the topic. Note that this puts the
cost of pull support back onto the subscriber, just as it is in the
push model. It is not clear that one way is strictly better than the
other; larger, sophisticated developers may be happy to own message
persistence so they can have their own internal delivery guarantees.
The long tail of OIDC clients may not care about that, or may fail
to get it right. Regardless, I think we can learn something from the
Delivery Policies supported by SNS, as well as the delivery controls
that SQS offers (e.g. Visibility Timeout, Dead-Letter Queues). I’m
not suggesting that we need all of these things in the spec, but
they give an idea of what features people have found useful.Other information:API Reference: http://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/Welcome.htmlVisibility Timeouts: http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-visibility-timeout.htmlApache KafkaApache Kafka is an Apache open source project based upon TCP for
distributed streaming. It prescribes some interesting general
purpose features that seem to extend far beyond the simpler
streaming model SECEVENTs is after. A comment from MS has been that
Kafka does an acknowledge with poll combination event which seems
to be a performance advantage. See: https://kafka.apache.org/introGoogle Pub/SubGoogle Pub Sub system favours a model whereby polling and acknowledgement
of events is done as separate endpoints as separate functions.Information:Cloud Overview - https://cloud.google.com/pubsub/Subscriber Overview - https://cloud.google.com/pubsub/docs/subscriberSubscriber Pull(poll) - https://cloud.google.com/pubsub/docs/pullThe editors would like to thanks the members of the SCIM WG which
began discussions of provisioning events starting with: draft-hunt-scim-notify-00 in 2015.The editor would like to thank the participants in the the SECEVENTS
working group for their support of this specification.Draft 00 - PH - Based on draft-hunt-secevent.distribution with the
following additions:Removed Control Plane from specificationAdded new HTTP Polling delivery methodAdded general HTTP security considerationsAdded authentication and authorizationRevised Verify Event to work with both types of deliveryDraft 01 - PH - Removed Verification section per feedback from IETF99.Draft 02 - MS - Minor editorial improvementsRemoved Identity Provider / Relying Party TerminologyChanged boilerplate language according to RFC8174This draft was based on draft-hunt-secevent.distribution revision history:Draft 00 - PH - First Draft based on reduced version of draft-hunt-idevent-distributionDraft 01 - PH - Reworked terminology to match new WG Transmitter/Receiver termsReworked sections into Data Plane vs. Control PlaneRemoved method transmission registry in order to simplify the specificationMade Create, Update operations optional for Control Plane (Read is MTI)Draft 02 - PH Added iss metadata for Event StreamChanged to using JWKS_uri for issuer and receiver.Control Plane sections moved to draft-hunt-secevent-stream-mgmtAdded support for delivering multiple events using HTTP POST polling