forked from demisto/content
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplaybook-Active_Directory_Test.yml
960 lines (960 loc) · 20.1 KB
/
playbook-Active_Directory_Test.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
id: Active Directory Test
version: -1
name: Active Directory Test
starttaskid: "0"
tasks:
"0":
id: "0"
taskid: ecd72042-39af-4b3c-8416-ceede1e24c5b
type: start
task:
id: ecd72042-39af-4b3c-8416-ceede1e24c5b
version: -1
name: ""
iscommand: false
brand: ""
nexttasks:
'#none#':
- "17"
separatecontext: false
view: |-
{
"position": {
"x": 265,
"y": 50
}
}
note: false
timertriggers: []
ignoreworker: false
"1":
id: "1"
taskid: d67330de-bbf2-49d5-8042-1a98eb5e4bf5
type: regular
task:
id: d67330de-bbf2-49d5-8042-1a98eb5e4bf5
version: -1
name: Add new user named jack
script: Active Directory Query v2|||ad-create-user
type: regular
iscommand: true
brand: Active Directory Query v2
nexttasks:
'#none#':
- "5"
scriptarguments:
custom-attributes: {}
description: {}
display-name:
simple: Samurai Jack
email:
simple: jack@AssasinsForRent.com
password:
simple: 1q2w3e4r!
telephone-number: {}
title: {}
user-dn:
simple: cn=jack,dc=demisto,dc=ninja
username:
simple: jack
separatecontext: false
view: |-
{
"position": {
"x": 265,
"y": 1535
}
}
note: false
timertriggers: []
ignoreworker: false
"2":
id: "2"
taskid: 09a82d62-5137-4b62-86cb-e687f7b5ae31
type: regular
task:
id: 09a82d62-5137-4b62-86cb-e687f7b5ae31
version: -1
name: Add user to group 'Users'
script: Active Directory Query v2|||ad-add-to-group
type: regular
iscommand: true
brand: ""
nexttasks:
'#none#':
- "7"
- "12"
scriptarguments:
base-dn: {}
computer-name: {}
group-cn:
simple: Users
username:
simple: Jack
separatecontext: false
view: |-
{
"position": {
"x": 265,
"y": 2380
}
}
note: false
timertriggers: []
ignoreworker: false
"4":
id: "4"
taskid: 7811ee6c-2ecb-4bd9-8d3c-b8909cb0c4fb
type: regular
task:
id: 7811ee6c-2ecb-4bd9-8d3c-b8909cb0c4fb
version: -1
name: Update the user's display name
script: Active Directory Query v2|||ad-update-contact
type: regular
iscommand: true
brand: ""
nexttasks:
'#none#':
- "2"
scriptarguments:
attribute-name:
simple: displayName
attribute-value:
simple: Jack the ripper
contact-dn:
simple: cn=Jack,dc=demisto,dc=ninja
separatecontext: false
view: |-
{
"position": {
"x": 265,
"y": 2205
}
}
note: false
timertriggers: []
ignoreworker: false
"5":
id: "5"
taskid: 03d7769d-fca0-4baa-83ff-8f8c1e03eac0
type: regular
task:
id: 03d7769d-fca0-4baa-83ff-8f8c1e03eac0
version: -1
name: Get information on the new user
script: Active Directory Query v2|||ad-get-user
type: regular
iscommand: true
brand: ""
nexttasks:
'#none#':
- "6"
- "30"
scriptarguments:
attributes: {}
custom-field-data: {}
custom-field-type: {}
dn: {}
email: {}
limit: {}
name:
simple: jack
user-account-control-out: {}
username: {}
separatecontext: false
view: |-
{
"position": {
"x": 265,
"y": 1710
}
}
note: false
timertriggers: []
ignoreworker: false
"6":
id: "6"
taskid: 22537740-e286-4644-8358-71763a4d341d
type: condition
task:
id: 22537740-e286-4644-8358-71763a4d341d
version: -1
name: Verify new user display name is as set in 'ad-create-user'
type: condition
iscommand: false
brand: ""
nexttasks:
verified:
- "10"
separatecontext: false
conditions:
- label: verified
condition:
- - operator: containsGeneral
left:
value:
simple: ActiveDirectory.Users.displayName
iscontext: true
right:
value:
simple: Samurai Jack
view: |-
{
"position": {
"x": 50,
"y": 1885
}
}
note: false
timertriggers: []
ignoreworker: false
"7":
id: "7"
taskid: 5673ff7f-3e16-4159-8c78-062b5c9a7601
type: regular
task:
id: 5673ff7f-3e16-4159-8c78-062b5c9a7601
version: -1
name: Get information on the new user
script: Active Directory Query v2|||ad-get-user
type: regular
iscommand: true
brand: ""
nexttasks:
'#none#':
- "18"
scriptarguments:
attributes: {}
custom-field-data: {}
custom-field-type: {}
dn: {}
email: {}
limit: {}
name:
simple: jack
user-account-control-out: {}
username: {}
separatecontext: false
view: |-
{
"position": {
"x": 480,
"y": 3255
}
}
note: false
timertriggers: []
ignoreworker: false
"9":
id: "9"
taskid: 12f4f7c0-6ea9-4f0f-85b7-42f891fc2921
type: title
task:
id: 12f4f7c0-6ea9-4f0f-85b7-42f891fc2921
version: -1
name: Create a new Active Directory user
type: title
iscommand: false
brand: ""
nexttasks:
'#none#':
- "1"
separatecontext: false
view: |-
{
"position": {
"x": 265,
"y": 1390
}
}
note: false
timertriggers: []
ignoreworker: false
"10":
id: "10"
taskid: 867783e2-f57a-4cfc-8da0-ff6695918877
type: title
task:
id: 867783e2-f57a-4cfc-8da0-ff6695918877
version: -1
name: Modify user attributes
type: title
iscommand: false
brand: ""
nexttasks:
'#none#':
- "4"
separatecontext: false
view: |-
{
"position": {
"x": 265,
"y": 2060
}
}
note: false
timertriggers: []
ignoreworker: false
"12":
id: "12"
taskid: b9a64b40-3cf5-4d1b-86c9-5a3ad9e0108e
type: regular
task:
id: b9a64b40-3cf5-4d1b-86c9-5a3ad9e0108e
version: -1
name: Get group 'Users' members
script: Active Directory Query v2|||ad-get-group-members
type: regular
iscommand: true
brand: ""
nexttasks:
'#none#':
- "13"
scriptarguments:
attributes: {}
group-dn:
simple: CN=Users,CN=Builtin,DC=demisto,DC=ninja
member-type:
simple: person
separatecontext: false
view: |-
{
"position": {
"x": 50,
"y": 2555
}
}
note: false
timertriggers: []
ignoreworker: false
"13":
id: "13"
taskid: 85dd1769-60a3-49bf-867c-842fc72c73a0
type: condition
task:
id: 85dd1769-60a3-49bf-867c-842fc72c73a0
version: -1
name: Verify 'jack' is listed as a member
type: condition
iscommand: false
brand: ""
nexttasks:
verified:
- "14"
separatecontext: false
conditions:
- label: verified
condition:
- - operator: isExists
left:
value:
complex:
root: ActiveDirectory
filters:
- - operator: isEqualString
left:
value:
simple: ActiveDirectory.Groups.members.dn
iscontext: true
right:
value:
simple: CN=jack,DC=demisto,DC=ninja
accessor: Groups.members.dn
iscontext: true
view: |-
{
"position": {
"x": 50,
"y": 2730
}
}
note: false
timertriggers: []
ignoreworker: false
"14":
id: "14"
taskid: 6889b59c-bdf3-46d8-871e-8c79875ccf31
type: regular
task:
id: 6889b59c-bdf3-46d8-871e-8c79875ccf31
version: -1
name: Remove jack from 'Users' group
script: Active Directory Query v2|||ad-remove-from-group
type: regular
iscommand: true
brand: ""
nexttasks:
'#none#':
- "19"
scriptarguments:
base-dn: {}
computer-name: {}
group-cn:
simple: Users
username:
simple: jack
separatecontext: false
view: |-
{
"position": {
"x": 50,
"y": 2905
}
}
note: false
timertriggers: []
ignoreworker: false
"15":
id: "15"
taskid: 762f7a76-be77-4289-8865-c3319c20acab
type: condition
task:
id: 762f7a76-be77-4289-8865-c3319c20acab
version: -1
name: Verify 'jack' is not listed as a member
type: condition
iscommand: false
brand: ""
nexttasks:
verified:
- "21"
separatecontext: false
conditions:
- label: verified
condition:
- - operator: isNotExists
left:
value:
complex:
root: ActiveDirectory
filters:
- - operator: isEqualString
left:
value:
simple: ActiveDirectory.Groups.members.dn
iscontext: true
right:
value:
simple: CN=jack,DC=demisto,DC=int
accessor: Groups.members.dn
iscontext: true
view: |-
{
"position": {
"x": 50,
"y": 3430
}
}
note: false
timertriggers: []
ignoreworker: false
"16":
id: "16"
taskid: aa655544-be04-4df6-8217-3e5455ffeb34
type: regular
task:
id: aa655544-be04-4df6-8217-3e5455ffeb34
version: -1
name: Delete jack
script: Active Directory Query v2|||ad-delete-user
type: regular
iscommand: true
brand: ""
scriptarguments:
user-dn:
simple: cn=jack,dc=demisto,dc=ninja
separatecontext: false
view: |-
{
"position": {
"x": 265,
"y": 4100
}
}
note: false
timertriggers: []
ignoreworker: false
"17":
id: "17"
taskid: 3218335d-5e71-48bb-8857-de9b344f31f8
type: regular
task:
id: 3218335d-5e71-48bb-8857-de9b344f31f8
version: -1
name: Delete all context
scriptName: DeleteContext
type: regular
iscommand: false
brand: ""
nexttasks:
'#none#':
- "25"
scriptarguments:
all:
simple: "yes"
index: {}
key: {}
keysToKeep: {}
subplaybook: {}
separatecontext: false
view: |-
{
"position": {
"x": 265,
"y": 195
}
}
note: false
timertriggers: []
ignoreworker: false
"18":
id: "18"
taskid: 1647de07-83aa-46b8-83f9-f262fe27fdb5
type: condition
task:
id: 1647de07-83aa-46b8-83f9-f262fe27fdb5
version: -1
name: Verify the user diaplay name was updated
type: condition
iscommand: false
brand: ""
nexttasks:
verified:
- "21"
separatecontext: false
conditions:
- label: verified
condition:
- - operator: containsGeneral
left:
value:
simple: ActiveDirectory.Users.displayName
iscontext: true
right:
value:
simple: Jack the ripper
view: |-
{
"position": {
"x": 480,
"y": 3430
}
}
note: false
timertriggers: []
ignoreworker: false
"19":
id: "19"
taskid: c67cf231-ae87-410b-8b8d-0ff04ab7c493
type: regular
task:
id: c67cf231-ae87-410b-8b8d-0ff04ab7c493
version: -1
name: Delete 'Groups' context
scriptName: DeleteContext
type: regular
iscommand: false
brand: ""
nexttasks:
'#none#':
- "20"
scriptarguments:
all: {}
index: {}
key:
simple: ActiveDirectory.Groups
keysToKeep: {}
subplaybook: {}
separatecontext: false
view: |-
{
"position": {
"x": 50,
"y": 3080
}
}
note: false
timertriggers: []
ignoreworker: false
"20":
id: "20"
taskid: 9068310f-5ecc-46a3-8b0b-a9f4275e6c3e
type: regular
task:
id: 9068310f-5ecc-46a3-8b0b-a9f4275e6c3e
version: -1
name: Get group 'Users' members
script: Active Directory Query v2|||ad-get-group-members
type: regular
iscommand: true
brand: ""
nexttasks:
'#none#':
- "15"
scriptarguments:
attributes: {}
group-dn:
simple: CN=Users,CN=Builtin,DC=demisto,DC=ninja
member-type:
simple: person
separatecontext: false
view: |-
{
"position": {
"x": 50,
"y": 3255
}
}
note: false
timertriggers: []
ignoreworker: false
"21":
id: "21"
taskid: 4d856a89-4d10-4860-833d-d31eeea22f9b
type: title
task:
id: 4d856a89-4d10-4860-833d-d31eeea22f9b
version: -1
name: Test enable\disable user account - tests for command success only
type: title
iscommand: false
brand: ""
nexttasks:
'#none#':
- "22"
separatecontext: false
view: |-
{
"position": {
"x": 265,
"y": 3605
}
}
note: false
timertriggers: []
ignoreworker: false
"22":
id: "22"
taskid: 7cf6d78f-a794-42da-8dbb-04041f3cb33d
type: regular
task:
id: 7cf6d78f-a794-42da-8dbb-04041f3cb33d
version: -1
name: Disable new user account
script: Active Directory Query v2|||ad-disable-account
type: regular
iscommand: true
brand: ""
nexttasks:
'#none#':
- "23"
scriptarguments:
base-dn: {}
username:
simple: jack
separatecontext: false
view: |-
{
"position": {
"x": 265,
"y": 3750
}
}
note: false
timertriggers: []
ignoreworker: false
"23":
id: "23"
taskid: 2d9139b1-7c8c-4bba-8f52-aac18b27429e
type: regular
task:
id: 2d9139b1-7c8c-4bba-8f52-aac18b27429e
version: -1
name: Enable account
script: Active Directory Query v2|||ad-enable-account
type: regular
iscommand: true
brand: ""
nexttasks:
'#none#':
- "16"
scriptarguments:
base-dn: {}
username:
simple: jack
separatecontext: false
view: |-
{
"position": {
"x": 265,
"y": 3925
}
}
note: false
timertriggers: []
ignoreworker: false
"24":
id: "24"
taskid: 995abc7a-e471-4b52-84b5-3b8fc3af6f43
type: regular
task:
id: 995abc7a-e471-4b52-84b5-3b8fc3af6f43
version: -1
name: Run search command
script: '|||ad-search'
type: regular
iscommand: true
brand: ""
nexttasks:
'#none#':
- "26"
scriptarguments:
attributes: {}
base-dn: {}
context-ouptut: {}
context-output: {}
filter:
simple: (&(objectCategory=person)(objectClass=user)(!(cn=andy)))
size-limit:
simple: "603"
time-limit: {}
separatecontext: false
view: |-
{
"position": {
"x": 265,
"y": 515
}
}
note: false
timertriggers: []
ignoreworker: false
"25":
id: "25"
taskid: 04dfe38a-2cf8-40f3-83ad-858845e4e36f
type: title
task:
id: 04dfe38a-2cf8-40f3-83ad-858845e4e36f
version: -1
name: Search in Active Directory
type: title
iscommand: false
brand: ""
nexttasks:
'#none#':
- "24"
separatecontext: false
view: |-
{
"position": {
"x": 265,
"y": 370
}
}
note: false
timertriggers: []
ignoreworker: false
"26":
id: "26"
taskid: 0eeb0b05-42f2-4e12-8e63-5f1e1a2e23f9
type: condition
task:
id: 0eeb0b05-42f2-4e12-8e63-5f1e1a2e23f9
version: -1
name: Verify results from search exist
type: condition
iscommand: false
brand: ""
nexttasks:
"yes":
- "28"
separatecontext: false
conditions:
- label: "yes"
condition:
- - operator: isExists
left:
value:
complex:
root: ActiveDirectory
accessor: Search
iscontext: true
view: |-
{
"position": {
"x": 265,
"y": 690
}
}
note: false
timertriggers: []
ignoreworker: false
"27":
id: "27"
taskid: d0468bfd-6702-4073-8754-2923418755f9
type: regular
task:
id: d0468bfd-6702-4073-8754-2923418755f9
version: -1
name: Run search command with no output
script: '|||ad-search'
type: regular
iscommand: true
brand: ""
nexttasks:
'#none#':
- "29"
scriptarguments:
attributes: {}
base-dn: {}
context-ouptut:
simple: "no"
context-output:
simple: "no"
filter:
simple: (&(objectCategory=person)(objectClass=user)(cn=jack))
size-limit:
simple: "5"
time-limit: {}
separatecontext: false
view: |-
{
"position": {
"x": 265,
"y": 1040
}
}
note: false
timertriggers: []
ignoreworker: false
"28":
id: "28"
taskid: 0fd6966d-b52b-4e51-87d4-41a5a33f1008
type: regular
task:
id: 0fd6966d-b52b-4e51-87d4-41a5a33f1008
version: -1
name: Delete all context
scriptName: DeleteContext
type: regular
iscommand: false
brand: ""
nexttasks:
'#none#':
- "27"
scriptarguments:
all:
simple: "yes"
index: {}
key: {}
keysToKeep: {}
subplaybook: {}
separatecontext: false
view: |-
{
"position": {
"x": 265,
"y": 865
}
}
note: false
timertriggers: []
ignoreworker: false
"29":
id: "29"
taskid: 925d0184-48de-4c55-8771-d1ce8d3c9897
type: condition
task:
id: 925d0184-48de-4c55-8771-d1ce8d3c9897
version: -1
name: Verify results from search don't exist
type: condition
iscommand: false
brand: ""
nexttasks:
"yes":
- "9"
separatecontext: false
conditions:
- label: "yes"
condition:
- - operator: isNotExists
left:
value:
complex:
root: ActiveDirectory
accessor: Search
iscontext: true
view: |-
{
"position": {
"x": 265,
"y": 1215
}
}
note: false
timertriggers: []
ignoreworker: false
"30":
id: "30"
taskid: b83519cb-70ad-4ba1-830d-32431b71aa41
type: condition
task:
id: b83519cb-70ad-4ba1-830d-32431b71aa41
version: -1
name: Make sure user email shows in context
description: |-
Make sure user email appears in context under paths:
- ActiveDirectory.Users.mail
- Accounts.Email
type: condition
iscommand: false
brand: ""
nexttasks:
verified:
- "10"
separatecontext: false
conditions:
- label: verified
condition:
- - operator: isEqualString
left:
value:
simple: Account.Email
iscontext: true
right:
value:
simple: jack@AssasinsForRent.com
- - operator: isEqualString
left:
value:
simple: ActiveDirectory.Users.mail
iscontext: true
right:
value:
simple: jack@AssasinsForRent.com
view: |-
{
"position": {
"x": 480,
"y": 1885
}
}
note: false
timertriggers: []
ignoreworker: false
view: |-
{
"linkLabelsPosition": {},
"paper": {
"dimensions": {
"height": 4145,
"width": 810,
"x": 50,
"y": 50
}
}
}
inputs: []
outputs: []