-
Notifications
You must be signed in to change notification settings - Fork 1
/
Tufin Search Policies.json
1074 lines (1074 loc) · 47.6 KB
/
Tufin Search Policies.json
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
{
"workflow": {
"unique_name": "definition_workflow_01G4JL4BQ019J4CDBJFJCB6iPXRhcpJDwnA",
"name": "Tufin - Search Policies",
"title": "Tufin - Search Policies",
"type": "generic.workflow",
"base_type": "workflow",
"variables": [
{
"schema_id": "datatype.string",
"properties": {
"value": "[]",
"scope": "output",
"name": "Devices and Policies JSON",
"type": "datatype.string",
"description": "Output in JSON format.",
"is_required": false,
"is_invisible": false
},
"unique_name": "variable_workflow_01NM90LRJSAVT5fQc9brf3G1KRYzJJZIqZP",
"object_type": "variable_workflow"
},
{
"schema_id": "datatype.string",
"properties": {
"value": "{}",
"scope": "local",
"name": "Device JSON",
"type": "datatype.string",
"description": "Variable for current device info.",
"is_required": false,
"is_invisible": false
},
"unique_name": "variable_workflow_01NM9BCY5HB7E7YBKUIlvg6dwBYpjd0P7lX",
"object_type": "variable_workflow"
},
{
"schema_id": "datatype.integer",
"properties": {
"value": 0,
"scope": "output",
"name": "Tufin Policy Count",
"type": "datatype.integer",
"description": "Number of results returned",
"is_required": false,
"is_invisible": false
},
"unique_name": "variable_workflow_01G5GGQA6WQN95U29vJK5iOcXbqlgpWXeau",
"object_type": "variable_workflow"
},
{
"schema_id": "datatype.string",
"properties": {
"value": "",
"scope": "local",
"name": "Current Device Name",
"type": "datatype.string",
"description": "Variable for current device name",
"is_required": false,
"is_invisible": false
},
"unique_name": "variable_workflow_01G8ZCCUJILQF5pwlsITr7XKnGyzvZDUFFP",
"object_type": "variable_workflow"
},
{
"schema_id": "datatype.string",
"properties": {
"value": "",
"scope": "input",
"name": "Search Params",
"type": "datatype.string",
"description": "The text format for a field is <fieldname>:<text> for example source:192.168.1.1 or bareword for free text search. See the search info documentation in SecureTrack Policy Browser page for more information.",
"is_required": true,
"is_invisible": false
},
"unique_name": "variable_workflow_01G5GFGVRMEHQ05WlmaSmP4LmE4rZefEO1y",
"object_type": "variable_workflow"
},
{
"schema_id": "datatype.integer",
"properties": {
"value": 25,
"scope": "input",
"name": "Max Results Per Device",
"type": "datatype.integer",
"description": "Maximum number of results to return per device",
"is_required": false,
"is_invisible": false
},
"unique_name": "variable_workflow_01G8YRY3A07VQ15wwIoWFqMqlz7O6AQTN8F",
"object_type": "variable_workflow"
}
],
"properties": {
"atomic": {
"atomic_group": "Tufin",
"is_atomic": true
},
"delete_workflow_instance": false,
"description": "Search the policies of all devices managed by Tufin.\n\nTarget: An HTTP endpoint for your Tufin Orchestration Suite (TOS) external address\n\nAccount Key: HTTP basic with Tufin credentials\n\nSteps:\n[] Query SecureTrack for all devices managed by Tufin\n[] Check if request succeeded\n[]> If it did, extract the device IDs of the devices with rules\n[]> If it didn't, return an error\n[]> If extraction succeeded, query SecureTrack for device names and policies\n[]> If it didn't, return an error\n[] Check if both requests succeeded\n[]> If they did, extract the device name and policies\n[]> If they didn't, return an error\n[]> If extraction succeeded, put output to variables\n[]> If it didn't, return an error\n\nMore information about this API: https://forum.tufin.com/support/kc/R19-2/securetrack/apidoc/#!/Security_Rules/findRulesOnDevices\nhttps://forum.tufin.com/support/kc/R19-2/securetrack/apidoc/#!/Monitored_Devices/getDevices\nhttps://forum.tufin.com/support/kc/R19-2/securetrack/apidoc/#!/Security_Rules/findRulesOnDevices",
"display_name": "Tufin - Search Policies",
"runtime_user": {
"override_target_runtime_user": false,
"specify_on_workflow_start": false,
"target_default": true
},
"target": {
"target_type": "web-service.endpoint",
"specify_on_workflow_start": true
}
},
"object_type": "definition_workflow",
"actions": [
{
"unique_name": "definition_activity_01G4JL7MQ3FCZ6EHUQUoPvcdJEh7m83TFCo",
"name": "HTTP Request",
"title": "Get Policies",
"type": "web-service.http_request",
"base_type": "activity",
"properties": {
"accept": "application/json",
"action_timeout": 180,
"allow_auto_redirect": true,
"content_type": "application/json",
"continue_on_error_status_code": true,
"continue_on_failure": true,
"custom_headers": [
{
"name": "cache-control",
"value": "no-cache"
}
],
"description": "Search for policies",
"display_name": "Get Policies",
"method": "GET",
"relative_url": "/securetrack/api/rule_search?search_text=$workflow.definition_workflow_01G4JL4BQ019J4CDBJFJCB6iPXRhcpJDwnA.input.variable_workflow_01G5GFGVRMEHQ05WlmaSmP4LmE4rZefEO1y$",
"runtime_user": {
"override_target_runtime_user": false,
"target_default": true
},
"skip_execution": false,
"target": {
"use_workflow_target": true
}
},
"object_type": "definition_activity"
},
{
"unique_name": "definition_activity_01NM8CAITCX1265AQRGb6ZNiG7iz9WuQYwm",
"name": "Condition Block",
"title": "Is response OK?",
"type": "logic.if_else",
"base_type": "activity",
"properties": {
"continue_on_failure": false,
"display_name": "Is response OK?",
"skip_execution": false
},
"object_type": "definition_activity",
"blocks": [
{
"unique_name": "definition_activity_01NPG3UEZW20Z7kMjqmd6sDsqSf0SPNTRBG",
"name": "Condition Branch",
"title": "No without status code",
"type": "logic.condition_block",
"base_type": "activity",
"properties": {
"condition": {
"left_operand": "$activity.definition_activity_01G4JL7MQ3FCZ6EHUQUoPvcdJEh7m83TFCo.output.succeeded$",
"operator": "eq",
"right_operand": false
},
"continue_on_failure": false,
"display_name": "No without status code",
"skip_execution": false
},
"object_type": "definition_activity",
"actions": [
{
"unique_name": "definition_activity_01NPITF6EP6BY16FK5wvxFZx8VMmPqlVSzC",
"name": "Execute Python Script",
"title": "Create error message",
"type": "python3.script",
"base_type": "activity",
"properties": {
"action_timeout": 180,
"continue_on_failure": false,
"display_name": "Create error message",
"script": "import sys, json\n\nmessage = sys.argv[1].replace('\"', '\\'')\nerror = {\"message\": message}\nerror = json.dumps(error)",
"script_arguments": [
"$activity.definition_activity_01G4JL7MQ3FCZ6EHUQUoPvcdJEh7m83TFCo.output.error.message$"
],
"script_queries": [
{
"script_query": "error",
"script_query_name": "Error",
"script_query_type": "string"
}
],
"skip_execution": false
},
"object_type": "definition_activity"
},
{
"unique_name": "definition_activity_01NPG5A9W7OOD2wpKPz3qZAv5s6SHbpi1JX",
"name": "Completed",
"title": "Error message",
"type": "logic.completed",
"base_type": "activity",
"properties": {
"completion_type": "failed-completed",
"continue_on_failure": false,
"display_name": "Error message",
"result_message": "$activity.definition_activity_01NPITF6EP6BY16FK5wvxFZx8VMmPqlVSzC.output.script_queries.Error$",
"skip_execution": false
},
"object_type": "definition_activity"
}
]
},
{
"unique_name": "definition_activity_01NM8CBC7DEAR6qrnEU8NQRVfih4oj3vt1k",
"name": "Condition Branch",
"title": "No with status code",
"type": "logic.condition_block",
"base_type": "activity",
"properties": {
"condition": {
"left_operand": "$activity.definition_activity_01G4JL7MQ3FCZ6EHUQUoPvcdJEh7m83TFCo.output.status_code$",
"operator": "ne",
"right_operand": 200
},
"continue_on_failure": false,
"display_name": "No with status code",
"skip_execution": false
},
"object_type": "definition_activity",
"actions": [
{
"unique_name": "definition_activity_01NPLBNAZJZA04mk1UPjEfj3VqMp1Kor1yg",
"name": "Execute Python Script",
"title": "Create error message",
"type": "python3.script",
"base_type": "activity",
"properties": {
"action_timeout": 180,
"continue_on_failure": false,
"display_name": "Create error message",
"script": "import sys, json\n\nstatus_code = sys.argv[1]\nmessage = sys.argv[2]\nerror = {\"status_code\": status_code, \"message\": message}\nerror = json.dumps(error)",
"script_arguments": [
"$activity.definition_activity_01G4JL7MQ3FCZ6EHUQUoPvcdJEh7m83TFCo.output.status_code$",
"$activity.definition_activity_01G4JL7MQ3FCZ6EHUQUoPvcdJEh7m83TFCo.output.response_body$"
],
"script_queries": [
{
"script_query": "error",
"script_query_name": "Error",
"script_query_type": "string"
}
],
"skip_execution": false
},
"object_type": "definition_activity"
},
{
"unique_name": "definition_activity_01NM8FC1RVNF50y7Cw99GQhxs2ACaSo83rh",
"name": "Completed",
"title": "Error message",
"type": "logic.completed",
"base_type": "activity",
"properties": {
"completion_type": "failed-completed",
"continue_on_failure": false,
"display_name": "Error message",
"result_message": "$activity.definition_activity_01NPLBNAZJZA04mk1UPjEfj3VqMp1Kor1yg.output.script_queries.Error$",
"skip_execution": false
},
"object_type": "definition_activity"
}
]
}
]
},
{
"unique_name": "definition_activity_01G8YHCYDWH38334r80Noqym66Kqwn2D9rM",
"name": "Execute Python Script",
"title": "Get device IDs with match",
"type": "python3.script",
"base_type": "activity",
"properties": {
"action_timeout": 180,
"continue_on_failure": true,
"description": "Iterate through the results to find the device IDs of the devices with matching rules",
"display_name": "Get device IDs with match",
"script": "import sys,json\n\nmatches = json.loads(sys.argv[1])\n\nsearch_devices = {}\nif matches['device_list']['device']:\n dev_list = []\n for match in matches['device_list']['device']:\n if int(match['rule_count']) > 0:\n dev_list.append({\"id\": match['device_id']})\n search_devices[\"devices\"] = dev_list\n\nsearch_devices = json.dumps(search_devices)",
"script_arguments": [
"$activity.definition_activity_01G4JL7MQ3FCZ6EHUQUoPvcdJEh7m83TFCo.output.response_body$"
],
"script_queries": [
{
"script_query": "search_devices",
"script_query_name": "search_devices ",
"script_query_type": "string"
}
],
"skip_execution": false
},
"object_type": "definition_activity"
},
{
"unique_name": "definition_activity_01NPM2D4SG0OS5q20EYfJjFBqR2eSOtUsWk",
"name": "Condition Block",
"title": "Are there devices? or Device extraction succeeded? ",
"type": "logic.if_else",
"base_type": "activity",
"properties": {
"continue_on_failure": false,
"display_name": "Are there devices? or Device extraction succeeded? ",
"skip_execution": false
},
"object_type": "definition_activity",
"blocks": [
{
"unique_name": "definition_activity_01NPM2DX66TB03AZsAPsQwyoGIbGxstIMb6",
"name": "Condition Branch",
"title": "No devices",
"type": "logic.condition_block",
"base_type": "activity",
"properties": {
"condition": {
"left_operand": "$activity.definition_activity_01G8YHCYDWH38334r80Noqym66Kqwn2D9rM.output.script_queries.search_devices $",
"operator": "eq",
"right_operand": "{}"
},
"continue_on_failure": false,
"display_name": "No devices",
"skip_execution": false
},
"object_type": "definition_activity",
"actions": [
{
"unique_name": "definition_activity_01NPM2XKJAAQI6iWf8R2Ji06nh6lTqQVnrF",
"name": "Completed",
"title": "Error message",
"type": "logic.completed",
"base_type": "activity",
"properties": {
"completion_type": "failed-completed",
"continue_on_failure": false,
"display_name": "Error message",
"result_message": "{\"message\": \"There are no devices with matching rules.\"}",
"skip_execution": false
},
"object_type": "definition_activity"
}
]
},
{
"unique_name": "definition_activity_01NVEOIKW9LY05TGa5BvfGI5ugr6xWzRTgz",
"name": "Condition Branch",
"title": "Devices extracting failed",
"type": "logic.condition_block",
"base_type": "activity",
"properties": {
"condition": {
"left_operand": "$activity.definition_activity_01G8YHCYDWH38334r80Noqym66Kqwn2D9rM.output.succeeded$",
"operator": "eq",
"right_operand": false
},
"continue_on_failure": false,
"display_name": "Devices extracting failed",
"skip_execution": false
},
"object_type": "definition_activity",
"actions": [
{
"unique_name": "definition_activity_01NVEPFK0WWVH46zJjgnLYJxGaxw2zuC2q3",
"name": "Completed",
"title": "Error message",
"type": "logic.completed",
"base_type": "activity",
"properties": {
"completion_type": "failed-completed",
"continue_on_failure": false,
"display_name": "Error message",
"result_message": "{\"message\": \"Tufin response data structure has changed. Atomic action need to be fixed.\"}",
"skip_execution": false
},
"object_type": "definition_activity"
}
]
}
]
},
{
"unique_name": "definition_activity_01G8YKO8H9JT34sFDMKULhfAs4eTfHbfLMY",
"name": "Read Table from JSON",
"title": "Read device IDs to table",
"type": "corejava.read_table_from_json",
"base_type": "activity",
"properties": {
"action_timeout": 180,
"continue_on_failure": false,
"description": "Read the device IDs of devices with matching rules in to table",
"display_name": "Read device IDs to table",
"input_json": "$activity.definition_activity_01G8YHCYDWH38334r80Noqym66Kqwn2D9rM.output.script_queries.search_devices $",
"jsonpath_query": "$.devices",
"persist_output": true,
"populate_columns": false,
"skip_execution": false,
"table_columns": [
{
"column_name": "id",
"column_type": "integer"
}
]
},
"object_type": "definition_activity"
},
{
"unique_name": "definition_activity_01G8YPSMV4C7D5TMWH2XZ5XfE7kKoTr6Tji",
"name": "For Each",
"title": "For each device ID",
"type": "logic.for_each",
"base_type": "activity",
"properties": {
"continue_on_failure": false,
"description": "Query matches for each device ID",
"display_name": "For each device ID",
"skip_execution": false,
"source_array": "$activity.definition_activity_01G8YKO8H9JT34sFDMKULhfAs4eTfHbfLMY.output.read_table_from_json$"
},
"object_type": "definition_activity",
"actions": [
{
"unique_name": "definition_activity_01G8ZAOLF0GX558MtTSf5KmzO3BtfAw67Za",
"name": "HTTP Request",
"title": "Get device name",
"type": "web-service.http_request",
"base_type": "activity",
"properties": {
"accept": "application/json",
"action_timeout": 180,
"allow_auto_redirect": true,
"content_type": "application/json",
"continue_on_error_status_code": true,
"continue_on_failure": true,
"custom_headers": [
{
"name": "cache-control",
"value": "no-cache"
}
],
"description": "Get the name of the current device",
"display_name": "Get device name",
"method": "GET",
"relative_url": "/securetrack/api/devices/$activity.definition_activity_01G8YPSMV4C7D5TMWH2XZ5XfE7kKoTr6Tji.input.source_array[@].id$",
"runtime_user": {
"override_target_runtime_user": false,
"target_default": true
},
"skip_execution": false,
"target": {
"override_workflow_target": false,
"override_workflow_target_group_criteria": false,
"use_workflow_target": true,
"use_workflow_target_group": false
}
},
"object_type": "definition_activity"
},
{
"unique_name": "definition_activity_01NM8MJ4Q07KU440Gv4TM60JgEdaXrThIoF",
"name": "Condition Block",
"title": "Is response OK?",
"type": "logic.if_else",
"base_type": "activity",
"properties": {
"continue_on_failure": false,
"display_name": "Is response OK?",
"skip_execution": false
},
"object_type": "definition_activity",
"blocks": [
{
"unique_name": "definition_activity_01NPG92W53IYU5nLFljuxz865QMlTkIgvLC",
"name": "Condition Branch",
"title": "No without status code",
"type": "logic.condition_block",
"base_type": "activity",
"properties": {
"condition": {
"left_operand": "$activity.definition_activity_01G8ZAOLF0GX558MtTSf5KmzO3BtfAw67Za.output.succeeded$",
"operator": "eq",
"right_operand": false
},
"continue_on_failure": false,
"display_name": "No without status code",
"skip_execution": false
},
"object_type": "definition_activity",
"actions": [
{
"unique_name": "definition_activity_01NPKJMQHO8ZP6vpifJezPz3x1sUkr4MdhY",
"name": "Execute Python Script",
"title": "Create device error message",
"type": "python3.script",
"base_type": "activity",
"properties": {
"action_timeout": 180,
"continue_on_failure": false,
"display_name": "Create device error message",
"script": "import sys, json\n\nmessage = sys.argv[1].replace('\"', '\\'')\nerror = {\"message\": message}\nerror = json.dumps(error)",
"script_arguments": [
"$activity.definition_activity_01G8ZAOLF0GX558MtTSf5KmzO3BtfAw67Za.output.error.message$"
],
"script_queries": [
{
"script_query": "error",
"script_query_name": "Error",
"script_query_type": "string"
}
],
"skip_execution": false
},
"object_type": "definition_activity"
},
{
"unique_name": "definition_activity_01NPG9I8ACX7W7AjYzHgc6qmy7CJiAL0ebb",
"name": "Completed",
"title": "Error message",
"type": "logic.completed",
"base_type": "activity",
"properties": {
"completion_type": "failed-completed",
"continue_on_failure": false,
"display_name": "Error message",
"result_message": "$activity.definition_activity_01NPKJMQHO8ZP6vpifJezPz3x1sUkr4MdhY.output.script_queries.Error$",
"skip_execution": false
},
"object_type": "definition_activity"
}
]
},
{
"unique_name": "definition_activity_01NM8MJY2MUYT01ftKLCReieEpsk28dWrdQ",
"name": "Condition Branch",
"title": "No with status code",
"type": "logic.condition_block",
"base_type": "activity",
"properties": {
"condition": {
"left_operand": "$activity.definition_activity_01G8ZAOLF0GX558MtTSf5KmzO3BtfAw67Za.output.status_code$",
"operator": "ne",
"right_operand": 200
},
"continue_on_failure": false,
"display_name": "No with status code",
"skip_execution": false
},
"object_type": "definition_activity",
"actions": [
{
"unique_name": "definition_activity_01NPLDEDISLFF4sJwgnqaLvbPHUKl70sfGf",
"name": "Execute Python Script",
"title": "Create device error message",
"type": "python3.script",
"base_type": "activity",
"properties": {
"action_timeout": 180,
"continue_on_failure": false,
"display_name": "Create device error message",
"script": "import sys, json\n\nstatus_code = sys.argv[1]\nmessage = sys.argv[2]\nerror = {\"status_code\": status_code, \"message\": message}\nerror = json.dumps(error)",
"script_arguments": [
"$activity.definition_activity_01G8ZAOLF0GX558MtTSf5KmzO3BtfAw67Za.output.status_code$",
"$activity.definition_activity_01G8ZAOLF0GX558MtTSf5KmzO3BtfAw67Za.output.response_body$"
],
"script_queries": [
{
"script_query": "error",
"script_query_name": "Error",
"script_query_type": "string"
}
],
"skip_execution": false
},
"object_type": "definition_activity"
},
{
"unique_name": "definition_activity_01NM8O1H6MELK3Y0sVcGw8OsfAhif5BYYpq",
"name": "Completed",
"title": "Error message",
"type": "logic.completed",
"base_type": "activity",
"properties": {
"completion_type": "failed-completed",
"continue_on_failure": false,
"display_name": "Error message",
"result_message": "$activity.definition_activity_01NPLDEDISLFF4sJwgnqaLvbPHUKl70sfGf.output.script_queries.Error$",
"skip_execution": false
},
"object_type": "definition_activity"
}
]
}
]
},
{
"unique_name": "definition_activity_01G8ZD3SXO6852TD3ZmNgMm5ZqvvxESuLe5",
"name": "JSONPath Query",
"title": "Query device name",
"type": "corejava.jsonpathquery",
"base_type": "activity",
"properties": {
"action_timeout": 180,
"continue_on_failure": true,
"description": "Get the device name from the query results",
"display_name": "Query device name",
"input_json": "$activity.definition_activity_01G8ZAOLF0GX558MtTSf5KmzO3BtfAw67Za.output.response_body$",
"jsonpath_queries": [
{
"jsonpath_query": "$.device.name",
"jsonpath_query_name": "device_name",
"jsonpath_query_type": "string"
}
],
"skip_execution": false
},
"object_type": "definition_activity"
},
{
"unique_name": "definition_activity_01NVEUFSSVVKC63Nl35ODFLtLIrsLXuK96t",
"name": "Condition Block",
"title": "Device name extraction succeeded?",
"type": "logic.if_else",
"base_type": "activity",
"properties": {
"continue_on_failure": false,
"display_name": "Device name extraction succeeded?",
"skip_execution": false
},
"object_type": "definition_activity",
"blocks": [
{
"unique_name": "definition_activity_01NVEUGKHS7I44ZOjLGrosrwncBxKItYKlQ",
"name": "Condition Branch",
"title": "No",
"type": "logic.condition_block",
"base_type": "activity",
"properties": {
"condition": {
"left_operand": "$activity.definition_activity_01G8ZD3SXO6852TD3ZmNgMm5ZqvvxESuLe5.output.succeeded$",
"operator": "eq",
"right_operand": false
},
"continue_on_failure": false,
"display_name": "No",
"skip_execution": false
},
"object_type": "definition_activity",
"actions": [
{
"unique_name": "definition_activity_01NVEVHSQ6AJE33fGliomvB1tgMhk6nD9Rb",
"name": "Completed",
"title": "Error message",
"type": "logic.completed",
"base_type": "activity",
"properties": {
"completion_type": "failed-completed",
"continue_on_failure": false,
"display_name": "Error message",
"result_message": "{\"message\": \"Tufin response data structure has changed. Atomic action needs to be fixed.\"}",
"skip_execution": false
},
"object_type": "definition_activity"
}
]
}
]
},
{
"unique_name": "definition_activity_01G8ZE8V46KO21XYGXjjbLJQqloshfrya13",
"name": "Set Variables",
"title": "Set device name",
"type": "core.set_multiple_variables",
"base_type": "activity",
"properties": {
"continue_on_failure": false,
"description": "Set the current device name",
"display_name": "Set device name",
"skip_execution": false,
"variables_to_update": [
{
"variable_to_update": "$workflow.definition_workflow_01G4JL4BQ019J4CDBJFJCB6iPXRhcpJDwnA.local.variable_workflow_01G8ZCCUJILQF5pwlsITr7XKnGyzvZDUFFP$",
"variable_value_new": "$activity.definition_activity_01G8ZD3SXO6852TD3ZmNgMm5ZqvvxESuLe5.output.jsonpath_queries.device_name$"
}
]
},
"object_type": "definition_activity"
},
{
"unique_name": "definition_activity_01G8YQVNERIUH77ZTQDba2SqTFDRACPp2xp",
"name": "HTTP Request",
"title": "Get policy rules from device",
"type": "web-service.http_request",
"base_type": "activity",
"properties": {
"accept": "application/json",
"action_timeout": 180,
"allow_auto_redirect": true,
"content_type": "application/json",
"continue_on_error_status_code": true,
"continue_on_failure": true,
"custom_headers": [
{
"name": "cache-control",
"value": "no-cache"
}
],
"description": "Query the matching policies from the individual device",
"display_name": "Get policy rules from device",
"method": "GET",
"relative_url": "/securetrack/api/rule_search/$activity.definition_activity_01G8YPSMV4C7D5TMWH2XZ5XfE7kKoTr6Tji.input.source_array[@].id$?search_text=$workflow.definition_workflow_01G4JL4BQ019J4CDBJFJCB6iPXRhcpJDwnA.input.variable_workflow_01G5GFGVRMEHQ05WlmaSmP4LmE4rZefEO1y$",
"runtime_user": {
"override_target_runtime_user": false,
"target_default": true
},
"skip_execution": false,
"target": {
"override_workflow_target": false,
"override_workflow_target_group_criteria": false,
"use_workflow_target": true,
"use_workflow_target_group": false
}
},
"object_type": "definition_activity"
},
{
"unique_name": "definition_activity_01NM8RWBJGGOK4NkOtf70fSN4AqXQBmYA0f",
"name": "Condition Block",
"title": "Is response OK?",
"type": "logic.if_else",
"base_type": "activity",
"properties": {
"continue_on_failure": false,
"display_name": "Is response OK?",
"skip_execution": false
},
"object_type": "definition_activity",
"blocks": [
{
"unique_name": "definition_activity_01NPGAUTZD0304DIcdEe7yvYzX6TausukqP",
"name": "Condition Branch",
"title": "No without status code",
"type": "logic.condition_block",
"base_type": "activity",
"properties": {
"condition": {
"left_operand": "$activity.definition_activity_01G8YQVNERIUH77ZTQDba2SqTFDRACPp2xp.output.succeeded$",
"operator": "eq",
"right_operand": false
},
"continue_on_failure": false,
"display_name": "No without status code",
"skip_execution": false
},
"object_type": "definition_activity",
"actions": [
{
"unique_name": "definition_activity_01NPKL9XJWL8S34vWYUqM0TxEIkmho7aKNa",
"name": "Execute Python Script",
"title": "Create policies error message",
"type": "python3.script",
"base_type": "activity",
"properties": {
"action_timeout": 180,
"continue_on_failure": false,
"display_name": "Create policies error message",
"script": "import sys, json\n\nmessage = sys.argv[1].replace('\"', '\\'')\nerror = {\"message\": message}\nerror = json.dumps(error)",
"script_arguments": [
"$activity.definition_activity_01G8YQVNERIUH77ZTQDba2SqTFDRACPp2xp.output.error.message$"
],
"script_queries": [
{
"script_query": "error",
"script_query_name": "Error",
"script_query_type": "string"
}
],
"skip_execution": false
},
"object_type": "definition_activity"
},
{
"unique_name": "definition_activity_01NPGBXMDN4773ugmen6xUqfUYbJ0v2rP32",
"name": "Completed",
"title": "Error message",
"type": "logic.completed",
"base_type": "activity",
"properties": {
"completion_type": "failed-completed",
"continue_on_failure": false,
"display_name": "Error message",
"result_message": "$activity.definition_activity_01NPKL9XJWL8S34vWYUqM0TxEIkmho7aKNa.output.script_queries.Error$",
"skip_execution": false
},
"object_type": "definition_activity"
}
]
},
{
"unique_name": "definition_activity_01NM8RX6HGDF718DNeSO84qzsjtAmDw8RjX",
"name": "Condition Branch",
"title": "No with status code",
"type": "logic.condition_block",
"base_type": "activity",
"properties": {
"condition": {
"left_operand": "$activity.definition_activity_01G8YQVNERIUH77ZTQDba2SqTFDRACPp2xp.output.status_code$",
"operator": "ne",
"right_operand": 200
},
"continue_on_failure": false,
"display_name": "No with status code",
"skip_execution": false
},
"object_type": "definition_activity",
"actions": [
{
"unique_name": "definition_activity_01NPLF5793IIK2akKBeRLGFPFlQyXGKEMFE",
"name": "Execute Python Script",
"title": "Create policies error message",
"type": "python3.script",
"base_type": "activity",
"properties": {
"action_timeout": 180,
"continue_on_failure": false,
"display_name": "Create policies error message",
"script": "import sys, json\n\nstatus_code = sys.argv[1]\nmessage = sys.argv[2]\nerror = {\"status_code\": status_code, \"message\": message}\nerror = json.dumps(error)",
"script_arguments": [
"$activity.definition_activity_01G8YQVNERIUH77ZTQDba2SqTFDRACPp2xp.output.status_code$",
"$activity.definition_activity_01G8YQVNERIUH77ZTQDba2SqTFDRACPp2xp.output.response_body$"
],
"script_queries": [
{
"script_query": "error",
"script_query_name": "Error",
"script_query_type": "string"
}
],
"skip_execution": false
},
"object_type": "definition_activity"
},
{
"unique_name": "definition_activity_01NM8U2N6EM8371vnFmvpHloPUcNLJRVF9s",
"name": "Completed",
"title": "Error message",
"type": "logic.completed",
"base_type": "activity",
"properties": {
"completion_type": "failed-completed",
"continue_on_failure": false,
"display_name": "Error message",
"result_message": "$activity.definition_activity_01NPLF5793IIK2akKBeRLGFPFlQyXGKEMFE.output.script_queries.Error$",
"skip_execution": false
},
"object_type": "definition_activity"
}
]
}
]
},
{
"unique_name": "definition_activity_01G8ZG3J9W1IJ3aJpSkrjA7JiLSXQOrBfqZ",
"name": "Execute Python Script",
"title": "Parse policies",
"type": "python3.script",
"base_type": "activity",
"properties": {
"action_timeout": 180,
"continue_on_failure": false,
"description": "Parse policy information from results",
"display_name": "Parse policies",
"script": "import sys, json\n\nrules = json.loads(sys.argv[1])\ndevice_name = sys.argv[2]\n\nrule_total = 0\nrule_return = []\n\nif rules['rules']['rule']:\n for rule in rules['rules']['rule']:\n rule_total = rule_total + 1\n rule_return.append({\n 'device': device_name,\n 'source': [d['display_name'] for d in rule['src_network']],\n 'source_service': [d['display_name'] for d in rule['src_service']],\n 'destination': [d['display_name'] for d in rule['dst_network']],\n 'destination_service': [d['display_name'] for d in rule['dst_service']],\n 'action': rule['action']})\nrule_return = json.dumps(rule_return)",
"script_arguments": [
"$activity.definition_activity_01G8YQVNERIUH77ZTQDba2SqTFDRACPp2xp.output.response_body$",
"$workflow.definition_workflow_01G4JL4BQ019J4CDBJFJCB6iPXRhcpJDwnA.local.variable_workflow_01G8ZCCUJILQF5pwlsITr7XKnGyzvZDUFFP$"
],
"script_queries": [
{
"script_query": "rule_return",
"script_query_name": "rules",
"script_query_type": "string"
},
{
"script_query": "rule_total",
"script_query_name": "rule_total ",
"script_query_type": "integer"
}
],
"skip_execution": false
},
"object_type": "definition_activity"
},
{
"unique_name": "definition_activity_01NVFBPRY7ZZ44e66HC7QGcGxFiJ2K8gdM0",
"name": "Condition Block",
"title": "Policy parsing succeeded?",
"type": "logic.if_else",
"base_type": "activity",
"properties": {
"continue_on_failure": false,
"display_name": "Policy parsing succeeded?",
"skip_execution": false
},
"object_type": "definition_activity",
"blocks": [
{
"unique_name": "definition_activity_01NVFBQIJFI3S0jLjF4Jt7ERXXWvmC8DYP4",
"name": "Condition Branch",
"title": "No",
"type": "logic.condition_block",
"base_type": "activity",
"properties": {
"condition": {
"left_operand": "$activity.definition_activity_01G8ZG3J9W1IJ3aJpSkrjA7JiLSXQOrBfqZ.output.succeeded$",
"operator": "eq",
"right_operand": false
},
"continue_on_failure": false,
"display_name": "No",
"skip_execution": false
},
"object_type": "definition_activity",
"actions": [
{
"unique_name": "definition_activity_01NVFDW0WMXBL2yS0diqREaTT3gGWmy4mEo",
"name": "Completed",
"title": "Error message",
"type": "logic.completed",
"base_type": "activity",
"properties": {
"completion_type": "failed-completed",
"continue_on_failure": false,
"display_name": "Error message",
"result_message": "{\"message\": \"Tufin response data structure has changed. Atomic action need to be fixed.\"}",
"skip_execution": false
},
"object_type": "definition_activity"
}
]
}
]
},
{
"unique_name": "definition_activity_01NM9BYLA5KT33Dk2liYnwxPy869I9YvALD",
"name": "Execute Python Script",
"title": "Set device JSON",
"type": "python3.script",
"base_type": "activity",
"properties": {
"action_timeout": 180,
"continue_on_failure": false,
"display_name": "Set device JSON",
"script": "import sys, json\n\npolicies = json.loads(sys.argv[1])\nname = sys.argv[2]\ndevice = {\n 'device': name,\n 'policies': policies\n}\ndevice = json.dumps(device)",
"script_arguments": [
"$activity.definition_activity_01G8ZG3J9W1IJ3aJpSkrjA7JiLSXQOrBfqZ.output.script_queries.rules$",
"$workflow.definition_workflow_01G4JL4BQ019J4CDBJFJCB6iPXRhcpJDwnA.local.variable_workflow_01G8ZCCUJILQF5pwlsITr7XKnGyzvZDUFFP$"
],
"script_queries": [
{
"script_query": "device",
"script_query_name": "Device",
"script_query_type": "string"
}
],
"skip_execution": false
},
"object_type": "definition_activity"
},
{
"unique_name": "definition_activity_01NMB3J9FRUIJ64DP4musgMN43o4arOchac",
"name": "Execute Python Script",
"title": "Set device JSON to output",
"type": "python3.script",
"base_type": "activity",
"properties": {
"action_timeout": 180,
"continue_on_failure": false,
"display_name": "Set device JSON to output",
"script": "import sys, json\n\ndevice = json.loads(sys.argv[1])\noutput = json.loads(sys.argv[2])\n\noutput.append(device)\n\noutput = json.dumps(output)",
"script_arguments": [
"$activity.definition_activity_01NM9BYLA5KT33Dk2liYnwxPy869I9YvALD.output.script_queries.Device$",
"$workflow.definition_workflow_01G4JL4BQ019J4CDBJFJCB6iPXRhcpJDwnA.output.variable_workflow_01NM90LRJSAVT5fQc9brf3G1KRYzJJZIqZP$"
],
"script_queries": [
{
"script_query": "output",
"script_query_name": "Output",