Nav apraksta

sample-webhook-soc-integrator-iris-workflow.json 7.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  1. {
  2. "workflow_as_code": false,
  3. "actions": [
  4. {
  5. "app_name": "Shuffle Tools",
  6. "app_version": "1.2.0",
  7. "description": "Accept payload input from workflow execute API (soc-integrator).",
  8. "app_id": "0671c57b-3af6-43f7-9501-b2f916c127c8",
  9. "errors": [],
  10. "id": "f3f0f67c-a63f-4b18-b8be-25128f30f5ec",
  11. "is_valid": true,
  12. "isStartNode": true,
  13. "sharing": true,
  14. "label": "Input Trigger (SOC Integrator Payload)",
  15. "public": true,
  16. "generated": false,
  17. "large_image": "",
  18. "environment": "Shuffle",
  19. "name": "repeat_back_to_me",
  20. "parameters": [
  21. {
  22. "name": "call",
  23. "value": "{\"event_id\":\"evt-001\",\"source\":\"soc-integrator\",\"severity\":\"high\",\"title\":\"Suspicious event\",\"description\":\"Detected by SOC rule\",\"integrator_url\":\"http://soc-integrator:8080\",\"internal_key\":\"\"}",
  24. "description": "JSON payload string from soc-integrator.",
  25. "required": false,
  26. "multiline": true,
  27. "multiselect": false,
  28. "options": null,
  29. "action_field": "",
  30. "variant": "",
  31. "configuration": false,
  32. "tags": null,
  33. "schema": {
  34. "type": ""
  35. },
  36. "skip_multicheck": false,
  37. "value_replace": null,
  38. "unique_toggled": false,
  39. "error": "",
  40. "hidden": false
  41. }
  42. ],
  43. "execution_variable": {
  44. "description": "",
  45. "id": "",
  46. "name": "",
  47. "value": ""
  48. },
  49. "position": {
  50. "x": 100,
  51. "y": 120
  52. },
  53. "authentication_id": "",
  54. "category": "",
  55. "reference_url": "",
  56. "sub_action": false,
  57. "run_magic_output": false,
  58. "run_magic_input": false,
  59. "execution_delay": 0,
  60. "category_label": null,
  61. "suggestion": false,
  62. "parent_controlled": false,
  63. "source_workflow": "",
  64. "source_execution": ""
  65. },
  66. {
  67. "app_name": "Shuffle Tools",
  68. "app_version": "1.2.0",
  69. "description": "Condition check + create IRIS ticket through soc-integrator when matched.",
  70. "app_id": "0671c57b-3af6-43f7-9501-b2f916c127c8",
  71. "errors": [],
  72. "id": "b6dce5f3-0315-4e93-a1a2-9cc4e3f6fb8f",
  73. "is_valid": true,
  74. "isStartNode": false,
  75. "sharing": true,
  76. "label": "Condition Match + Create IRIS Ticket",
  77. "public": true,
  78. "generated": false,
  79. "large_image": "",
  80. "environment": "Shuffle",
  81. "name": "execute_python",
  82. "parameters": [
  83. {
  84. "name": "code",
  85. "value": "import json\\nimport requests\\n\\nraw = str(\"{{actions.f3f0f67c-a63f-4b18-b8be-25128f30f5ec.call}}\" or \"\").strip()\\npayload_in = {}\\nif raw:\\n try:\\n payload_in = json.loads(raw)\\n except Exception:\\n # If not valid JSON, keep backward compatibility with key=value text.\\n payload_in = {}\\n\\nevent_id = str(payload_in.get(\"event_id\", \"\")).strip()\\nsource = str(payload_in.get(\"source\", \"\")).strip().lower()\\nseverity = str(payload_in.get(\"severity\", \"\")).strip().lower()\\ntitle = str(payload_in.get(\"title\", \"SOC alert\")).strip()\\ndescription = str(payload_in.get(\"description\", \"\")).strip()\\nintegrator_url = str(payload_in.get(\"integrator_url\", \"http://soc-integrator:8080\")).strip().rstrip(\"/\")\\ninternal_key = str(payload_in.get(\"internal_key\", \"\")).strip()\\n\\nmatch_source = source in {\"soc-integrator\", \"wazuh\", \"fortigate\"}\\nmatch_severity = severity in {\"high\", \"critical\"}\\nmatched = match_source and match_severity\\n\\nresult = {\\n \"matched\": matched,\\n \"event_id\": event_id,\\n \"source\": source,\\n \"severity\": severity,\\n \"condition\": \"(source in [soc-integrator,wazuh,fortigate]) AND (severity in [high,critical])\"\\n}\\n\\nif not matched:\\n result[\"status\"] = \"skipped\"\\n print(json.dumps(result))\\n raise SystemExit(0)\\n\\nendpoint = f\"{integrator_url}/action/create-iris-case\"\\n\\npayload = {\\n \"title\": title,\\n \"severity\": severity,\\n \"source\": source,\\n \"event_id\": event_id,\\n \"payload\": {\\n \"description\": description\\n }\\n}\\n\\nheaders = {\"Content-Type\": \"application/json\"}\\nif internal_key:\\n headers[\"X-Internal-Key\"] = internal_key\\n\\nresp = requests.post(endpoint, json=payload, headers=headers, timeout=20, verify=False)\\nresult[\"status\"] = \"ticket_create_called\"\\nresult[\"endpoint\"] = endpoint\\nresult[\"http_status\"] = resp.status_code\\ntry:\\n result[\"response\"] = resp.json()\\nexcept Exception:\\n result[\"response_text\"] = resp.text[:1200]\\n\\nprint(json.dumps(result))",
  86. "description": "Parses input JSON and creates IRIS case if matched.",
  87. "required": true,
  88. "multiline": true,
  89. "multiselect": false,
  90. "options": null,
  91. "action_field": "",
  92. "variant": "",
  93. "configuration": false,
  94. "tags": null,
  95. "schema": {
  96. "type": ""
  97. },
  98. "skip_multicheck": false,
  99. "value_replace": null,
  100. "unique_toggled": false,
  101. "error": "",
  102. "hidden": false
  103. }
  104. ],
  105. "execution_variable": {
  106. "description": "",
  107. "id": "",
  108. "name": "",
  109. "value": ""
  110. },
  111. "position": {
  112. "x": 460,
  113. "y": 120
  114. },
  115. "authentication_id": "",
  116. "category": "",
  117. "reference_url": "",
  118. "sub_action": false,
  119. "run_magic_output": false,
  120. "run_magic_input": false,
  121. "execution_delay": 0,
  122. "category_label": null,
  123. "suggestion": false,
  124. "parent_controlled": false,
  125. "source_workflow": "",
  126. "source_execution": ""
  127. }
  128. ],
  129. "branches": [
  130. {
  131. "id": "branch-webhook-to-condition",
  132. "source": "f3f0f67c-a63f-4b18-b8be-25128f30f5ec",
  133. "destination": "b6dce5f3-0315-4e93-a1a2-9cc4e3f6fb8f",
  134. "success": true,
  135. "label": ""
  136. }
  137. ],
  138. "visual_branches": null,
  139. "triggers": [],
  140. "comments": [],
  141. "configuration": {
  142. "exit_on_error": false,
  143. "start_from_top": false,
  144. "skip_notifications": false
  145. },
  146. "created": 1772102400,
  147. "edited": 1772102400,
  148. "last_runtime": 0,
  149. "due_date": 0,
  150. "id": "6f8d2c8a-6c42-4bc7-9f33-f3e8b42b0b80",
  151. "is_valid": true,
  152. "name": "Sample - Webhook from soc-integrator to IRIS Ticket",
  153. "description": "Receives webhook payload, checks source/severity condition, and creates IRIS ticket via soc-integrator when matched.",
  154. "start": "f3f0f67c-a63f-4b18-b8be-25128f30f5ec",
  155. "owner": "root",
  156. "sharing": "private",
  157. "org_id": "",
  158. "workflow_variables": null,
  159. "execution_environment": "",
  160. "previously_saved": true,
  161. "categories": {
  162. "cases": {
  163. "name": "cases",
  164. "count": 0,
  165. "id": "",
  166. "description": "",
  167. "large_image": ""
  168. }
  169. },
  170. "example_argument": "",
  171. "public": false,
  172. "default_return_value": "",
  173. "contact_info": {
  174. "name": "",
  175. "url": ""
  176. },
  177. "published_id": "",
  178. "revision_id": "",
  179. "usecase_ids": null,
  180. "input_questions": null,
  181. "form_control": {
  182. "input_markdown": "",
  183. "output_yields": null,
  184. "cleanup_actions": null,
  185. "form_width": 0
  186. },
  187. "blogpost": "",
  188. "video": "",
  189. "status": "test",
  190. "workflow_type": "",
  191. "generated": false,
  192. "hidden": false,
  193. "background_processing": false,
  194. "updated_by": "root",
  195. "validated": false
  196. }