-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathTufin Resolve Objects.json
392 lines (392 loc) · 16.3 KB
/
Tufin Resolve Objects.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
{
"workflow": {
"unique_name": "definition_workflow_01G5H3DYVBOMA3nhhpXtOd6qFaiGXk6d5dD",
"name": "Tufin - Resolve Objects",
"title": "Tufin - Resolve Objects",
"type": "generic.workflow",
"base_type": "workflow",
"variables": [
{
"schema_id": "datatype.string",
"properties": {
"value": "",
"scope": "input",
"name": "IP Address",
"type": "datatype.string",
"description": "Resolve IP address to Network Object",
"is_required": true,
"is_invisible": false
},
"unique_name": "variable_workflow_01G5H4HMS7WE13r79jL4A2HhDQ0T1sEND58",
"object_type": "variable_workflow"
},
{
"schema_id": "datatype.string",
"properties": {
"value": "[]",
"scope": "output",
"name": "Network Objects JSON",
"type": "datatype.string",
"description": "Output in JSON format.",
"is_required": false,
"is_invisible": false
},
"unique_name": "variable_workflow_01NLEWS56G2WC34qIhthgPFcAYJFNtsaUBC",
"object_type": "variable_workflow"
}
],
"properties": {
"atomic": {
"atomic_group": "Tufin",
"is_atomic": true
},
"delete_workflow_instance": false,
"description": "Resolve IP address to Network Object.\n\nTarget: An HTTP endpoint for your Tufin Orchestration Suite (TOS) external address\n\nAccount Key: HTTP basic with Tufin credentials\n\nSteps:\n[] Make request to get Network Objects\n[] Check if request succeeded\n[]> If it did, extract Network Objects\n[]> If it didn't, return an error\n[]> If extracting succeeded, put data into output 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/#!/Network_Objects/findNetworkObjects",
"display_name": "Tufin - Resolve Objects",
"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_01NLE0G5WYWH06bLCB4hBUxjZCaLlviWTWq",
"name": "HTTP Request",
"title": "Get objects",
"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"
}
],
"display_name": "Get objects",
"method": "GET",
"relative_url": "/securetrack/api/network_objects/search?filter=subnet&count=100&exact_subnet=$workflow.definition_workflow_01G5H3DYVBOMA3nhhpXtOd6qFaiGXk6d5dD.input.variable_workflow_01G5H4HMS7WE13r79jL4A2HhDQ0T1sEND58$",
"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_01NJINWZ0X6Q50tPQEL7ZcoOBhcPM1F9Lsg",
"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_01NPFOTLG6DW42UnAtLXenAWNXZmfIVaQHH",
"name": "Condition Branch",
"title": "No without status code",
"type": "logic.condition_block",
"base_type": "activity",
"properties": {
"condition": {
"left_operand": "$activity.definition_activity_01NLE0G5WYWH06bLCB4hBUxjZCaLlviWTWq.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_01NPHK1ERXDVH6uLyUaFvogFJDqGGlFuEg4",
"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_01NLE0G5WYWH06bLCB4hBUxjZCaLlviWTWq.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_01NPFPYBUV42S1VOCc6SQUOCttyUw54X70c",
"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_01NPHK1ERXDVH6uLyUaFvogFJDqGGlFuEg4.output.script_queries.Error$",
"skip_execution": false
},
"object_type": "definition_activity"
}
]
},
{
"unique_name": "definition_activity_01NJINXPWDVYI200m9sVcuspVDKzCwgl0Qw",
"name": "Condition Branch",
"title": "No with status code",
"type": "logic.condition_block",
"base_type": "activity",
"properties": {
"condition": {
"left_operand": "$activity.definition_activity_01NLE0G5WYWH06bLCB4hBUxjZCaLlviWTWq.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_01NPL41CM3BXJ15QUxyTdlBiMBGKyfBTIcU",
"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_01NLE0G5WYWH06bLCB4hBUxjZCaLlviWTWq.output.status_code$",
"$activity.definition_activity_01NLE0G5WYWH06bLCB4hBUxjZCaLlviWTWq.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_01NJJ63DPP1G74yQzMhyUgNG4D3du63mEBZ",
"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_01NPL41CM3BXJ15QUxyTdlBiMBGKyfBTIcU.output.script_queries.Error$",
"skip_execution": false
},
"object_type": "definition_activity"
}
]
}
]
},
{
"unique_name": "definition_activity_01NLEX2HRB0LM4zPMWIfllCDWZwCFSeGGgR",
"name": "Execute Python Script",
"title": "Build network object JSON",
"type": "python3.script",
"base_type": "activity",
"properties": {
"action_timeout": 180,
"continue_on_failure": true,
"display_name": "Build network object JSON",
"script": "import sys, json\n\ndef from_json(string):\n return json.loads(string)\n\nresponse, network_objects = map(from_json, sys.argv[1:])\nfor item in response['network_objects']['network_object']:\n network_objects.append(\n {\n 'class_name': item['class_name'],\n 'device_id': item['device_id'],\n 'id': item['id'],\n 'implicit': item['implicit'],\n 'ip': item['ip'],\n 'ip_type': item['ip_type'],\n 'name': item['name'],\n 'type': item['type'],\n 'uid': item['uid'],\n 'display_name': item['display_name'],\n 'type_on_device': item['type_on_device']\n }\n )\nnetwork_objects = json.dumps(network_objects)",
"script_arguments": [
"$activity.definition_activity_01NLE0G5WYWH06bLCB4hBUxjZCaLlviWTWq.output.response_body$",
"$workflow.definition_workflow_01G5H3DYVBOMA3nhhpXtOd6qFaiGXk6d5dD.output.variable_workflow_01NLEWS56G2WC34qIhthgPFcAYJFNtsaUBC$"
],
"script_queries": [
{
"script_query": "network_objects",
"script_query_name": "Network Objects",
"script_query_type": "string"
}
],
"skip_execution": false
},
"object_type": "definition_activity"
},
{
"unique_name": "definition_activity_01NUM43DZ9DGV4W9hAZqhElZh9IDhxl0CcM",
"name": "Condition Block",
"title": "Object extraction succeeded?",
"type": "logic.if_else",
"base_type": "activity",
"properties": {
"continue_on_failure": false,
"display_name": "Object extraction succeeded?",
"skip_execution": false
},
"object_type": "definition_activity",
"blocks": [
{
"unique_name": "definition_activity_01NUM446ALJQN6nqy5zIXFFKbriP0KtoJ4x",
"name": "Condition Branch",
"title": "No",
"type": "logic.condition_block",
"base_type": "activity",
"properties": {
"condition": {
"left_operand": "$activity.definition_activity_01NLEX2HRB0LM4zPMWIfllCDWZwCFSeGGgR.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_01NUMFQGJUISU4SS3QKnhFPqrrrTI6qgGvy",
"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_01NLFEM66TK4S0aP9RInKmt8OU60OdEiziv",
"name": "Set Variables",
"title": "Set network object JSON",
"type": "core.set_multiple_variables",
"base_type": "activity",
"properties": {
"continue_on_failure": false,
"display_name": "Set network object JSON",
"skip_execution": false,
"variables_to_update": [
{
"variable_to_update": "$workflow.definition_workflow_01G5H3DYVBOMA3nhhpXtOd6qFaiGXk6d5dD.output.variable_workflow_01NLEWS56G2WC34qIhthgPFcAYJFNtsaUBC$",
"variable_value_new": "$activity.definition_activity_01NLEX2HRB0LM4zPMWIfllCDWZwCFSeGGgR.output.script_queries.Network Objects$"
}
]
},
"object_type": "definition_activity"
},
{
"unique_name": "definition_activity_01NPLV6UGRGLP6FuxObbTvkNMJ6snqSeWuf",
"name": "Condition Block",
"title": "Are there network objects?",
"type": "logic.if_else",
"base_type": "activity",
"properties": {
"continue_on_failure": false,
"display_name": "Are there network objects?",
"skip_execution": false
},
"object_type": "definition_activity",
"blocks": [
{
"unique_name": "definition_activity_01NPLV7OIU9YY7H9JZcqS8zuijnZkrGKBij",
"name": "Condition Branch",
"title": "No",
"type": "logic.condition_block",
"base_type": "activity",
"properties": {
"condition": {
"left_operand": "$workflow.definition_workflow_01G5H3DYVBOMA3nhhpXtOd6qFaiGXk6d5dD.output.variable_workflow_01NLEWS56G2WC34qIhthgPFcAYJFNtsaUBC$",
"operator": "eq",
"right_operand": "[]"
},
"continue_on_failure": false,
"display_name": "No",
"skip_execution": false
},
"object_type": "definition_activity",
"actions": [
{
"unique_name": "definition_activity_01NPLVY396GJ90izLZ90RTaCcVxpZnI2kmP",
"name": "Completed",
"title": "No objects message",
"type": "logic.completed",
"base_type": "activity",
"properties": {
"completion_type": "failed-completed",
"continue_on_failure": false,
"display_name": "No objects message",
"result_message": "{\"message\": \"There are no network objects\"}",
"skip_execution": false
},
"object_type": "definition_activity"
}
]
}
]
}
],
"categories": [
"category_01G4JLUINA0E65x8iCa6Behj8y9V0ZE9f8O"
]
},
"categories": {
"category_01G4JLUINA0E65x8iCa6Behj8y9V0ZE9f8O": {
"unique_name": "category_01G4JLUINA0E65x8iCa6Behj8y9V0ZE9f8O",
"name": "Tufin",
"title": "Tufin",
"type": "basic.category",
"base_type": "category",
"description": "Tufin Orchestration Suite",
"category_type": "custom",
"object_type": "category"
}
}
}