forked from demisto/content
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplaybook-Fortigate_Test.yml
1215 lines (1215 loc) · 25.5 KB
/
playbook-Fortigate_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
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
id: Fortigate Test
version: -1
name: Fortigate Test
starttaskid: "0"
tasks:
"0":
id: "0"
taskid: 12d204b1-baaf-4a20-8287-86a4c64face3
type: start
task:
id: 12d204b1-baaf-4a20-8287-86a4c64face3
version: -1
name: ""
iscommand: false
brand: ""
nexttasks:
'#none#':
- "18"
separatecontext: false
view: |-
{
"position": {
"x": 50,
"y": 50
}
}
note: false
"1":
id: "1"
taskid: 26dac48e-6315-4ea9-84b9-6fddf1e98411
type: regular
task:
id: 26dac48e-6315-4ea9-84b9-6fddf1e98411
version: -1
name: fortigate-get-addresses
script: '|||fortigate-get-addresses'
type: regular
iscommand: true
brand: ""
nexttasks:
'#none#':
- "19"
scriptarguments:
address: {}
name: {}
separatecontext: false
view: |-
{
"position": {
"x": 50,
"y": 370
}
}
note: false
"2":
id: "2"
taskid: 65b28155-589c-4217-850a-9e6007731b18
type: regular
task:
id: 65b28155-589c-4217-850a-9e6007731b18
version: -1
name: fortigate-get-service-groups
script: '|||fortigate-get-service-groups'
type: regular
iscommand: true
brand: ""
nexttasks:
'#none#':
- "20"
scriptarguments:
name: {}
separatecontext: false
view: |-
{
"position": {
"x": 50,
"y": 720
}
}
note: false
"3":
id: "3"
taskid: b73137cf-2849-4592-860c-3d09118a7775
type: regular
task:
id: b73137cf-2849-4592-860c-3d09118a7775
version: -1
name: fortigate-update-service-group ADD
script: '|||fortigate-update-service-group'
type: regular
iscommand: true
brand: ""
nexttasks:
'#none#':
- "21"
scriptarguments:
action:
simple: add
groupName:
simple: Maya
serviceName:
simple: HTTPS
separatecontext: false
view: |-
{
"position": {
"x": 50,
"y": 1070
}
}
note: false
"4":
id: "4"
taskid: 26d35ac4-a4c4-415b-8788-eb140bd1ac6f
type: regular
task:
id: 26d35ac4-a4c4-415b-8788-eb140bd1ac6f
version: -1
name: fortigate-update-service-group REMOVE
script: '|||fortigate-update-service-group'
type: regular
iscommand: true
brand: ""
nexttasks:
'#none#':
- "22"
scriptarguments:
action:
simple: remove
groupName:
simple: Maya
serviceName:
simple: HTTPS
separatecontext: false
view: |-
{
"position": {
"x": 50,
"y": 1420
}
}
note: false
"5":
id: "5"
taskid: 18c289cf-24d7-4594-8b13-c055bfe5a7b9
type: regular
task:
id: 18c289cf-24d7-4594-8b13-c055bfe5a7b9
version: -1
name: fortigate-get-firewall-service
script: '|||fortigate-get-firewall-service'
type: regular
iscommand: true
brand: ""
nexttasks:
'#none#':
- "23"
scriptarguments:
serviceName: {}
separatecontext: false
view: |-
{
"position": {
"x": 50,
"y": 1770
}
}
note: false
"6":
id: "6"
taskid: ee4e5228-5a13-4233-8113-45bce2cf36a5
type: regular
task:
id: ee4e5228-5a13-4233-8113-45bce2cf36a5
version: -1
name: fortigate-create-firewall-service
script: '|||fortigate-create-firewall-service'
type: regular
iscommand: true
brand: ""
nexttasks:
'#none#':
- "24"
scriptarguments:
serviceName:
complex:
root: incident
accessor: occurred
transformers:
- operator: toUnix
- operator: concat
args:
prefix:
value:
simple: SERVICE
suffix: {}
tcpRange:
simple: "1"
udpRange:
simple: "2"
separatecontext: false
view: |-
{
"position": {
"x": 50,
"y": 2120
}
}
note: false
"7":
id: "7"
taskid: 600b4f04-1645-4369-8d45-a408cf3c01c5
type: regular
task:
id: 600b4f04-1645-4369-8d45-a408cf3c01c5
version: -1
name: fortigate-get-policy
script: '|||fortigate-get-policy'
type: regular
iscommand: true
brand: ""
nexttasks:
'#none#':
- "25"
scriptarguments:
policyID: {}
policyName: {}
separatecontext: false
view: |-
{
"position": {
"x": 50,
"y": 2470
}
}
note: false
"8":
id: "8"
taskid: 10cff81c-62cd-45f7-8a88-3b46fe9f9d36
type: regular
task:
id: 10cff81c-62cd-45f7-8a88-3b46fe9f9d36
version: -1
name: fortigate-update-policy
script: '|||fortigate-update-policy'
type: regular
iscommand: true
brand: ""
nexttasks:
'#none#':
- "26"
scriptarguments:
field:
simple: description
policyID:
simple: "6"
value:
simple: TEST DEMISTO
separatecontext: false
view: |-
{
"position": {
"x": 50,
"y": 2820
}
}
note: false
"9":
id: "9"
taskid: 6b1a8476-f5a7-4fa8-83e1-59ab91b3de32
type: regular
task:
id: 6b1a8476-f5a7-4fa8-83e1-59ab91b3de32
version: -1
name: fortigate-create-policy
script: '|||fortigate-create-policy'
type: regular
iscommand: true
brand: ""
nexttasks:
'#none#':
- "27"
scriptarguments:
action:
simple: accept
description:
simple: TEST DEMISTO
destination:
simple: all
dstIntf:
simple: port2
log:
simple: disable
nat:
simple: disable
policyName:
complex:
root: incident
accessor: occurred
transformers:
- operator: toUnix
- operator: concat
args:
prefix:
value:
simple: POLICY
suffix: {}
service:
simple: HTTP
source:
simple: all
sourceIntf:
simple: port2
status:
simple: enable
separatecontext: false
view: |-
{
"position": {
"x": 50,
"y": 3170
}
}
note: false
"10":
id: "10"
taskid: 01879da4-0b64-477e-800a-4ad969db97a5
type: regular
task:
id: 01879da4-0b64-477e-800a-4ad969db97a5
version: -1
name: fortigate-move-policy
script: '|||fortigate-move-policy'
type: regular
iscommand: true
brand: ""
nexttasks:
'#none#':
- "28"
scriptarguments:
neighbor:
simple: "35"
policyID:
simple: "34"
position:
simple: after
separatecontext: false
view: |-
{
"position": {
"x": 50,
"y": 3520
}
}
note: false
"11":
id: "11"
taskid: 588f330a-fc24-4dad-829a-ca91443b7b56
type: regular
task:
id: 588f330a-fc24-4dad-829a-ca91443b7b56
version: -1
name: fortigate-delete-policy
script: '|||fortigate-delete-policy'
type: regular
iscommand: true
brand: ""
nexttasks:
'#none#':
- "29"
scriptarguments:
policyID:
complex:
root: Fortigate
accessor: Policy.ID
transformers:
- operator: ReverseList
- operator: atIndex
args:
index:
value:
simple: "1"
- operator: Stringify
separatecontext: false
view: |-
{
"position": {
"x": 50,
"y": 3870
}
}
note: false
"12":
id: "12"
taskid: 604078f6-1664-4459-8478-de61b03e5a21
type: regular
task:
id: 604078f6-1664-4459-8478-de61b03e5a21
version: -1
name: fortigate-get-address-groups
script: '|||fortigate-get-address-groups'
type: regular
iscommand: true
brand: ""
nexttasks:
'#none#':
- "30"
scriptarguments:
groupName:
simple: YARDEN
separatecontext: false
view: |-
{
"position": {
"x": 50,
"y": 4220
}
}
note: false
"13":
id: "13"
taskid: a3e13224-a5e9-4773-8611-08ec5a9bed60
type: regular
task:
id: a3e13224-a5e9-4773-8611-08ec5a9bed60
version: -1
name: fortigate-update-address-group ADD
script: '|||fortigate-update-address-group'
type: regular
iscommand: true
brand: ""
nexttasks:
'#none#':
- "31"
scriptarguments:
action:
simple: add
address:
simple: all
groupName:
simple: YARDEN
separatecontext: false
view: |-
{
"position": {
"x": 50,
"y": 4570
}
}
note: false
"14":
id: "14"
taskid: 263b3fac-1ffa-41af-8b52-5807c38c3b8a
type: regular
task:
id: 263b3fac-1ffa-41af-8b52-5807c38c3b8a
version: -1
name: fortigate-update-address-group REMOVE
script: '|||fortigate-update-address-group'
type: regular
iscommand: true
brand: ""
nexttasks:
'#none#':
- "32"
scriptarguments:
action:
simple: remove
address:
simple: all
groupName:
simple: YARDEN
separatecontext: false
view: |-
{
"position": {
"x": 50,
"y": 4920
}
}
note: false
"15":
id: "15"
taskid: da4219af-671c-401a-86a2-a14a6b85ded0
type: regular
task:
id: da4219af-671c-401a-86a2-a14a6b85ded0
version: -1
name: fortigate-create-address-group
script: '|||fortigate-create-address-group'
type: regular
iscommand: true
brand: ""
nexttasks:
'#none#':
- "33"
scriptarguments:
address:
simple: all
groupName:
complex:
root: incident
accessor: occurred
transformers:
- operator: toUnix
- operator: Stringify
separatecontext: false
view: |-
{
"position": {
"x": 50,
"y": 5270
}
}
note: false
"16":
id: "16"
taskid: 63e0882c-3321-4810-83a4-4a76762083f7
type: regular
task:
id: 63e0882c-3321-4810-83a4-4a76762083f7
version: -1
name: fortigate-delete-address-group
script: '|||fortigate-delete-address-group'
type: regular
iscommand: true
brand: ""
nexttasks:
'#none#':
- "34"
scriptarguments:
name:
complex:
root: incident
accessor: occurred
transformers:
- operator: toUnix
- operator: Stringify
separatecontext: false
view: |-
{
"position": {
"x": 50,
"y": 5620
}
}
note: false
"17":
id: "17"
taskid: 25a6c5f2-f150-490c-8a8c-b82af99283e7
type: title
task:
id: 25a6c5f2-f150-490c-8a8c-b82af99283e7
version: -1
name: TEST done
type: title
iscommand: false
brand: ""
separatecontext: false
view: |-
{
"position": {
"x": 50,
"y": 5970
}
}
note: false
"18":
id: "18"
taskid: 37df81c8-6121-40ce-8345-b7ccbbbcf9a1
type: regular
task:
id: 37df81c8-6121-40ce-8345-b7ccbbbcf9a1
version: -1
name: DeleteContext
scriptName: DeleteContext
type: regular
iscommand: false
brand: ""
nexttasks:
'#none#':
- "1"
scriptarguments:
all:
simple: "yes"
index: {}
key: {}
keysToKeep: {}
subplaybook: {}
separatecontext: false
view: |-
{
"position": {
"x": 50,
"y": 195
}
}
note: false
"19":
id: "19"
taskid: af6c42fc-bc35-4c99-81dd-634cb0490841
type: condition
task:
id: af6c42fc-bc35-4c99-81dd-634cb0490841
version: -1
name: Test get addresses context
type: condition
iscommand: false
brand: ""
nexttasks:
"yes":
- "2"
separatecontext: false
conditions:
- label: "yes"
condition:
- - operator: containsGeneral
left:
value:
simple: Fortigate.Address.Name
iscontext: true
right:
value:
simple: all
view: |-
{
"position": {
"x": 50,
"y": 545
}
}
note: false
"20":
id: "20"
taskid: e112859d-a385-4385-89fb-af07b096717d
type: condition
task:
id: e112859d-a385-4385-89fb-af07b096717d
version: -1
name: Test get service groups context
type: condition
iscommand: false
brand: ""
nexttasks:
"yes":
- "3"
separatecontext: false
conditions:
- label: "yes"
condition:
- - operator: containsGeneral
left:
value:
simple: Fortigate.ServiceGroup.Member.Name
iscontext: true
right:
value:
simple: DNS
view: |-
{
"position": {
"x": 50,
"y": 895
}
}
note: false
"21":
id: "21"
taskid: 72106f3f-0910-4e8f-8779-a2a16e35f1b2
type: condition
task:
id: 72106f3f-0910-4e8f-8779-a2a16e35f1b2
version: -1
name: TEST fortigate-update-service-group ADD context
type: condition
iscommand: false
brand: ""
nexttasks:
"yes":
- "4"
separatecontext: false
conditions:
- label: "yes"
condition:
- - operator: containsGeneral
left:
value:
complex:
root: Fortigate
filters:
- - operator: isEqualString
left:
value:
simple: Fortigate.ServiceGroup.Name
iscontext: true
right:
value:
simple: Maya
accessor: ServiceGroup.Service.Name
iscontext: true
right:
value:
simple: HTTPS
view: |-
{
"position": {
"x": 50,
"y": 1245
}
}
note: false
"22":
id: "22"
taskid: ebc92d72-76b5-471d-8cbc-f133c5be3a43
type: condition
task:
id: ebc92d72-76b5-471d-8cbc-f133c5be3a43
version: -1
name: TEST fortigate-update-service-group REMOVE context
type: condition
iscommand: false
brand: ""
nexttasks:
"yes":
- "5"
separatecontext: false
conditions:
- label: "yes"
condition:
- - operator: notContainsGeneral
left:
value:
complex:
root: Fortigate
filters:
- - operator: isEqualString
left:
value:
simple: Fortigate.ServiceGroup.Name
iscontext: true
right:
value:
simple: Maya
accessor: ServiceGroup.Service.Name
iscontext: true
right:
value:
simple: HTTPS
view: |-
{
"position": {
"x": 50,
"y": 1595
}
}
note: false
"23":
id: "23"
taskid: aa733746-33f8-4d87-83e5-c79ac5af60fb
type: condition
task:
id: aa733746-33f8-4d87-83e5-c79ac5af60fb
version: -1
name: TEST fortigate-get-firewall-service context
type: condition
iscommand: false
brand: ""
nexttasks:
"yes":
- "6"
separatecontext: false
conditions:
- label: "yes"
condition:
- - operator: containsGeneral
left:
value:
simple: Fortigate.Service.Name
iscontext: true
right:
value:
simple: ALL
view: |-
{
"position": {
"x": 50,
"y": 1945
}
}
note: false
"24":
id: "24"
taskid: c60e9d02-3d99-4cc6-823d-94c9c4de1c72
type: condition
task:
id: c60e9d02-3d99-4cc6-823d-94c9c4de1c72
version: -1
name: TEST fortigate-create-firewall-service context
type: condition
iscommand: false
brand: ""
nexttasks:
"yes":
- "7"
separatecontext: false
conditions:
- label: "yes"
condition:
- - operator: containsGeneral
left:
value:
simple: Fortigate.Service.Name
iscontext: true
right:
value:
complex:
root: incident
accessor: occurred
transformers:
- operator: toUnix
- operator: concat
args:
prefix:
value:
simple: SERVICE
suffix: {}
- operator: Stringify
iscontext: true
view: |-
{
"position": {
"x": 50,
"y": 2295
}
}
note: false
"25":
id: "25"
taskid: 67805b27-2b85-4557-860d-cf3d5f19cb58
type: condition
task:
id: 67805b27-2b85-4557-860d-cf3d5f19cb58
version: -1
name: TEST fortigate-get-policy context
type: condition
iscommand: false
brand: ""
nexttasks:
"yes":
- "8"
separatecontext: false
conditions:
- label: "yes"
condition:
- - operator: containsGeneral
left:
value:
simple: Fortigate.Policy.Security
iscontext: true
right:
value:
simple: default
view: |-
{
"position": {
"x": 50,
"y": 2645
}
}
note: false
"26":
id: "26"
taskid: 9a9cf917-03d6-4b5e-85c4-e583530910f2
type: condition
task:
id: 9a9cf917-03d6-4b5e-85c4-e583530910f2
version: -1
name: TESt fortigate-update-policy context
type: condition
iscommand: false
brand: ""
nexttasks:
"yes":
- "9"
separatecontext: false
conditions:
- label: "yes"
condition:
- - operator: containsGeneral
left:
value:
simple: Fortigate.Policy.Description
iscontext: true
right:
value:
simple: TEST DEMISTO
view: |-
{
"position": {
"x": 50,
"y": 2995
}
}
note: false
"27":
id: "27"
taskid: 171c79bd-aa6b-4179-897e-ae860a11580d
type: condition
task:
id: 171c79bd-aa6b-4179-897e-ae860a11580d
version: -1
name: TEST fortigate-create-policy context
type: condition
iscommand: false
brand: ""
nexttasks:
"yes":
- "10"
separatecontext: false
conditions:
- label: "yes"
condition:
- - operator: containsGeneral
left:
value:
simple: Fortigate.Policy.Name
iscontext: true
right:
value:
complex:
root: incident
accessor: occurred
transformers:
- operator: toUnix
- operator: concat
args:
prefix:
value:
simple: POLICY
suffix: {}
- operator: Stringify
iscontext: true
view: |-
{
"position": {
"x": 50,
"y": 3345
}
}
note: false
"28":
id: "28"
taskid: faff01ec-3bd1-4797-864d-e3fd0ff97610
type: condition
task:
id: faff01ec-3bd1-4797-864d-e3fd0ff97610
version: -1
name: TEST fortigate-move-policy context
type: condition
iscommand: false
brand: ""
nexttasks:
"yes":
- "11"
separatecontext: false
conditions:
- label: "yes"
condition:
- - operator: isTrue
left:
value:
complex:
root: Fortigate
filters:
- - operator: isEqualNumber
left:
value:
simple: Fortigate.Policy.ID
iscontext: true
right:
value:
simple: "34"
accessor: Policy.Moved
iscontext: true
view: |-
{
"position": {
"x": 50,
"y": 3695
}
}
note: false
"29":
id: "29"
taskid: ac464d42-3207-404a-8a53-923d4f2e0edc
type: condition
task:
id: ac464d42-3207-404a-8a53-923d4f2e0edc
version: -1
name: TEST fortigate-delete-policy context