forked from demisto/content
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplaybook-DuoAdminaAPITest.yml
971 lines (971 loc) · 21.4 KB
/
playbook-DuoAdminaAPITest.yml
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
id: DuoAdmin API test playbook
version: -1
name: DuoAdmin API test playbook
starttaskid: "0"
tasks:
"0":
id: "0"
taskid: 8e16b379-cb61-4031-8228-94da2c3c1e80
type: start
task:
id: 8e16b379-cb61-4031-8228-94da2c3c1e80
version: -1
name: ""
iscommand: false
brand: ""
nexttasks:
'#none#':
- "13"
separatecontext: false
view: |-
{
"position": {
"x": 450,
"y": -160
}
}
note: false
timertriggers: []
ignoreworker: false
"1":
id: "1"
taskid: e6d73b39-e595-44e9-857b-8d44e6c48354
type: regular
task:
id: e6d73b39-e595-44e9-857b-8d44e6c48354
version: -1
name: Get Users Detail
script: '|||duoadmin-get-users'
type: regular
iscommand: true
brand: ""
nexttasks:
'#none#':
- "16"
- "17"
- "19"
- "30"
separatecontext: false
view: |-
{
"position": {
"x": 450,
"y": 120
}
}
note: false
timertriggers: []
ignoreworker: false
"3":
id: "3"
taskid: 7ed5425d-04fa-48a9-8785-7337a94c3e7a
type: regular
task:
id: 7ed5425d-04fa-48a9-8785-7337a94c3e7a
version: -1
name: Get User2 Logs
script: '|||duoadmin-get-authentication-logs-by-user'
type: regular
iscommand: true
brand: ""
nexttasks:
'#none#':
- "15"
scriptarguments:
from:
simple: 10_years_ago
limit: {}
username:
simple: ${DuoAdmin.UserDetails.[2].username}
separatecontext: false
view: |-
{
"position": {
"x": 970,
"y": 470
}
}
note: false
timertriggers: []
ignoreworker: false
"9":
id: "9"
taskid: 26dcdc13-0858-4d4d-8f85-a909410cfd0f
type: title
task:
id: 26dcdc13-0858-4d4d-8f85-a909410cfd0f
version: -1
name: Check if two different users have different auth logs
type: title
iscommand: false
brand: ""
nexttasks:
'#none#':
- "40"
separatecontext: false
view: |-
{
"position": {
"x": 450,
"y": 1500
}
}
note: false
timertriggers: []
ignoreworker: false
"13":
id: "13"
taskid: d23c0bac-e60f-4314-8217-09d5c2de460b
type: regular
task:
id: d23c0bac-e60f-4314-8217-09d5c2de460b
version: -1
name: Delete Context
scriptName: DeleteContext
type: regular
iscommand: false
brand: ""
nexttasks:
'#none#':
- "1"
scriptarguments:
all:
simple: "yes"
index: {}
key: {}
keysToKeep: {}
subplaybook: {}
separatecontext: false
view: |-
{
"position": {
"x": 450,
"y": -40
}
}
note: false
timertriggers: []
ignoreworker: false
"15":
id: "15"
taskid: 37576cdb-912a-41f6-8bb8-0416199da432
type: condition
task:
id: 37576cdb-912a-41f6-8bb8-0416199da432
version: -1
name: Are auth logs a part of user details?
type: condition
iscommand: false
brand: ""
nexttasks:
"yes":
- "9"
separatecontext: false
conditions:
- label: "yes"
condition:
- - operator: isExists
left:
value:
complex:
root: DuoAdmin
accessor: UserDetails.[2].auth_logs
iscontext: true
view: |-
{
"position": {
"x": 970,
"y": 910
}
}
note: false
timertriggers: []
ignoreworker: false
"16":
id: "16"
taskid: 7509e240-1086-4f3f-820f-a3e67f25c55a
type: title
task:
id: 7509e240-1086-4f3f-820f-a3e67f25c55a
version: -1
name: User Devices Operations
type: title
iscommand: false
brand: ""
nexttasks:
'#none#':
- "36"
separatecontext: false
view: |-
{
"position": {
"x": -100,
"y": 315
}
}
note: false
timertriggers: []
ignoreworker: false
"17":
id: "17"
taskid: fae485d6-5428-4224-848c-0ad7fe3dd3d4
type: title
task:
id: fae485d6-5428-4224-848c-0ad7fe3dd3d4
version: -1
name: User Logs
type: title
iscommand: false
brand: ""
nexttasks:
'#none#':
- "3"
separatecontext: false
view: |-
{
"position": {
"x": 970,
"y": 315
}
}
note: false
timertriggers: []
ignoreworker: false
"19":
id: "19"
taskid: 9ca2449b-24e4-4d1d-839b-8016aacc3af5
type: title
task:
id: 9ca2449b-24e4-4d1d-839b-8016aacc3af5
version: -1
name: Devices
type: title
iscommand: false
brand: ""
nexttasks:
'#none#':
- "20"
separatecontext: false
view: |-
{
"position": {
"x": 450,
"y": 315
}
}
note: false
timertriggers: []
ignoreworker: false
"20":
id: "20"
taskid: cf5efc6f-123e-493f-8ab0-13847fc24676
type: regular
task:
id: cf5efc6f-123e-493f-8ab0-13847fc24676
version: -1
name: Get All Devices
script: '|||duoadmin-get-devices'
type: regular
iscommand: true
brand: ""
nexttasks:
'#none#':
- "21"
separatecontext: false
view: |-
{
"position": {
"x": 450,
"y": 470
}
}
note: false
timertriggers: []
ignoreworker: false
"21":
id: "21"
taskid: 013c40e8-5522-4dde-8751-e68c34dd27e0
type: condition
task:
id: 013c40e8-5522-4dde-8751-e68c34dd27e0
version: -1
name: Are phones a part of the DuoAdmin object?
type: condition
iscommand: false
brand: ""
nexttasks:
"yes":
- "9"
separatecontext: false
conditions:
- label: "yes"
condition:
- - operator: isExists
left:
value:
complex:
root: DuoAdmin
accessor: Phones.phone_id
iscontext: true
- - operator: isExists
left:
value:
complex:
root: DuoAdmin
accessor: Phones.number
iscontext: true
- - operator: isExists
left:
value:
simple: DuoAdmin.Phones.platform
iscontext: true
- - operator: isExists
left:
value:
simple: DuoAdmin.Phones.last_seen
iscontext: true
view: |-
{
"position": {
"x": 450,
"y": 920
}
}
note: false
timertriggers: []
ignoreworker: false
"23":
id: "23"
taskid: d21d1b45-1728-47a6-8c00-05b0dd65e63c
type: regular
task:
id: d21d1b45-1728-47a6-8c00-05b0dd65e63c
version: -1
name: Get User Phones
script: '|||duoadmin-get-devices-by-user'
type: regular
iscommand: true
brand: ""
nexttasks:
'#none#':
- "24"
scriptarguments:
username:
simple: winitzky
separatecontext: false
view: |-
{
"position": {
"x": -100,
"y": 635
}
}
note: false
timertriggers: []
ignoreworker: false
"24":
id: "24"
taskid: 3c21a874-4644-4d8e-8201-4c136bd5d58b
type: condition
task:
id: 3c21a874-4644-4d8e-8201-4c136bd5d58b
version: -1
name: Does the user have a phone?
type: condition
iscommand: false
brand: ""
nexttasks:
"yes":
- "28"
separatecontext: false
conditions:
- label: "yes"
condition:
- - operator: isExists
left:
value:
complex:
root: DuoAdmin
accessor: UserDetails
transformers:
- operator: WhereFieldEquals
args:
equalTo:
value:
simple: winitzky
field:
value:
simple: username
getField: {}
- operator: getField
args:
field:
value:
simple: phones
- operator: atIndex
args:
index:
value:
simple: "0"
iscontext: true
view: |-
{
"position": {
"x": -100,
"y": 800
}
}
note: false
timertriggers: []
ignoreworker: false
"27":
id: "27"
taskid: 4ff8939c-5e45-4426-8b8d-25183b980fa2
type: regular
task:
id: 4ff8939c-5e45-4426-8b8d-25183b980fa2
version: -1
name: Get User Phones
script: '|||duoadmin-get-devices-by-user'
type: regular
iscommand: true
brand: ""
nexttasks:
'#none#':
- "29"
scriptarguments:
username:
simple: winitzky
separatecontext: false
view: |-
{
"position": {
"x": -100,
"y": 1140
}
}
note: false
timertriggers: []
ignoreworker: false
"28":
id: "28"
taskid: 6c7cf726-e235-4dae-8d13-b9182c13b9f1
type: regular
task:
id: 6c7cf726-e235-4dae-8d13-b9182c13b9f1
version: -1
name: Dissociate the phone from the user
script: '|||duoadmin-dissociate-device-from-user'
type: regular
iscommand: true
brand: ""
nexttasks:
'#none#':
- "27"
scriptarguments:
device_id:
simple: DPQ5YSXIRTLG4QO561J9
username:
simple: winitzky
separatecontext: false
view: |-
{
"position": {
"x": -100,
"y": 980
}
}
note: false
timertriggers: []
ignoreworker: false
"29":
id: "29"
taskid: 00aeed1b-e5f3-4ae4-840e-e82442ff4157
type: condition
task:
id: 00aeed1b-e5f3-4ae4-840e-e82442ff4157
version: -1
name: Does the user still has a phone?
type: condition
iscommand: false
brand: ""
nexttasks:
"no":
- "9"
separatecontext: false
conditions:
- label: "no"
condition:
- - operator: isNotExists
left:
value:
complex:
root: DuoAdmin
accessor: UserDetails
transformers:
- operator: WhereFieldEquals
args:
equalTo:
value:
simple: winitzky
field:
value:
simple: username
getField: {}
- operator: getField
args:
field:
value:
simple: phones
- operator: atIndex
args:
index:
value:
simple: "0"
iscontext: true
view: |-
{
"position": {
"x": -100,
"y": 1330
}
}
note: false
timertriggers: []
ignoreworker: false
"30":
id: "30"
taskid: cd37b4f8-654d-4c1b-86ad-4201abe4ea6d
type: title
task:
id: cd37b4f8-654d-4c1b-86ad-4201abe4ea6d
version: -1
name: U2F Tokens
type: title
iscommand: false
brand: ""
nexttasks:
'#none#':
- "31"
separatecontext: false
view: |-
{
"position": {
"x": 1410,
"y": 315
}
}
note: false
timertriggers: []
ignoreworker: false
"31":
id: "31"
taskid: b44b8cd7-b424-44e9-8960-1b64cdfe8a3d
type: regular
task:
id: b44b8cd7-b424-44e9-8960-1b64cdfe8a3d
version: -1
name: Get User Tokens
description: |-
Notice that for the test to actually test something the user has to have a token assigned to it.
To create a "dummy token" (for tests and such) use SOFTU2F with the duo admin site (available at https://github.com/github/SoftU2F).
You might have to kill it's process a few times and press "approve" for it to work (about 4 or 5 times)
script: '|||duoadmin-get-u2f-tokens-by-user'
type: regular
iscommand: true
brand: ""
nexttasks:
'#none#':
- "32"
scriptarguments:
username:
simple: winitzky
separatecontext: false
view: |-
{
"position": {
"x": 1410,
"y": 470
}
}
note: false
timertriggers: []
ignoreworker: false
"32":
id: "32"
taskid: 6d98f7a5-f2c2-4225-8ec3-9c5d14bd5d4b
type: condition
task:
id: 6d98f7a5-f2c2-4225-8ec3-9c5d14bd5d4b
version: -1
name: Does the user have a U2F token?
type: condition
iscommand: false
brand: ""
nexttasks:
'#default#':
- "9"
"yes":
- "33"
separatecontext: false
conditions:
- label: "yes"
condition:
- - operator: isExists
left:
value:
complex:
root: DuoAdmin
accessor: UserDetails
transformers:
- operator: WhereFieldEquals
args:
equalTo:
value:
simple: winitzky
field:
value:
simple: username
getField: {}
- operator: getField
args:
field:
value:
simple: u2ftokens
- operator: atIndex
args:
index:
value:
simple: "0"
iscontext: true
view: |-
{
"position": {
"x": 1410,
"y": 635
}
}
note: false
timertriggers: []
ignoreworker: false
"33":
id: "33"
taskid: 3be53fa9-8801-40d8-860a-7e9e8cb3c6e2
type: regular
task:
id: 3be53fa9-8801-40d8-860a-7e9e8cb3c6e2
version: -1
name: Delete the token
script: '|||duoadmin-delete-u2f-token'
type: regular
iscommand: true
brand: ""
nexttasks:
'#none#':
- "35"
scriptarguments:
token_id:
complex:
root: DuoAdmin
accessor: UserDetails
transformers:
- operator: WhereFieldEquals
args:
equalTo:
value:
simple: winitzky
field:
value:
simple: username
getField: {}
- operator: getField
args:
field:
value:
simple: u2ftokens
- operator: atIndex
args:
index:
value:
simple: "0"
- operator: getField
args:
field:
value:
simple: registration_id
separatecontext: false
view: |-
{
"position": {
"x": 1410,
"y": 860
}
}
note: false
timertriggers: []
ignoreworker: false
"34":
id: "34"
taskid: 01258beb-207d-499e-8dff-3c952959a5aa
type: condition
task:
id: 01258beb-207d-499e-8dff-3c952959a5aa
version: -1
name: Does the user still have a token
type: condition
iscommand: false
brand: ""
nexttasks:
"no":
- "9"
separatecontext: false
conditions:
- label: "no"
condition:
- - operator: isNotExists
left:
value:
complex:
root: DuoAdmin
accessor: UserDetails
transformers:
- operator: WhereFieldEquals
args:
equalTo:
value:
simple: winitzky
field:
value:
simple: username
getField: {}
- operator: getField
args:
field:
value:
simple: u2ftokens
- operator: atIndex
args:
index:
value:
simple: "0"
iscontext: true
view: |-
{
"position": {
"x": 1410,
"y": 1235
}
}
note: false
timertriggers: []
ignoreworker: false
"35":
id: "35"
taskid: ac577d09-66b9-4521-8e47-cdf21e5cbd9e
type: regular
task:
id: ac577d09-66b9-4521-8e47-cdf21e5cbd9e
version: -1
name: Get User Tokens
description: |-
Notice that for the test to actually test something the user has to have a token assigned to it.
To create a "dummy token" (for tests and such) use SOFTU2F with the duo admin site (available at https://github.com/github/SoftU2F).
You might have to kill it's process a few times and press "approve" for it to work (about 4 or 5 times)
script: '|||duoadmin-get-u2f-tokens-by-user'
type: regular
iscommand: true
brand: ""
nexttasks:
'#none#':
- "34"
scriptarguments:
username:
simple: winitzky
separatecontext: false
view: |-
{
"position": {
"x": 1410,
"y": 1055
}
}
note: false
timertriggers: []
ignoreworker: false
"36":
id: "36"
taskid: c046658c-d2df-4350-8b64-4c69a3c1bcd0
type: regular
task:
id: c046658c-d2df-4350-8b64-4c69a3c1bcd0
version: -1
name: Associate a dummy phone
script: '|||duoadmin-associate-device-to-user'
type: regular
iscommand: true
brand: ""
nexttasks:
'#none#':
- "23"
scriptarguments:
device_id:
simple: DPQ5YSXIRTLG4QO561J9
username:
simple: winitzky
separatecontext: false
view: |-
{
"position": {
"x": -100,
"y": 470
}
}
note: false
timertriggers: []
ignoreworker: false
"40":
id: "40"
taskid: 9efcf80c-6ec7-4c27-83a3-16735e0eb8ad
type: regular
task:
id: 9efcf80c-6ec7-4c27-83a3-16735e0eb8ad
version: -1
name: Get User0 Logs
description: Returns authentication logs associated with a user. Limited to
30 at a time
script: DUO Admin|||duoadmin-get-authentication-logs-by-user
type: regular
iscommand: true
brand: DUO Admin
nexttasks:
'#none#':
- "45"
scriptarguments:
from:
simple: 5_years_ago
limit: {}
username:
simple: ${DuoAdmin.UserDetails.[0].username}
reputationcalc: 1
separatecontext: false
view: |-
{
"position": {
"x": 450,
"y": 1650
}
}
note: false
timertriggers: []
ignoreworker: false
"43":
id: "43"
taskid: f5ae69a7-0a39-484d-8eb4-8c68eed25435
type: title
task:
id: f5ae69a7-0a39-484d-8eb4-8c68eed25435
version: -1
name: done
type: title
iscommand: false
brand: ""
separatecontext: false
view: |-
{
"position": {
"x": 450,
"y": 2030
}
}
note: false
timertriggers: []
ignoreworker: false
"45":
id: "45"
taskid: 6d2ab6bd-cf01-47b6-87ba-a640566d8e58
type: condition
task:
id: 6d2ab6bd-cf01-47b6-87ba-a640566d8e58
version: -1
name: Check if User0 doesn't exist and User2 does exist
type: condition
iscommand: false
brand: ""
nexttasks:
'#default#':
- "46"
"yes":
- "43"
separatecontext: false
conditions:
- label: "yes"
condition:
- - operator: isEmpty
left:
value:
complex:
root: DuoAdmin
accessor: UserDetails.[0].auth_logs
iscontext: true
- - operator: isNotEmpty
left:
value:
complex:
root: DuoAdmin
accessor: UserDetails.[2].auth_logs
iscontext: true
view: |-
{
"position": {
"x": 450,
"y": 1830
}
}
note: false
timertriggers: []
ignoreworker: false
"46":
id: "46"
taskid: 09668ea7-38b0-4527-8ca9-8ad7a2fd04d7
type: regular
task:
id: 09668ea7-38b0-4527-8ca9-8ad7a2fd04d7
version: -1
name: Print Error in case of two users have the same auth logs
description: Prints an error entry with a given message
scriptName: PrintErrorEntry
type: regular
iscommand: false
brand: ""
nexttasks:
'#none#':
- "43"
scriptarguments:
message:
simple: There are two users with the same logs. The bug haven't been fixed
(issue 19141).
separatecontext: false
view: |-
{
"position": {
"x": 940,
"y": 1920
}
}
note: false
timertriggers: []
ignoreworker: false
view: |-
{
"linkLabelsPosition": {},
"paper": {
"dimensions": {
"height": 2255,
"width": 1890,
"x": -100,
"y": -160
}
}
}
inputs: []
outputs: []