-
Notifications
You must be signed in to change notification settings - Fork 4
/
draft-hunt-secevent-delivery.txt
1568 lines (1037 loc) · 57.1 KB
/
draft-hunt-secevent-delivery.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
Network Working Group P. Hunt, Ed.
Internet-Draft Oracle
Intended status: Standards Track M. Scurtescu
Expires: January 1, 2018 Google
M. Ansari
Cisco
A. Nadalin
Microsoft
A. Backman
Amazon
June 30, 2017
SET Token Delivery Using HTTP
draft-hunt-secevent-delivery-00
Abstract
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.
Status of This Memo
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 January 1, 2018.
Copyright Notice
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
Hunt, et al. Expires January 1, 2018 [Page 1]
Internet-Draft draft-hunt-secevent-delivery June 2017
(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.
Table of Contents
1. Introduction and Overview . . . . . . . . . . . . . . . . . . 2
1.1. Notational Conventions . . . . . . . . . . . . . . . . . 3
1.2. Definitions . . . . . . . . . . . . . . . . . . . . . . . 3
2. SET Event Stream Protocol . . . . . . . . . . . . . . . . . . 5
2.1. Event Delivery Process . . . . . . . . . . . . . . . . . 5
2.2. Push Delivery using HTTP . . . . . . . . . . . . . . . . 6
2.3. Polling Delivery using HTTP . . . . . . . . . . . . . . . 8
2.3.1. Polling HTTP Request Attributes . . . . . . . . . . . 9
2.3.2. Polling HTTP Response Attributes . . . . . . . . . . 10
2.3.3. Poll Request . . . . . . . . . . . . . . . . . . . . 10
2.3.4. Poll Response . . . . . . . . . . . . . . . . . . . . 14
2.4. Error Response Handling . . . . . . . . . . . . . . . . . 16
2.5. Event Stream Verification . . . . . . . . . . . . . . . . 17
3. Authentication and Authorization . . . . . . . . . . . . . . 19
3.1. Use of Tokens as Authorizations . . . . . . . . . . . . . 20
4. Security Considerations . . . . . . . . . . . . . . . . . . . 20
4.1. Authentication Using Signed SETs . . . . . . . . . . . . 20
4.2. HTTP Considerations . . . . . . . . . . . . . . . . . . . 20
4.3. TLS Support Considerations . . . . . . . . . . . . . . . 21
4.4. Authorization Token Considerations . . . . . . . . . . . 21
4.4.1. Bearer Token Considerations . . . . . . . . . . . . . 21
5. Privacy Considerations . . . . . . . . . . . . . . . . . . . 22
6. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 22
7. References . . . . . . . . . . . . . . . . . . . . . . . . . 22
7.1. Normative References . . . . . . . . . . . . . . . . . . 22
7.2. Informative References . . . . . . . . . . . . . . . . . 23
Appendix A. Other Streaming Specifications . . . . . . . . . . . 25
Appendix B. Acknowledgments . . . . . . . . . . . . . . . . . . 26
Appendix C. Change Log . . . . . . . . . . . . . . . . . . . . . 26
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 27
1. Introduction and Overview
This specification defines how a stream of SETs (see
[I-D.ietf-secevent-token]) can be transmitted to a previously
registered Event Receiver using HTTP [RFC7231] over TLS. The
specification defines a method to push SETs via HTTP POST and to poll
for SETs using HTTP POST.
Hunt, et al. Expires January 1, 2018 [Page 2]
Internet-Draft draft-hunt-secevent-delivery June 2017
This specification defines to methods of SET delivery in what is
known as Event Streams. The specification includes a verification
process which tests and validates Event Stream configuration.
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]]
1.1. Notational Conventions
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 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.
1.2. Definitions
This specification assumes terminology defined in the Security Event
Token specification[I-D.ietf-secevent-token] .
The following definitions are defined for Security Event
distribution:
Identity Provider
An Identity Provider is a service provider that issues
authentication assertions that may be used by Relying Party
service providers to establish login sessions with users.
Examples of Identity Providers are defined in: OpenID Connect
[openid-connect-core] and SAML2 [saml-core-2.0]. For the purpose
of this specification an Identity Provider also includes any
provider of services where the compromise of an account may open
up relying parties to attack. For example for the purposes of
security events, an email service provider could be considered an
"implicit" Identity Provider.
Hunt, et al. Expires January 1, 2018 [Page 3]
Internet-Draft draft-hunt-secevent-delivery June 2017
Relying Party
Relying Parties come in multiple forms generally classified as
"Explicit" or "Implicit". An Explicit Relying Party is a service
provider that accepts a standard security assertion (e.g. a JWT
access tokens [RFC7519]) from an Identity Provider to establish a
session or authorization. An Implicit Relying Party (implicit)
uses a personal identifier such as an email address or telephone
number from another provider to establish a Subject's identity.
Examples of Explicit Relying Parties are defined in: OpenID
Connect [openid-connect-core] and SAML2 [saml-core-2.0]. Implicit
relying parties are verified by a common channel associated with
the identifier. For example, an email or a text message is sent
with a unique link to establish ownership of the identifier by the
Subject.
Event Transmitter
A service provider that delivers SETs to other providers known as
Event Receivers. Some examples of Event Transmitters are Identity
Providers and Relying Parties. 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".
Event Receiver
A service provider that registers to receive SETs from an Event
Transmitter and provides an endpoint to receive SETs via HTTP POST
(known as the "Data Plane"). Some examples of Event Receivers are
Identity Providers and Relying Parties. Event Receivers can check
current Event Stream configuration and status by accessing the
Event Transmitters "Control Plane".
Event Stream
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.
Event Family
An Event Family is a URI that describes the set of Events types be
issued in an Event Stream.
Subject
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.
Hunt, et al. Expires January 1, 2018 [Page 4]
Internet-Draft draft-hunt-secevent-delivery June 2017
Event
An Event is defined to be an event as represented by a security
event token (SET). See [I-D.ietf-secevent-token].
NumericDate
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 [POSIX.1] 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 [RFC3339]
for details regarding date/times in general and UTC in particular.
2. SET Event Stream Protocol
An Event Stream represents the communication channel over which a
series of SETs are delivered to a configured Event Receiver.
2.1. Event Delivery Process
When an Event occurs, the Feed Provider constructs a SET token
[I-D.ietf-secevent-token] that describes the Event. The SET issuer
determines the Event Streams over which the SET should be distributed
to.
How SET Events 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 a Event Receiver, the Feed Transmitter
attempts to deliver the SET based on the Event Receiver's registered
delivery mechanism:
o The Event Transmitter uses an HTTP/1.1 POST to the Event Receiver
endpoint to deliver the SET;
o The Event Transmitter queues up the SET in a buffer so that an
Event Receiver MAY poll for SETs using HTTP/1.1 POST.
o Or, the Feed Transmitter delivers the Event through a different
method not defined by this specification.
Delivery of SETs MAY be delivered using one of two modes:
PUSH
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 [RFC7519] with a "Content-Type" header of
"application/secevent+jwt" as defined in Section 2.2 and 6.2 of
Hunt, et al. Expires January 1, 2018 [Page 5]
Internet-Draft draft-hunt-secevent-delivery June 2017
[I-D.ietf-secevent-token]. Upon receipt, the Event Receiver
acknowledges receipt with an HTTP response which is a JSON
document with a "Content-Type" header of "application/json" (see
Section 11 of [RFC7159]) as described below in Section 2.2.
POLLING Where multiple SETs are delivered in a JSON document
[RFC7159] 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
Section 2.3.
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 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 token.
2.2. Push Delivery using HTTP
This method allows an Event Transmitter to use HTTP POST
(Section 4.3.3 [RFC7231]) 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
[I-D.ietf-secevent-token].
The Event Stream configuration defines a URI the of an Event Receiver
provided endpoint which accepts HTTP POST requests (e.g.
"https://notify.examplerp.com/Events").
Hunt, et al. Expires January 1, 2018 [Page 6]
Internet-Draft draft-hunt-secevent-delivery June 2017
The HTTP Content-Type (see Section 3.1.1.5 [RFC7231]) for the HTTP
POST is "application/jwt" and SHALL consist of a single SET token
(see [I-D.ietf-secevent-token]). As per Section 5.3.2 [RFC7231], the
expected media type ("Accept" header) response is "application/json".
To deliver an Event, the Event Transmitter generates an event
delivery message and uses HTTP POST to the configured endpoint with
the appropriate "Accept" and "Content-Type" headers.
POST /Events HTTP/1.1
Host: notify.examplerp.com
Accept: application/json
Authorization: Bearer h480djs93hd8
Content-Type: application/secevent+jwt
eyJhbGciOiJub25lIn0
.
eyJwdWJsaXNoZXJVcmkiOiJodHRwczovL3NjaW0uZXhhbXBsZS5jb20iLCJmZWV
kVXJpcyI6WyJodHRwczovL2podWIuZXhhbXBsZS5jb20vRmVlZHMvOThkNTI0Nj
FmYTViYmM4Nzk1OTNiNzc1NCIsImh0dHBzOi8vamh1Yi5leGFtcGxlLmNvbS9GZ
WVkcy81ZDc2MDQ1MTZiMWQwODY0MWQ3Njc2ZWU3Il0sInJlc291cmNlVXJpcyI6
WyJodHRwczovL3NjaW0uZXhhbXBsZS5jb20vVXNlcnMvNDRmNjE0MmRmOTZiZDZ
hYjYxZTc1MjFkOSJdLCJldmVudFR5cGVzIjpbIkNSRUFURSJdLCJhdHRyaWJ1dG
VzIjpbImlkIiwibmFtZSIsInVzZXJOYW1lIiwicGFzc3dvcmQiLCJlbWFpbHMiX
SwidmFsdWVzIjp7ImVtYWlscyI6W3sidHlwZSI6IndvcmsiLCJ2YWx1ZSI6Impk
b2VAZXhhbXBsZS5jb20ifV0sInBhc3N3b3JkIjoibm90NHUybm8iLCJ1c2VyTmF
tZSI6Impkb2UiLCJpZCI6IjQ0ZjYxNDJkZjk2YmQ2YWI2MWU3NTIxZDkiLCJuYW
1lIjp7ImdpdmVuTmFtZSI6IkpvaG4iLCJmYW1pbHlOYW1lIjoiRG9lIn19fQ
.
Figure 1: Example HTTP POST Request
Upon receipt of the request, the Event Receiver SHALL validate the
JWT structure of the SET as defined in Section 7.2 [RFC7519]. The
Event Receiver SHALL also validate the SET information as described
in Section 2 [I-D.ietf-secevent-token].
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 [RFC7231]).
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), purpose of the HTTP response body is to indicate
any SET parsing, validation, or cryptographic errors.
Hunt, et al. Expires January 1, 2018 [Page 7]
Internet-Draft draft-hunt-secevent-delivery June 2017
The following is a non-normative example of a successful receipt of a
SET.
HTTP/1.1 202 Accepted
Figure 2: Example Successful Delivery Response
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 of retention and method 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 [RFC7231].
When the Event Receiver detects an error parsing or validating a
received SET (as defined by [I-D.ietf-secevent-token]), the Event
Receiver SHALL indicate an HTTP Status 400 error with an error code
as described in Section 2.4.
The following is an example non-normative error response.
HTTP/1.1 400 Bad Request
Content-Type: application/json
{
"err":"dup",
"description":"SET already received. Ignored."
}
Figure 3: Example HTTP Status 400 Response
2.3. Polling Delivery using HTTP
This method allows an Event Receiver to use HTTP POST (Section 4.3.3
[RFC7231]) 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 [RFC6202]).
The delivery of SETs in this method is facilitated by HTTP POST
requests initiated by the Event Receiver in which:
Hunt, et al. Expires January 1, 2018 [Page 8]
Internet-Draft draft-hunt-secevent-delivery June 2017
o The Event Receiver makes an request for available SETs using an
HTTP POST to a pre-arranged endpoint provided by the Event
Transmitter. Or,
o 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.
2.3.1. Polling HTTP Request Attributes
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 Section 2.3.3 and Section 2.3.4
When making a request, the HTTP header "Content-Type" is set to
"application/json".
The following JSON Attributes are used in a polling request:
Request Processing Parameters
maxEvents
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.
returnImmediately
An OPTIONAL JSON boolean value that indicates the Event
Transmitter SHOULD return an immediate response even if no
Hunt, et al. Expires January 1, 2018 [Page 9]
Internet-Draft draft-hunt-secevent-delivery June 2017
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 [RFC6202]). The time out for the request
is part of the Stream configuration which is out of scope of
this specification.
SET Acknowledgment Parameters
ack
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).
setErrs
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 Section 2.4.
2.3.2. Polling HTTP Response Attributes
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:
sets
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.
moreAvailable
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".
2.3.3. Poll Request
The Event Receiver performs an HTTP POST (see Section 4.3.4
[RFC7231]) to a pre-arranged polling endpoint URI to check for SETs
Hunt, et al. Expires January 1, 2018 [Page 10]
Internet-Draft draft-hunt-secevent-delivery June 2017
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:
Poll Only
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).
Acknowledge Only
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.
Combined Acknowledge and Poll
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.
2.3.3.1. Poll Only Request
In the case where no SETs were received in a previous poll (see
Figure 10), 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.
Hunt, et al. Expires January 1, 2018 [Page 11]
Internet-Draft draft-hunt-secevent-delivery June 2017
The following is a non-normative example poll request to the
endpoint: "https://nofity.exampleidp.com/Events".
POST /Events HTTP/1.1
Host: notify.exampleidp.com
Authorization: Bearer h480djs93hd8
Accept: application/json
{
"returnImmediately":true
}
Figure 4: Example Initial Poll Request
An Event Receiver MAY poll with no parameters at all by passing an
empty JSON object.
The following is a non-normative example default poll request to the
endpoint: "https://nofity.exampleidp.com/Events".
POST /Events HTTP/1.1
Host: notify.exampleidp.com
Authorization: Bearer h480djs93hd8
Accept: application/json
{}
Figure 5: Example Default Poll Request
2.3.3.2. Acknowledge Only Request
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.
Hunt, et al. Expires January 1, 2018 [Page 12]
Internet-Draft draft-hunt-secevent-delivery June 2017
The following is a non-normative example poll with acknowledgement of
SETs received (for example as shown in Figure 9).
POST /Events HTTP/1.1
Host: notify.exampleidp.com
Authorization: Bearer h480djs93hd8
Content-Type: application/json
Authorization: Bearer h480djs93hd8
{
"ack":[
"4d3559ec67504aaba65d40b0363faad8",
"3d0c3cf797584bd193bd0fb1bd4e7d30"
],
"maxEvents":0
}
Figure 6: Example Acknowledge Only equest
2.3.3.3. Poll with Acknowledgement
This variation allows a receiver thread to simultaneously acknowledge
previously received SETs and wait for the next group of SETs in a
single request.
The following is a non-normative example poll with acknowledgement of
SETs received in Figure 9.
POST /Events HTTP/1.1
Host: notify.exampleidp.com
Authorization: Bearer h480djs93hd8
Content-Type: application/json
Authorization: Bearer h480djs93hd8
{
"ack":[
"4d3559ec67504aaba65d40b0363faad8",
"3d0c3cf797584bd193bd0fb1bd4e7d30"
],
"returnImmediately":false
}
Figure 7: Example Poll With Acknowledgement and No Errors
Hunt, et al. Expires January 1, 2018 [Page 13]
Internet-Draft draft-hunt-secevent-delivery June 2017
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.
2.3.3.4. Poll with Acknowledgement and Errors
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.
The following is a non-normative example of a response acknowledging
1 error and 1 receipt of two SETs received in Figure 9.
POST /Events HTTP/1.1
Host: notify.exampleidp.com
Authorization: Bearer h480djs93hd8
Content-Type: application/json
Authorization: Bearer h480djs93hd8
{
"ack":["3d0c3cf797584bd193bd0fb1bd4e7d30"],
"setErrs":{
"4d3559ec67504aaba65d40b0363faad8":{
"err":"jwtAud",
"description":"The audience value was incorrect."
}
},
"returnImmediately":true
}
Figure 8: Example Poll Acknowledgement With Error
2.3.4. Poll Response
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 Section 2.3.2 a JSON document is returned containing
a number of attributes including "sets" which SHALL contain zero or
more SETs.
Hunt, et al. Expires January 1, 2018 [Page 14]
Internet-Draft draft-hunt-secevent-delivery June 2017
The following is a non-normative example response to the request
shown Section 2.3.3. This example shows two SETs are returned.
HTTP/1.1 200 OK
Content-Type: application/json
Location: https://notify.exampleidp/Events
{
"sets":{
"4d3559ec67504aaba65d40b0363faad8":
"eyJhbGciOiJub25lIn0.
eyJqdGkiOiI0ZDM1NTllYzY3NTA0YWFiYTY1ZDQwYjAzNjNmYWFkOCIsImlhdCI6MTQ
1ODQ5NjQwNCwiaXNzIjoiaHR0cHM6Ly9zY2ltLmV4YW1wbGUuY29tIiwiYXVkIjpbIm
h0dHBzOi8vc2NpbS5leGFtcGxlLmNvbS9GZWVkcy85OGQ1MjQ2MWZhNWJiYzg3OTU5M
2I3NzU0IiwiaHR0cHM6Ly9zY2ltLmV4YW1wbGUuY29tL0ZlZWRzLzVkNzYwNDUxNmIx
ZDA4NjQxZDc2NzZlZTciXSwiZXZlbnRzIjp7InVybjppZXRmOnBhcmFtczpzY2ltOmV
2ZW50OmNyZWF0ZSI6eyJyZWYiOiJodHRwczovL3NjaW0uZXhhbXBsZS5jb20vVXNlcn
MvNDRmNjE0MmRmOTZiZDZhYjYxZTc1MjFkOSIsImF0dHJpYnV0ZXMiOlsiaWQiLCJuY
W1lIiwidXNlck5hbWUiLCJwYXNzd29yZCIsImVtYWlscyJdfX19.",
"3d0c3cf797584bd193bd0fb1bd4e7d30":
"eyJhbGciOiJub25lIn0.
eyJqdGkiOiIzZDBjM2NmNzk3NTg0YmQxOTNiZDBmYjFiZDRlN2QzMCIsImlhdCI6MTQ
1ODQ5NjAyNSwiaXNzIjoiaHR0cHM6Ly9zY2ltLmV4YW1wbGUuY29tIiwiYXVkIjpbIm
h0dHBzOi8vamh1Yi5leGFtcGxlLmNvbS9GZWVkcy85OGQ1MjQ2MWZhNWJiYzg3OTU5M
2I3NzU0IiwiaHR0cHM6Ly9qaHViLmV4YW1wbGUuY29tL0ZlZWRzLzVkNzYwNDUxNmIx
ZDA4NjQxZDc2NzZlZTciXSwic3ViIjoiaHR0cHM6Ly9zY2ltLmV4YW1wbGUuY29tL1V
zZXJzLzQ0ZjYxNDJkZjk2YmQ2YWI2MWU3NTIxZDkiLCJldmVudHMiOnsidXJuOmlldG
Y6cGFyYW1zOnNjaW06ZXZlbnQ6cGFzc3dvcmRSZXNldCI6eyJpZCI6IjQ0ZjYxNDJkZ
jk2YmQ2YWI2MWU3NTIxZDkifSwiaHR0cHM6Ly9leGFtcGxlLmNvbS9zY2ltL2V2ZW50
L3Bhc3N3b3JkUmVzZXRFeHQiOnsicmVzZXRBdHRlbXB0cyI6NX19fQ."
}
}
Figure 9: Example Poll Response
In the above example, a two SETs whose "jti" are
"4d3559ec67504aaba65d40b0363faad8" and
"3d0c3cf797584bd193bd0fb1bd4e7d30" are delivered.
Hunt, et al. Expires January 1, 2018 [Page 15]
Internet-Draft draft-hunt-secevent-delivery June 2017
The following is a non-normative example response to the request
shown Section 2.3.3 showing no new SETs or unacknowledged SETs are
available.
HTTP/1.1 200 OK
Content-Type: application/json
Location: https://notify.exampleidp/Events
{
"sets":{ }
}
Figure 10: Example No SETs Poll Response
Upon receiving the JSON document (e.g. as shown in Figure 9), 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 Section 2.3.3.3 or Section 2.3.3.4.
2.4. Error Response Handling
If a SET is invalid, the following error codes are defined:
+-----------+-------------------------------------------------------+
| Err Value | Description |
+-----------+-------------------------------------------------------+
| json | Invalid JSON object. |
| jwtParse | Invalid or unparsable JWT or JSON structure. |
| jwtHdr | In invalid JWT header was detected. |
| jwtCrypto | Unable to parse due to unsupported algorithm. |
| jws | Signature was not validated. |
| jwe | Unable to decrypt JWE encoded data. |
| jwtAud | Invalid audience value. |
| jwtIss | Issuer not recognized. |
| setType | An unexpected Event type was received. |
| setParse | Invalid structure was encountered such as an |
| | inability to parse or an incomplete set of Event |
| | claims. |
| setData | SET event claims incomplete or invalid. |
| dup | A duplicate SET was received and has been ignored. |
+-----------+-------------------------------------------------------+
Table 1: SET Errors
An error response SHALL include a JSON object which provides details
about the error. The JSON object includes the JSON attributes:
err
Hunt, et al. Expires January 1, 2018 [Page 16]
Internet-Draft draft-hunt-secevent-delivery June 2017
A value which is a keyword that describes the error (see Table 1).
description
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 Figure 3). When included as part of a
batch of SETs, the above JSON is included as part of the "setErrs"
attribute as defined in Section 2.3.2 and Section 2.3.3.4
2.5. Event Stream Verification
In the verify process, the Event Receiver organization initiates a
request to the Event Transmitter to verify the Stream. The Event
Receiver provides a "confirm" value and a "nonce" value that the
Event Transmitter is expected to return in the body of a Verify Event
so that the Event Receiver can confirm end-to-end configuration of
SET delivery including proper signing and encryption depending on the
configuration of the Stream. For example, can the Event Transmitter
send a encrypted SET that the Receiver can decode? The method by
which this is initiated is out-of-scope of this specification and MAY
be provided by a profiling specification, or by administrative
interfaces offered by the Event Transmitter.
To confirm an Event Stream configuration, the Event Transmitter SHALL
send a Verify SET to the Event Receiver using the registered
"methodUri" mechanism.
The Verify SET contains the following attributes:
events
Set with a value of "[[this RFC URL]]#verify".
iss
Set to the URI defined in the Event Stream configuration.
aud
MUST be set to a value that matches the EventStream "aud" value
agreed to.
exp
A value that indicates the time the verification request will
expire. Once expired, the server will set the Event Stream state
to "fail".
confirm
Hunt, et al. Expires January 1, 2018 [Page 17]
Internet-Draft draft-hunt-secevent-delivery June 2017
The value given by the Event Receiver to the Event Transmitter to
return in the Verify Event.
nonce
A value given by the Event Receiver or otherwise agreed up to
return which SHOULD be unique to the Stream and SHOULD change with
each test in order to distinguish tests uniquely.
If the Event Stream is configured to encrypt SETs for the Event
Receiver, then the SET SHOULD be encrypted with the provided key.
Successful parsing of the message confirms that provides confirmation
of correct configuration and possession of keys.
A non-normative JSON representation of an Event to be sent to a Event
Receiver as a Event Stream confirmation. Note the Event is not yet
encoded as a JWT token:
{
"jti": "4d3559ec67504aaba65d40b0363faad8",
"events":["[[this RFC URL]]#verify"],
"iat": 1458496404,
"iss": "https://scim.example.com",
"exp": 1458497000,
"aud":[
"https://event.example.com/Feeds/98d52461fa5bbc879593b7754"
],
"[[this RFC URL]]#verify":{
"confirm":"ca2179f4-8936-479a-a76d-5486e2baacd7",
"nonce":"1668c993e95849869e4b3506cccdf9bf"
}
}
Figure 11: Example Verification SET with Challenge
The above SET is encoded as a JWT and transmitted to the Event
Receiver using the configured delivery method.
Upon receiving a verify SET, the Event Receiver SHALL parse the SET
and verify its claims. In particular, the Event Receiver SHALL
confirm that the values for "confirm" and "nonce" are as expected.
If they do not match, an error response of "setData" SHOULD be
returned (see Section 2.4).
In many cases, Event Transmitters MAY disable or suspend an Event