forked from independentid/Identity-Events
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdraft-ietf-secevent-token.xml
1688 lines (1518 loc) · 69.4 KB
/
draft-ietf-secevent-token.xml
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
<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type='text/xsl' href='http://xml2rfc.tools.ietf.org/authoring/rfc2629.xslt' ?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">
<?rfc toc="yes"?>
<?rfc tocompact="yes"?>
<?rfc tocdepth="3"?>
<?rfc tocindent="yes"?>
<?rfc symrefs="yes"?>
<?rfc sortrefs="yes"?>
<?rfc comments="yes"?>
<?rfc inline="yes"?>
<?rfc compact="yes"?>
<?rfc subcompact="no"?>
<rfc category="std" docName="draft-ietf-secevent-token-13" ipr="trust200902">
<front>
<title abbrev="draft-ietf-secevent-token">Security Event Token (SET)</title>
<author fullname="Phil Hunt" initials="P." role="editor" surname="Hunt">
<organization abbrev="Oracle">Oracle Corporation</organization>
<address>
<email>phil.hunt@yahoo.com</email>
</address>
</author>
<author fullname="Michael B. Jones" initials="M.B." surname="Jones">
<organization abbrev="Microsoft">Microsoft</organization>
<address>
<email>mbj@microsoft.com</email>
<uri>http://self-issued.info/</uri>
</address>
</author>
<author fullname="William Denniss" initials="W." surname="Denniss">
<organization abbrev="Google">Google</organization>
<address>
<email>wdenniss@google.com</email>
</address>
</author>
<author fullname="Morteza Ansari" initials="M.A." surname="Ansari">
<organization abbrev="Cisco">Cisco</organization>
<address>
<email>morteza.ansari@cisco.com</email>
</address>
</author>
<date year="2018" month="May" />
<area>Security</area>
<workgroup>Security Events Working Group</workgroup>
<keyword>Identity</keyword>
<keyword>Security</keyword>
<keyword>Event</keyword>
<keyword>Token</keyword>
<keyword>Claims</keyword>
<keyword>JSON</keyword>
<keyword>JSON Web Token</keyword>
<keyword>JWT</keyword>
<keyword>Internet-Draft</keyword>
<abstract>
<t>
This specification defines the Security Event Token (SET) data structure.
A SET describes statements of fact from the perspective of an issuer
about a subject. These statements of fact represent an event
that occurred directly to or about a security subject, for example,
a statement about the issuance or revocation of a token on
behalf of a subject. This specification is intended to enable
representing security- and identity-related events. 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.
</t>
</abstract>
</front>
<middle>
<section anchor="intro" title="Introduction and Overview" toc="default">
<t>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 <xref target="RFC7519"/>
in order to provide a self-contained token that can be optionally
signed using JSON Web Signature (JWS) <xref target="RFC7515"/>
and/or encrypted using JSON Web Encryption (JWE) <xref target="RFC7516"/>.</t>
<t>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.</t>
<t>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.</t>
<t>Security events are not commands issued between parties.
A SET describes statements of fact from the perspective of
an issuer about a subject (e.g., a web resource, token, IP
address, the issuer itself). These statements of fact
represent a logical event that occurred directly to or about a
security subject, for example, a statement about the issuance
or revocation of a token on behalf of a subject. 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:
<list style="symbols">
<t>The creation, modification, removal of a resource.</t>
<t>The resetting or suspension of an account.</t>
<t>The revocation of a security token prior to its expiry.</t>
<t>The logout of a user session. Or, </t>
<t>An indication that a user has been given control of an email identifier
that was previously controlled by another user.
</t>
</list></t>
<t>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.</t>
<t>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.</t>
<section anchor="notat" title="Notational Conventions" toc="default">
<t>
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 <xref target="RFC2119"/> <xref target="RFC8174"/>
when, and only when, they appear in all capitals, as shown here.
</t>
<t>For purposes of readability, examples are not URL encoded.
Implementers MUST percent encode URLs as described in
Section 2.1 of <xref target="RFC3986"/>.</t>
<t>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.</t>
</section>
<section anchor="defs" title="Definitions" toc="default">
<t>
The following definitions are used with SETs:
<list style="hanging">
<t hangText="Security Event Token (SET)">
<vspace/>
A SET is a JWT <xref target="RFC7519"/> conforming to
this specification.
</t>
<t hangText="SET Issuer">
<vspace/>
A service provider that creates SETs to be sent to other service providers known
as SET recipients.
</t>
<t hangText="SET Recipient">
<vspace/>
A SET recipient is an entity that receives SETs through
some distribution method. A SET recipient is the same
entity referred as a "recipient" in <xref target="RFC7519"/> or "receiver" in
related specifications.
</t>
<t hangText="Subject">
<vspace/>
A SET describes an event or state change that has occurred
to a subject. A subject might, for instance, be a principal (e.g.,
Section 4.1.2 of <xref target="RFC7519"/>), a web resource,
an entity such as an IP address, or the issuer of the SET.
</t>
<t hangText="Event Identifier">
<vspace/>
A member name for an element of the JSON object that is
the value of the <spanx style="verb">events</spanx> claim in a SET.
This member name MUST be a URI.
</t>
<t hangText="Event Payload">
<vspace/>
A member value for an element of the JSON object that is
the value of the <spanx style="verb">events</spanx> claim in a SET.
This member value MUST be a JSON object.
</t>
<t hangText="Profiling Specification">
<vspace/>
A specification that profiles the SET data structure to define
one or more specific event types and their associated claims and processing rules.
</t>
</list>
</t>
</section>
</section>
<section anchor="events" title="The Security Event Token (SET)">
<t>
A SET is a JWT <xref target="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:
<list style="symbols">
<t>
The top-level claims in the JWT Claims Set are called the SET "envelope".
Some of these claims are present in every SET;
others will be specific to particular SET profiles or profile families.
Claims in the envelope SHOULD be registered in the
"JSON Web Token Claims" registry <xref target="IANA.JWT.Claims"/> or be
Public Claims or Private Claims, as defined in <xref target="RFC7519"/>.
</t>
<t>
Envelope claims that are profiled and defined in this specification
are used to validate the SET and provide information about
the event data included in the SET.
The claim <spanx style="verb">events</spanx> contains the event identifiers
and event-specific data expressed about the security subject.
The envelope MAY include event-specific or profile-specific data.
The <spanx style="verb">events</spanx> claim value MUST be a JSON object
that contains at least one member.
</t>
<t>
Each member of the <spanx style="verb">events</spanx>
JSON object is a name/value pair. The JSON member name is a
URI string value, which is the event identifier, and the
corresponding value is a JSON object known as the event "payload".
The payload JSON object contains claims that pertain to
that event identifier and need not be registered as JWT claims.
These claims are defined by the profiling specification that defines the event.
An event with no payload claims SHALL be represented as the empty JSON object
(<spanx style="verb">{}</spanx>).
</t>
<t>
When multiple event identifiers are contained in a SET,
they represent multiple aspects of the same state transition
that occurred to the security subject.
They are not intended to be used to aggregate distinct events about the same subject.
Beyond this, the interpretation of SETs containing multiple event identifiers
is out of scope for this specification;
profiling specifications MAY define their own rules regarding their use of
SETs containing multiple event identifiers, as described in <xref target="Profiles"/>.
Possible uses of multiple values include, but are not limited to:
<list style="symbols">
<t>
Values to provide classification information (e.g., threat type or level).
</t>
<t>
Additions to existing event representations.
</t>
<t>
Values used to link potential series of events.
</t>
<t>
Specific-purpose event URIs used between particular SET issuers and SET recipients.
</t>
</list>
</t>
</list>
</t>
<section anchor="IllustrativeExamples" title="Illustrative Examples">
<t>
This section illustrates several possible uses of SETs
through non-normative examples.
</t>
<section anchor="SCIMExample" title="SCIM Example">
<t>The following example shows the JWT Claims Set for a hypothetical
SCIM <xref target="RFC7644"/> password reset SET. Such
a SET might be used by a receiver as a trigger to reset
active user-agent sessions related to the
identified user.</t>
<figure anchor="examplePassword" title="Example SCIM Password Reset Event">
<artwork>
{
"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}
}
}
</artwork>
</figure>
<t>
The JWT Claims Set usage consists of:
<list style="symbols">
<t>The <spanx style="verb">events</spanx> claim specifying the hypothetical
SCIM URN (<spanx style="verb">urn:ietf:params:scim:event:passwordReset</spanx>)
for a password reset, and a second value,
<spanx style="verb">https://example.com/scim/event/passwordResetExt</spanx>,
that is used to provide additional event information such as the
current count of resets.</t>
<t>The <spanx style="verb">iss</spanx>
claim, denoting the SET issuer.</t>
<t>The <spanx style="verb">sub</spanx> claim, specifying the SCIM
resource URI that was affected.</t>
<t>The <spanx style="verb">aud</spanx> claim, specifying the
intended audiences for the event.
(The syntax of the <spanx style="verb">aud</spanx> claim
is defined in Section 4.1.3 of <xref target="RFC7519"/>.)
</t>
</list></t>
<t>The SET contains two event payloads:<list style="symbols">
<t>The <spanx style="verb">id</spanx> claim represents
SCIM's unique identifier for a subject.</t>
<t>The second payload identified by <spanx style="verb">https://example.com/scim/event/passwordResetExt</spanx>)
and the payload claim <spanx style="verb">resetAttempts</spanx>
conveys the current count of reset attempts. In this example,
while the count is a simple factual statement for the issuer,
the meaning of the value (a count) is up to the receiver.
As an example, such a value might be used by the receiver
to infer increasing risk.
</t>
</list></t>
<t>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
<spanx style="verb">resetAttempts</spanx> is in the event payload
of an event used to convey this information.
</t>
</section>
<section anchor="LogoutExample" title="Logout Example">
<t><figure anchor="exampleBackLogoutEvent" title="Example OpenID Back-Channel Logout Event">
<preamble>Here is another example JWT Claims Set for a security event token, this one
for a Logout Token:</preamble>
<artwork>
{
"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": {}
}
}
</artwork>
</figure>
</t>
<t>
Note that the above SET has an empty JSON object and
uses the JWT claims <spanx style="verb">sub</spanx>
and <spanx style="verb">sid</spanx> to identify the subject
that was logged out.
At the time of this writing, this example
corresponds to the logout token defined in the
<xref target="OpenID.BackChannel">OpenID Connect Back-Channel Logout 1.0</xref>
specification.
</t>
</section>
<section anchor="ConsentExample" title="Consent Example">
<t>
<figure anchor="exampleConsent" title="Example Consent Event">
<preamble>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:</preamble>
<artwork>
{
"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"
]
}
}
}
</artwork>
</figure>
</t>
<t>
In the above example, the attribute <spanx style="verb">iss</spanx> contained within the
payload for the event <spanx style="verb">https://openid.net/heart/specs/consent.html</spanx> refers
to the issuer of the security subject (<spanx style="verb">sub</spanx>) rather than the
SET issuer <spanx style="verb">https://my.med.example.org</spanx>. They are
distinct from the top-level value of <spanx style="verb">iss</spanx>,
which always refers to the issuer of the event -- a medical consent
service that is a relying party to the OpenID Provider.
</t>
</section>
<section anchor="RISCExample" title="RISC Example">
<t>
<figure anchor="exampleRISC" title="Example RISC Event">
<preamble>
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 <xref target="RISC"/>.
The example is subject to change.
</preamble>
<artwork>
{
"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
}
}
}
</artwork>
</figure>
</t>
<t>
Notice that parameters to the event are included in the event payload, in this case,
the <spanx style="verb">reason</spanx> and <spanx style="verb">cause-time</spanx> values.
The subject of the event is identified using the <spanx style="verb">subject</spanx>
payload value, which itself is a JSON object.
</t>
</section>
</section>
<section anchor="EventContents" title="Core SET Claims">
<t>
The following claims from <xref target="RFC7519"/> are profiled for use in SETs:
<list style="hanging">
<t hangText='"iss" (Issuer) Claim'>
<vspace/>
As defined by Section 4.1.1 of <xref target="RFC7519"/>,
this claim contains a string identifying the service provider publishing
the SET (the issuer).
In some cases, the issuer of the SET will not be
the issuer associated with the security subject of the SET.
Therefore, implementers cannot assume that the issuers are the same
unless the profiling specification specifies that they are
for SETs conforming to that profile.
This claim is REQUIRED.
</t>
<t hangText='"iat" (Issued At) Claim'>
<vspace/>
As defined by Section 4.1.6 of <xref target="RFC7519"/>,
this claim contains a value representing when the SET was issued.
This claim is REQUIRED.
</t>
<t hangText='"jti" (JWT ID) Claim'>
<vspace/>
As defined by Section 4.1.7 of <xref target="RFC7519"/>,
this claim contains a unique identifier for the SET.
The identifier MUST be unique within
a particular event feed and MAY be used by clients to track
whether a particular SET has already been received.
This claim is REQUIRED.
</t>
<t hangText='"aud" (Audience) Claim'>
<vspace/>
As defined by Section 4.1.3 of <xref target="RFC7519"/>,
this claim contains one or more audience identifiers for the SET.
This claim is RECOMMENDED.
</t>
<!-- Removed after WGLC discussion
<t hangText='"nbf" (Not Before) Claim'>
<vspace/>
Defined by
Section 4.1.5 of <xref target="RFC7519"/>, this claim is
not used in SET and SHOULD NOT be used.</t>
-->
<t hangText='"sub" (Subject) Claim'>
<vspace/>
As defined by Section 4.1.2 of <xref target="RFC7519"/>,
this claim contains a StringOrURI value representing
the principal that is the subject of the SET. This is
usually the entity whose "state" was changed.
For example: <list style="symbols">
<t>an IP Address was added to a black list;</t>
<t>a URI representing a user resource that was modified; or,</t>
<t>a token identifier (e.g. <spanx style="verb">jti</spanx>)
for a revoked token.</t>
</list>
If used, the profiling specification MUST define the
content and format semantics for the value. This claim
is OPTIONAL, as the principal for any given profile may
already be identified without the inclusion of a subject
claim. Note that some SET profiles MAY choose to convey
event subject information in the event payload (either
using the <spanx style="verb">sub</spanx> member name or
another name), particularly if the subject information is
relative to issuer information that is also conveyed in
the event payload, which may be the case for some identity
SET profiles.
</t>
<t hangText='"exp" (Expiration Time) Claim'>
<vspace/>
As defined by Section 4.1.4 of <xref target="RFC7519"/>, this claim
is the time after which the JWT MUST NOT be accepted for processing.
In the context of a SET however, this notion does not typically apply,
since a SET represents something that has already occurred and is historical in nature.
Therefore, its use is NOT RECOMMENDED.
(Also, see <xref target="SETsAndIDTokens"/> for additional reasons
not to use the <spanx style="verb">exp</spanx> claim in some SET use cases.)
</t>
</list>
</t>
<t>
The following new claims are defined by this specification:
<list style="hanging">
<t hangText='"events" (Security Events) Claim' anchor="eventDef">
<vspace/>
This claim contains a set of event statements
that each provide information describing a single
logical event that has occurred about a security subject
(e.g., a state change to the subject).
Multiple event identifiers with the same value MUST NOT be used.
The <spanx style="verb">events</spanx>
claim MUST NOT be used to express multiple independent logical events.
</t>
<t>
The value of the <spanx style="verb">events</spanx> claim is a
JSON object whose members are name/value pairs
whose names are URIs identifying the event statements being
expressed. Event identifiers SHOULD be stable values (e.g., a
permanent URL for an event specification). For each name present,
the corresponding value
MUST be a JSON object. The JSON object MAY be an empty
object (<spanx style="verb">{}</spanx>), or it MAY be a JSON
object containing data described by the profiling specification.
</t>
<t hangText='"txn" (Transaction Identifier) Claim' anchor="txnDef">
<vspace/>
An OPTIONAL string value that represents a unique transaction identifier.
In cases in which multiple related JWTs are issued, the transaction
identifier claim can be used to correlate these related JWTs.
Note that this claim can be used in JWTs that are SETs
and also in JWTs using non-SET profiles.
</t>
<t hangText='"toe" (Time of Event) Claim'>
<vspace/>
A value that represents the date and time at which the event occurred.
This value is a NumericDate (see Section 2 of <xref target="RFC7519"/>).
By omitting this claim, the issuer indicates that
they are not sharing an event time with the recipient.
(Note that in some use cases, the represented time might be approximate;
statements about the accuracy of this field MAY be made by profiling specifications.)
This claim is OPTIONAL.
</t>
</list>
</t>
</section>
<section anchor="ExplicitTyping" title="Explicit Typing of SETs">
<t>
This specification registers the <spanx style="verb">application/secevent+jwt</spanx>
media type, which can be used to indicate that the content is a SET.
SETs MAY include this media type in the <spanx style="verb">typ</spanx> 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.
</t>
<t>
Per the definition of <spanx style="verb">typ</spanx> in Section 4.1.9 of <xref target="RFC7515"/>,
it is RECOMMENDED that the "application/" prefix be omitted.
Therefore, the <spanx style="verb">typ</spanx> value used SHOULD be
<spanx style="verb">secevent+jwt</spanx>.
</t>
</section>
<section anchor="eventMessage" title="Security Event Token Construction">
<t>
This section describes how to construct a SET.
</t>
<t>
<figure anchor="exampleJsonEvent" title="Example Event Claims">
<preamble>
The following is an example JWT Claims Set for a hypothetical SCIM SET
(which has been formatted for readability):
</preamble>
<artwork>
{
"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"]
}
}
}
</artwork>
</figure></t>
<t>
The JSON Claims Set is encoded per <xref target="RFC7519"/>.
</t>
<t>
<figure>
<preamble>
In this example, the SCIM SET claims are encoded in an unsecured JWT.
The JOSE Header for this example is:
</preamble>
<artwork>{"typ":"secevent+jwt","alg":"none"}</artwork>
</figure>
</t>
<t>
<figure>
<preamble>Base64url encoding (see Section 2 of <xref target="RFC7515"/>) of the octets of the UTF-8
<xref target="RFC3629"/> representation of the JOSE Header yields:</preamble>
<artwork>eyJ0eXAiOiJzZWNldmVudCtqd3QiLCJhbGciOiJub25lIn0</artwork>
</figure>
</t>
<t>
<figure>
<preamble>The above example JWT Claims Set is encoded as
follows:</preamble>
<artwork>
eyJqdGkiOiI0ZDM1NTllYzY3NTA0YWFiYTY1ZDQwYjAzNjNmYWFkOCIsImlhdCI6MTQ1
ODQ5NjQwNCwiaXNzIjoiaHR0cHM6Ly9zY2ltLmV4YW1wbGUuY29tIiwiYXVkIjpbImh0
dHBzOi8vc2NpbS5leGFtcGxlLmNvbS9GZWVkcy85OGQ1MjQ2MWZhNWJiYzg3OTU5M2I3
NzU0IiwiaHR0cHM6Ly9zY2ltLmV4YW1wbGUuY29tL0ZlZWRzLzVkNzYwNDUxNmIxZDA4
NjQxZDc2NzZlZTciXSwiZXZlbnRzIjp7InVybjppZXRmOnBhcmFtczpzY2ltOmV2ZW50
OmNyZWF0ZSI6eyJyZWYiOiJodHRwczovL3NjaW0uZXhhbXBsZS5jb20vVXNlcnMvNDRm
NjE0MmRmOTZiZDZhYjYxZTc1MjFkOSIsImF0dHJpYnV0ZXMiOlsiaWQiLCJuYW1lIiwi
dXNlck5hbWUiLCJwYXNzd29yZCIsImVtYWlscyJdfX19</artwork>
</figure>
</t>
<t>
<figure anchor="eventToken"
title="Example Unsecured Security Event Token">
<preamble>The encoded JWS signature is the empty string.
Concatenating the parts yields this complete SET:</preamble>
<artwork>
eyJ0eXAiOiJzZWNldmVudCtqd3QiLCJhbGciOiJub25lIn0.
eyJqdGkiOiI0ZDM1NTllYzY3NTA0YWFiYTY1ZDQwYjAzNjNmYWFkOCIsImlhdCI6MTQ1
ODQ5NjQwNCwiaXNzIjoiaHR0cHM6Ly9zY2ltLmV4YW1wbGUuY29tIiwiYXVkIjpbImh0
dHBzOi8vc2NpbS5leGFtcGxlLmNvbS9GZWVkcy85OGQ1MjQ2MWZhNWJiYzg3OTU5M2I3
NzU0IiwiaHR0cHM6Ly9zY2ltLmV4YW1wbGUuY29tL0ZlZWRzLzVkNzYwNDUxNmIxZDA4
NjQxZDc2NzZlZTciXSwiZXZlbnRzIjp7InVybjppZXRmOnBhcmFtczpzY2ltOmV2ZW50
OmNyZWF0ZSI6eyJyZWYiOiJodHRwczovL3NjaW0uZXhhbXBsZS5jb20vVXNlcnMvNDRm
NjE0MmRmOTZiZDZhYjYxZTc1MjFkOSIsImF0dHJpYnV0ZXMiOlsiaWQiLCJuYW1lIiwi
dXNlck5hbWUiLCJwYXNzd29yZCIsImVtYWlscyJdfX19.
</artwork>
</figure></t>
<t>For the purpose of having a simpler example in <xref target="eventToken"/>,
an unsecured token is shown. When SETs are not signed or
encrypted, other mechanisms such as TLS MUST be employed
to provide integrity protection, confidentiality,
and issuer authenticity, as needed by the application.
</t>
<t>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 <xref target="RFC7519"/>.</t>
</section>
</section>
<section anchor="Profiles" title="Requirements for SET Profiles">
<t>
Profiling specifications of this specification define actual SETs
to be used in particular use cases. These profiling
specifications define the syntax and semantics of SETs conforming
to that SET profile and rules for validating those SETs.
Profiling specifications SHOULD define syntax, semantics, subject
identification, and validation.<list style="hanging">
<t hangText="Syntax"><vspace/>
The syntax of the SETs defined, including:
<list style="hanging">
<t hangText="Top-Level Claims"><vspace/>Claims and values
placed at the JWT Claims Set. Examples are claims
defined by the JWT specification (see <xref target="RFC7519"/>),
the SET specification, and by the profiling specification.</t>
<t hangText="Event Payload"><vspace/>The JSON data structure
contents and format, containing event-specific information,
if any (see <xref target="defs"/>).</t>
</list></t>
<t hangText="Semantics"><vspace/>
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 <spanx style="verb">iss</spanx>
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.
</t>
<t hangText="Subject Identification"><vspace/>
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 <spanx style="verb">sub</spanx> claim
in cases in which the subject is not globally unique and has a different issuer from the SET itself.
</t>
<t hangText="Validation"><vspace/>
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.
</t>
<t>
Among the syntax and semantics of SETs that a profiling specification
may define is whether the value of the <spanx style="verb">events</spanx>
claim may contain multiple members, and what processing instructions
are employed in the single- and multiple-valued cases for SETs
conforming to that profile. Many valid choices are possible.
For instance, some profiles might allow multiple event identifiers to be present
and specify that any that are not understood by recipients be ignored,
thus enabling extensibility.
Other profiles might allow multiple event identifiers to be present
but require that all be understood if the SET is to be accepted.
Some profiles might require that only a single value be present.
All such choices are within the scope of profiling specifications to define.</t>
</list></t>
</section>
<section anchor="SETsAndJWTs" title="Preventing Confusion between SETs and other JWTs">
<t>
Because <xref target="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 another kind of JWT from the same issuer.
Unless this confusion is prevented, this might enable an attacker who possesses
a SET to use it in a context in which another kind of JWT is expected, or vice-versa.
This section presents concrete techniques for preventing confusion between
SETs and several other specific kinds of JWTs, as well as generic techniques
for preventing possible confusion between SETs and other kinds of JWTs.
</t>
<section anchor="SETsAndIDTokens" title="Distinguishing SETs from ID Tokens">
<t>
A SET might be confused with ID Token <xref target="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 <spanx style="verb">exp</spanx> claim
not be present in the SET.
Because <spanx style="verb">exp</spanx> 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.
</t>
<t>
Excluding <spanx style="verb">exp</spanx> 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 <spanx style="verb">nonce</spanx> claim value
for the ID Token to be accepted in contexts for which substitution is possible.
</t>
<t>
Note that the use of explicit typing, as described in <xref target="ExplicitTyping"/>,
will not achieve disambiguation between ID Tokens and SETs, as the ID Token validation rules
do not use the <spanx style="verb">typ</spanx> header parameter value.
</t>
</section>
<section anchor="SETsAndATs" title="Distinguishing SETs from Access Tokens">
<t>
OAuth 2.0 <xref target="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:
<list style="symbols">
<t>
Prohibit use of the <spanx style="verb">exp</spanx> claim,
as is done to prevent ID Token confusion.
</t>
<t>
Where possible, use a separate <spanx style="verb">aud</spanx>
claim value to distinguish between the SET recipient and the
protected resource that is the audience of an access token.
</t>
<t>
Modify access token validation systems to check for the presence of
the <spanx style="verb">events</spanx> claim as a means to detect
security event tokens. This is particularly useful if the same endpoint
may receive both types of tokens.
</t>
<t>
Employ explicit typing, as described in <xref target="ExplicitTyping"/>,
and modify access token validation systems to use the
<spanx style="verb">typ</spanx> header parameter value.
</t>
</list>
</t>
</section>
<section anchor="SETsAndOtherJWTs" title="Distinguishing SETs from other kinds of JWTs">
<t>
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 Parameter
to Indicate Received Realm" <xref target="RFC8055"/>
and
"Personal Assertion Token (PASSporT)" <xref target="RFC8225"/>
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.
</t>
<t>
The most direct way to prevent confusion is to
employ explicit typing, as described in <xref target="ExplicitTyping"/>,
and modify applicable token validation systems to use the
<spanx style="verb">typ</spanx> header parameter value.
This approach can be employed for new systems but may not be applicable to existing systems.
</t>
<t>
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 <spanx style="verb">events</spanx> 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.
Validating that the JWT has an <spanx style="verb">events</spanx> claim will be effective
in preventing attackers from passing other kinds of JWTs off as SETs.
</t>
<t>
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 <xref target="RFC8055"/>,
the <spanx style="verb">sip_callid</spanx> claim could be omitted
and for <xref target="RFC8225"/>,
the <spanx style="verb">orig</spanx> claim could be omitted.
</t>
<t>
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 <xref target="I-D.ietf-oauth-jwt-bcp"/>.
The proposed best practices in that draft may also be applicable
for particular SET profiles and use cases.
</t>
</section>
</section>
<section anchor="Security" title="Security Considerations" toc="default">
<section anchor="ConfidentialityIntegrity" title="Confidentiality and Integrity">
<t>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 <xref target="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 server
certificate check, per <xref target="RFC6125"/>. Implementation
security considerations for TLS can be found in "Recommendations for
Secure Use of TLS and DTLS" <xref target="RFC7525"/>.</t>
<t>Security events distributed through third parties or that carry personally
identifiable information MUST be encrypted using JWE <xref target="RFC7516"/>
or secured for confidentiality by other means.
</t>
<t>Unless integrity of the JWT is ensured by other means, it
MUST be signed using JWS <xref target="RFC7515"/>
by an issuer that is trusted to do so for the use case so
that the SET can be authenticated and validated by the
SET recipient.</t>
</section>
<section anchor="Delivery" title="Delivery">
<t>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 (mutual) TLS,
there is no assurance that the correct endpoint received the SET and
that it could be successfully processed.</t>
</section>
<section anchor="Sequencing" title="Sequencing">
<t>
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.</t>
<t>Profiling specifications and implementers SHOULD take caution when
using timestamps such as <spanx style="verb">iat</spanx> to define order. Distributed systems will have
some amount of clock skew. Thus, time by itself will not guarantee order.</t>
<t>Specifications profiling SET SHOULD define a mechanism for detecting
order or sequence of events when the order matters.
For example, the <spanx style="verb">txn</spanx>
claim could contain an ordered value (e.g., a counter) that the issuer includes,
although just as for timestamps,
ensuring such ordering can be difficult in distributed systems.
</t>
</section>
<section anchor="Timing" title="Timing Issues">