-
Notifications
You must be signed in to change notification settings - Fork 1
/
Tufin Submit Server Decom Request.json
395 lines (395 loc) · 17.9 KB
/
Tufin Submit Server Decom Request.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
{
"workflow": {
"unique_name": "definition_workflow_01G943M8DJPWH1Jm0QfMFVvJf5nRkNdHk3K",
"name": "Tufin - Submit Server Decommission Request",
"title": "Tufin - Submit Server Decommission Request",
"type": "generic.workflow",
"base_type": "workflow",
"variables": [
{
"schema_id": "datatype.string",
"properties": {
"value": "",
"scope": "input",
"name": "Priority",
"type": "datatype.string",
"description": "Ticket priority (Acceptable values are: Critical, High, Normal, Low)",
"is_required": true,
"is_invisible": false
},
"unique_name": "variable_workflow_01G943M609WB567jbLATBSvnf6n3niE3uLn",
"object_type": "variable_workflow"
},
{
"schema_id": "datatype.string",
"properties": {
"value": "",
"scope": "input",
"name": "Subject",
"type": "datatype.string",
"description": "Request subject",
"is_required": true,
"is_invisible": false
},
"unique_name": "variable_workflow_01G943M60A8NF1GIOk9aAzGNRF1E5sxT0Uu",
"object_type": "variable_workflow"
},
{
"schema_id": "datatype.string",
"properties": {
"value": "{\n \"ticket\": {\n \"subject\": \"\",\n \"priority\": \"\",\n \"workflow\": {\n \"name\": \"Server Decommission Request\",\n \"uses_topology\": false\n },\n \"steps\": {\n \"step\": [\n {\n \"name\": \"Server Decommission Request\",\n \"tasks\": {\n \"task\": {\n \"fields\": {\n \"field\": {\n \"@xsi.type\": \"multi_server_decommission_request\",\n \"name\": \"Request verification\",\n \"server_decommission_request\": {\n \"servers\": {\n \"server\": {\n \"@type\": \"IP\",\n \"ip_address\": \"\",\n \"netmask\": \"255.255.255.255\",\n \"cidr\": 32\n }\n },\n \"targets\": {\n \"target\": {\n \"@type\": \"ANY\"\n }\n },\n \"comment\": \"\"\n }\n }\n }\n }\n }\n }\n ]\n },\n \"comments\": \"\"\n }\n}",
"scope": "local",
"name": "Payload Template",
"type": "datatype.string",
"description": "Payload template.\nIf this workflow has been modified from the default, changes to the template may be required.",
"is_required": false,
"is_invisible": false
},
"unique_name": "variable_workflow_01NZULQSVTUZD71COw1bs4rlu51nF7exsTE",
"object_type": "variable_workflow"
},
{
"schema_id": "datatype.string",
"properties": {
"value": "Server Decommission Request",
"scope": "local",
"name": "Workflow Name",
"type": "datatype.string",
"description": "Name of TOS workflow.",
"is_required": false,
"is_invisible": false
},
"unique_name": "variable_workflow_01NZUMDUCNG8S75HcP5S9ZEHpR66hL2JEyF",
"object_type": "variable_workflow"
},
{
"schema_id": "datatype.boolean",
"properties": {
"value": false,
"scope": "output",
"name": "Success",
"type": "datatype.boolean",
"description": "Action completed successfully",
"is_required": false,
"is_invisible": false
},
"unique_name": "variable_workflow_01G943M60A3G70ZZhT7Z23lMoRLBP6xPp1T",
"object_type": "variable_workflow"
},
{
"schema_id": "datatype.string",
"properties": {
"value": "",
"scope": "input",
"name": "Comment",
"type": "datatype.string",
"description": "Comment (optional)",
"is_required": false,
"is_invisible": false
},
"unique_name": "variable_workflow_01G943M60A9Y34Tu06rCRbUSGcqNLceb2Pv",
"object_type": "variable_workflow"
},
{
"schema_id": "datatype.string",
"properties": {
"value": "",
"scope": "input",
"name": "IP Address",
"type": "datatype.string",
"description": "IP Address",
"is_required": true,
"is_invisible": false
},
"unique_name": "variable_workflow_01G9NPMUVN7L84MQjDHsxH2Fn4TmCEHp6J4",
"object_type": "variable_workflow"
}
],
"properties": {
"atomic": {
"atomic_group": "Tufin",
"is_atomic": true
},
"delete_workflow_instance": false,
"description": "Submit a server decommission request to Tufin SecureChange. \nNotice! This action uses the schema for the default firewall change request workflow in SecureChange. If this workflow has been modified from the default, changes to the HTTP request activity may be required.\n\nTarget: An HTTP endpoint for your Tufin Orchestration Suite (TOS) external address\n\nAccount Key: HTTP basic with Tufin admin credentials\n\nSteps:\n[] Validate if nessesary data is inputted correctly\n[] Create request payload\n[] Make request to submit a server decommission ticket\n[] Check if request succeeded\n[]> If it did change Success variable to true\n[]> If it didn't return an error\n\nMore information about this API: https://forum.tufin.com/support/kc/rest-api/R21-1/securechangeworkflow/apidoc/#!/Tickets/addTicket",
"display_name": "Tufin - Submit Server Decommission Request",
"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_01G943P0B1UWB6qZxhLWYffvbzoNroqCkG3",
"name": "Condition Block",
"title": "Validate Input: Priority",
"type": "logic.if_else",
"base_type": "activity",
"properties": {
"continue_on_failure": false,
"description": "Validate Input: Priority",
"display_name": "Validate Input: Priority",
"skip_execution": false
},
"object_type": "definition_activity",
"blocks": [
{
"unique_name": "definition_activity_01G943POL9QKI0O564rXQLB5yJdaM1o4pyd",
"name": "Condition Branch",
"title": "Input is Invalid",
"type": "logic.condition_block",
"base_type": "activity",
"properties": {
"condition": {
"left_operand": {
"left_operand": {
"left_operand": {
"left_operand": "$workflow.definition_workflow_01G943M8DJPWH1Jm0QfMFVvJf5nRkNdHk3K.input.variable_workflow_01G943M609WB567jbLATBSvnf6n3niE3uLn$",
"operator": "ne",
"right_operand": "Critical"
},
"operator": "and",
"right_operand": {
"left_operand": "$workflow.definition_workflow_01G943M8DJPWH1Jm0QfMFVvJf5nRkNdHk3K.input.variable_workflow_01G943M609WB567jbLATBSvnf6n3niE3uLn$",
"operator": "ne",
"right_operand": "High"
}
},
"operator": "and",
"right_operand": {
"left_operand": "$workflow.definition_workflow_01G943M8DJPWH1Jm0QfMFVvJf5nRkNdHk3K.input.variable_workflow_01G943M609WB567jbLATBSvnf6n3niE3uLn$",
"operator": "ne",
"right_operand": "Normal"
}
},
"operator": "and",
"right_operand": {
"left_operand": "$workflow.definition_workflow_01G943M8DJPWH1Jm0QfMFVvJf5nRkNdHk3K.input.variable_workflow_01G943M609WB567jbLATBSvnf6n3niE3uLn$",
"operator": "ne",
"right_operand": "Low"
}
},
"continue_on_failure": false,
"description": "Input is Invalid",
"display_name": "Input is Invalid",
"skip_execution": false
},
"object_type": "definition_activity",
"actions": [
{
"unique_name": "definition_activity_01G943Q9YWSZX6QXH9dokc8gr0VgwmPdGf5",
"name": "Failed",
"title": "Failed",
"type": "logic.completed",
"base_type": "activity",
"properties": {
"completion_type": "failed-completed",
"continue_on_failure": false,
"display_name": "Failed",
"result_message": "Priority must be one of: Critical, High, Normal, Low",
"skip_execution": false
},
"object_type": "definition_activity"
}
]
}
]
},
{
"unique_name": "definition_activity_01NZUMNVEJLSC6YqeX4xJTVy4LkwGpX81RX",
"name": "Execute Python Script",
"title": "Create Payload",
"type": "python3.script",
"base_type": "activity",
"properties": {
"action_timeout": 180,
"continue_on_failure": false,
"display_name": "Create Payload",
"script": "import sys, json\n\npayload_template = json.loads(sys.argv[1])\nworkflow_name = sys.argv[2]\nip_address = sys.argv[3]\npriority = sys.argv[4]\nsubject = sys.argv[5]\n\npayload_template['ticket']['workflow']['name'] = workflow_name\npayload_template['ticket']['priority'] = priority\npayload_template['ticket']['subject'] = subject\n\nserver_decommission_request = payload_template['ticket']['steps']['step'][0]['tasks']['task']['fields']['field']['server_decommission_request']\n\nserver_decommission_request['servers']['server']['ip_address'] = ip_address\n\nif len(sys.argv) == 7:\n comment = sys.argv[6]\n server_decommission_request['comment'] = comment\n payload_template['ticket']['comments'] = comment\n\npayload = json.dumps(payload_template)",
"script_arguments": [
"$workflow.definition_workflow_01G943M8DJPWH1Jm0QfMFVvJf5nRkNdHk3K.local.variable_workflow_01NZULQSVTUZD71COw1bs4rlu51nF7exsTE$",
"$workflow.definition_workflow_01G943M8DJPWH1Jm0QfMFVvJf5nRkNdHk3K.local.variable_workflow_01NZUMDUCNG8S75HcP5S9ZEHpR66hL2JEyF$",
"$workflow.definition_workflow_01G943M8DJPWH1Jm0QfMFVvJf5nRkNdHk3K.input.variable_workflow_01G9NPMUVN7L84MQjDHsxH2Fn4TmCEHp6J4$",
"$workflow.definition_workflow_01G943M8DJPWH1Jm0QfMFVvJf5nRkNdHk3K.input.variable_workflow_01G943M609WB567jbLATBSvnf6n3niE3uLn$",
"$workflow.definition_workflow_01G943M8DJPWH1Jm0QfMFVvJf5nRkNdHk3K.input.variable_workflow_01G943M60A8NF1GIOk9aAzGNRF1E5sxT0Uu$",
"$workflow.definition_workflow_01G943M8DJPWH1Jm0QfMFVvJf5nRkNdHk3K.input.variable_workflow_01G943M60A9Y34Tu06rCRbUSGcqNLceb2Pv$"
],
"script_queries": [
{
"script_query": "payload",
"script_query_name": "Payload",
"script_query_type": "string"
}
],
"skip_execution": false
},
"object_type": "definition_activity"
},
{
"unique_name": "definition_activity_01G943TK939J70eBTLmcSyXNY6crKU9WxeH",
"name": "HTTP Request",
"title": "Submit change request",
"type": "web-service.http_request",
"base_type": "activity",
"properties": {
"accept": "application/json",
"action_timeout": 180,
"allow_auto_redirect": true,
"body": "$activity.definition_activity_01NZUMNVEJLSC6YqeX4xJTVy4LkwGpX81RX.output.script_queries.Payload$",
"content_type": "application/json",
"continue_on_error_status_code": true,
"continue_on_failure": true,
"custom_headers": [
{
"name": "cache-control",
"value": "no-cache"
}
],
"description": "Submit the change request to SecureChange",
"display_name": "Submit change request",
"method": "POST",
"relative_url": "/securechangeworkflow/api/securechange/tickets",
"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_01OFSLTIR6U2V0noTXtqKSpgvUE3wp6Dlgn",
"name": "Condition Block",
"title": "Is ticket created successfully?",
"type": "logic.if_else",
"base_type": "activity",
"properties": {
"continue_on_failure": false,
"display_name": "Is ticket created successfully?",
"skip_execution": false
},
"object_type": "definition_activity",
"blocks": [
{
"unique_name": "definition_activity_01OFSLUDTROO11cmVn8UlUwEQRUPbPkqbzl",
"name": "Condition Branch",
"title": "No without status code",
"type": "logic.condition_block",
"base_type": "activity",
"properties": {
"condition": {
"left_operand": "$activity.definition_activity_01G943TK939J70eBTLmcSyXNY6crKU9WxeH.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_01OFST8T8WR3V4qo3NxgMlawls8d82rkoVF",
"name": "Completed",
"title": "Completed",
"type": "logic.completed",
"base_type": "activity",
"properties": {
"completion_type": "failed-completed",
"continue_on_failure": false,
"display_name": "Completed",
"result_message": "Submitting Server Decom Request failed.\n\nmessage: $activity.definition_activity_01G943TK939J70eBTLmcSyXNY6crKU9WxeH.output.error.message$",
"skip_execution": false
},
"object_type": "definition_activity"
}
]
},
{
"unique_name": "definition_activity_01G943VVY8Z0H6VENwbYXBds6NWBSgu52ZR",
"name": "Condition Branch",
"title": "Status != 201 (Failure)",
"type": "logic.condition_block",
"base_type": "activity",
"properties": {
"condition": {
"left_operand": "$activity.definition_activity_01G943TK939J70eBTLmcSyXNY6crKU9WxeH.output.status_code$",
"operator": "ne",
"right_operand": 201
},
"continue_on_failure": false,
"description": "Is the status code something other than 201 indicating failure?",
"display_name": "Status != 201 (Failure)",
"skip_execution": false
},
"object_type": "definition_activity",
"actions": [
{
"unique_name": "definition_activity_01NXY5T3YE5E95YoiIUuBQJiqlSvpQkNt2z",
"name": "Completed",
"title": "Completed",
"type": "logic.completed",
"base_type": "activity",
"properties": {
"completion_type": "failed-completed",
"continue_on_failure": false,
"display_name": "Completed",
"result_message": "Submitting Server Decom Request failed.\n\nstatus_code: $activity.definition_activity_01G943TK939J70eBTLmcSyXNY6crKU9WxeH.output.status_code$;\nmessage: $activity.definition_activity_01G943TK939J70eBTLmcSyXNY6crKU9WxeH.output.response_body$",
"skip_execution": false
},
"object_type": "definition_activity"
}
]
}
]
},
{
"unique_name": "definition_activity_01G943VDDEK187Je8QdUJsE86eZnQ4LcSh0",
"name": "Set Variables",
"title": "Set Response",
"type": "core.set_multiple_variables",
"base_type": "activity",
"properties": {
"continue_on_failure": false,
"description": "Set Success response to True",
"display_name": "Set Response",
"skip_execution": false,
"variables_to_update": [
{
"variable_to_update": "$workflow.definition_workflow_01G943M8DJPWH1Jm0QfMFVvJf5nRkNdHk3K.output.variable_workflow_01G943M60A3G70ZZhT7Z23lMoRLBP6xPp1T$",
"variable_value_new": true
}
]
},
"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"
}
}
}