my_name_is_23232

Untitled

Dec 22nd, 2025
5
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 81.49 KB | None | 0 0
  1. {
  2.   "nodes": [
  3.     {
  4.       "parameters": {
  5.         "rule": {
  6.           "interval": [
  7.             {
  8.               "field": "seconds",
  9.               "secondsInterval": 5
  10.             }
  11.           ]
  12.         }
  13.       },
  14.       "type": "n8n-nodes-base.scheduleTrigger",
  15.       "typeVersion": 1.3,
  16.       "position": [
  17.         -896,
  18.         208
  19.       ],
  20.       "id": "d19aa5a5-5710-4378-9bd0-e421901f9012",
  21.       "name": "Trigger A"
  22.     },
  23.     {
  24.       "parameters": {
  25.         "conditions": {
  26.           "options": {
  27.             "caseSensitive": true,
  28.             "leftValue": "",
  29.             "typeValidation": "strict",
  30.             "version": 3
  31.           },
  32.           "conditions": [
  33.             {
  34.               "id": "77b3b8cf-ef48-4eea-8c54-fe40889728c2",
  35.               "leftValue": "={{ $json[\"MITRE existing\"] }}",
  36.               "rightValue": "",
  37.               "operator": {
  38.                 "type": "boolean",
  39.                 "operation": "true",
  40.                 "singleValue": true
  41.               }
  42.             }
  43.           ],
  44.           "combinator": "and"
  45.         },
  46.         "options": {}
  47.       },
  48.       "type": "n8n-nodes-base.if",
  49.       "typeVersion": 2.3,
  50.       "position": [
  51.         80,
  52.         -128
  53.       ],
  54.       "id": "51dc5773-2e18-49ff-acac-386ce7b93462",
  55.       "name": "MITRE Exist"
  56.     },
  57.     {
  58.       "parameters": {
  59.         "aggregate": "aggregateAllItemData",
  60.         "options": {}
  61.       },
  62.       "type": "n8n-nodes-base.aggregate",
  63.       "typeVersion": 1,
  64.       "position": [
  65.         -256,
  66.         176
  67.       ],
  68.       "id": "72ac2f80-40cf-46c4-a9a2-8f40fd29cf6d",
  69.       "name": "Aggregate"
  70.     },
  71.     {
  72.       "parameters": {
  73.         "sessionIdType": "customKey",
  74.         "sessionKey": "1HTWI3FuNjqRBFHE"
  75.       },
  76.       "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
  77.       "typeVersion": 1.3,
  78.       "position": [
  79.         16,
  80.         368
  81.       ],
  82.       "id": "073b2354-34f0-4f9a-872a-6477da342aa9",
  83.       "name": "Simple Memory"
  84.     },
  85.     {
  86.       "parameters": {
  87.         "promptType": "define",
  88.         "text": "=Here is the batch of detection rules to analyze:\n\n{{ JSON.stringify($json.data) }}",
  89.         "options": {
  90.           "systemMessage": "You are a Senior Detection Engineer and MITRE ATT&CK Specialist. Your task is to analyze security detection rules that lack technique mappings and assign them the most accurate MITRE ATT&CK Enterprise Technique.\n\nINPUT DATA:\nYou will receive a JSON Array of detection rules.\n\nAnalysis Logic (Apply to each rule):\n1- Analyze the Intent: Read the Rule Name and Description to understand what bad behavior is being caught (e.g., Phishing, Persistence, Exfiltration).\n\n2- Verify with Query: Look at the query logic (fields like event.action, process.name) to confirm the technical implementation matches the description.\n\n3- Map: Assign the specific Technique ID (e.g., T1098) and Technique Name. If the rule detects multiple techniques, choose the primary one.\n\n4- Atlas/LLM Rules: If the rule is specific to AI/LLM security (e.g., Bedrock, prohibited topics) and fits MITRE ATLAS, use the ATLAS ID (e.g., AML.T0051) if a standard Enterprise ID (Txxxx) does not fit well.\n\nOutput Format: You must return rule id, rule name, mitre id, technique, and rationale in ONLY a valid JSON object with no markdown formatting:\n\nJSON\n\n{\n  \"rule_id\": \"The original rule_id from input\",\n  \"rule_name\": \"Name of the rule\",\n  \"mitre_id\": \"Txxxx\",\n  \"technique_name\": \"The Technique Name\",\n  \"rationale\": \"A single simple sentence explaining why this logic maps to this technique.\"\n}"
  91.         }
  92.       },
  93.       "type": "@n8n/n8n-nodes-langchain.agent",
  94.       "typeVersion": 3,
  95.       "position": [
  96.         -48,
  97.         176
  98.       ],
  99.       "id": "6fb83e8a-40ef-4ed0-b741-2c9ae216ce45",
  100.       "name": "Map to MITRE Agent"
  101.     },
  102.     {
  103.       "parameters": {
  104.         "jsCode": "// This parses the string output from the AI into actual JSON objects\nconst aiResponse = $input.first().json.output; // Adjust '.output' to whatever the AI node outputs\n\nlet parsedRules = [];\ntry {\n  // Clean up if the AI accidentally added markdown blocks\n  const cleanJson = aiResponse.replace(/```json/g, '').replace(/```/g, '').trim();\n  parsedRules = JSON.parse(cleanJson);\n} catch (error) {\n  // Fallback if JSON is broken\n  parsedRules = [{ error: \"Failed to parse AI response\", raw: aiResponse }];\n}\n\nreturn parsedRules.map(rule => ({ json: rule }));"
  105.       },
  106.       "type": "n8n-nodes-base.code",
  107.       "typeVersion": 2,
  108.       "position": [
  109.         288,
  110.         176
  111.       ],
  112.       "id": "a8c3bc4f-108f-49d4-ab39-56285a9966b5",
  113.       "name": "Parse AI output"
  114.     },
  115.     {
  116.       "parameters": {
  117.         "options": {}
  118.       },
  119.       "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
  120.       "typeVersion": 1,
  121.       "position": [
  122.         -176,
  123.         368
  124.       ],
  125.       "id": "f20ad206-b5ec-441d-a1a0-76573537870d",
  126.       "name": "Google Gemini",
  127.       "credentials": {
  128.         "googlePalmApi": {
  129.           "id": "UUKj0VZzkNCvUPkc",
  130.           "name": "Google Gemini(PaLM) Api account"
  131.         }
  132.       }
  133.     },
  134.     {
  135.       "parameters": {},
  136.       "type": "n8n-nodes-base.merge",
  137.       "typeVersion": 3.2,
  138.       "position": [
  139.         992,
  140.         96
  141.       ],
  142.       "id": "1fb9abf8-a4b0-4fb2-8267-77f358159729",
  143.       "name": "Merge 2",
  144.       "alwaysOutputData": false
  145.     },
  146.     {
  147.       "parameters": {
  148.         "mode": "combine",
  149.         "advanced": true,
  150.         "mergeByFields": {
  151.           "values": [
  152.             {
  153.               "field1": "data.rule_id",
  154.               "field2": "rule_id"
  155.             }
  156.           ]
  157.         },
  158.         "options": {}
  159.       },
  160.       "type": "n8n-nodes-base.merge",
  161.       "typeVersion": 3.2,
  162.       "position": [
  163.         544,
  164.         160
  165.       ],
  166.       "id": "5e06839d-f181-420d-837f-2f2a8281bb8e",
  167.       "name": "Merge 1"
  168.     },
  169.     {
  170.       "parameters": {
  171.         "assignments": {
  172.           "assignments": [
  173.             {
  174.               "id": "b019376b-2a73-42ab-9def-f4e0c1568839",
  175.               "name": "Rule ID",
  176.               "value": "={{ $json.data.rule_id }}",
  177.               "type": "string"
  178.             },
  179.             {
  180.               "id": "9061f1ce-1ae5-46cd-b1ad-49c20fb5fc6c",
  181.               "name": "Rule Name",
  182.               "value": "={{ $json.data.name }}",
  183.               "type": "string"
  184.             },
  185.             {
  186.               "id": "ae4a8cd2-98f0-42e8-bddc-94dcefb154f6",
  187.               "name": "Rule Query",
  188.               "value": "={{ $json.data.query }}",
  189.               "type": "string"
  190.             },
  191.             {
  192.               "id": "3e00ecfb-c4d4-464f-914b-82ab53d93c3e",
  193.               "name": "MITRE Technique",
  194.               "value": "={{ $json.data.tags.length > 0 ? $json.data.tags[0].replace('Mitre Atlas: ', '').replace('Mitre ATT&CK: ', '') : ($json.Threat.length > 0 ? $json.Threat[0].technique[0].id : '') }}",
  195.               "type": "string"
  196.             },
  197.             {
  198.               "id": "6e15f789-ae69-41e5-8039-d2a1543e4db6",
  199.               "name": "Technique Name",
  200.               "value": "={{ $json.data.tags.length > 0 ? $json.data.tags[0].replace('Mitre Atlas: ', '').replace('Mitre ATT&CK: ', '') : ($json.Threat.length > 0 ? $json.Threat[0].technique[0].name : '') }}",
  201.               "type": "string"
  202.             },
  203.             {
  204.               "id": "f762079f-b0e2-4f64-ad50-d558f7f829e1",
  205.               "name": "Mapping Method",
  206.               "value": "Existing",
  207.               "type": "string"
  208.             },
  209.             {
  210.               "id": "684fd484-37e4-42a1-bcec-db75d4632855",
  211.               "name": "Mapping Rationale",
  212.               "value": "=Existing mapping",
  213.               "type": "string"
  214.             },
  215.             {
  216.               "id": "cf340f23-89e6-4a11-ad77-607068856427",
  217.               "name": "Required Fields",
  218.               "value": "={{ $json[\"Required Fields\"] }}",
  219.               "type": "string"
  220.             },
  221.             {
  222.               "id": "afad19fa-2452-40be-829c-db54e4e23f3e",
  223.               "name": "Log Source Covered",
  224.               "value": "={{ $json[\"Log Source Covered\"] }}",
  225.               "type": "string"
  226.             },
  227.             {
  228.               "id": "f100a2c7-469b-4191-84f8-77cf1ffd10f7",
  229.               "name": "Fields Covered",
  230.               "value": "={{ $json[\"Fields Covered\"] }}",
  231.               "type": "string"
  232.             },
  233.             {
  234.               "id": "e18fbd44-8fd5-4d23-a47a-0b9197e328e8",
  235.               "name": "Coverage Notes",
  236.               "value": "={{ $json[\"Coverage Notes\"] }}",
  237.               "type": "string"
  238.             },
  239.             {
  240.               "id": "719eec13-9a0e-4133-8d7d-415b1e18d9bd",
  241.               "name": "Reviewed By",
  242.               "value": "={{ $json[\"Reviewed By\"] }}",
  243.               "type": "string"
  244.             },
  245.             {
  246.               "id": "fc716ffe-5135-4ec0-a485-deba25685c0f",
  247.               "name": "Rule Index",
  248.               "value": "={{ $json.data.index }}",
  249.               "type": "string"
  250.             }
  251.           ]
  252.         },
  253.         "options": {}
  254.       },
  255.       "type": "n8n-nodes-base.set",
  256.       "typeVersion": 3.4,
  257.       "position": [
  258.         560,
  259.         -80
  260.       ],
  261.       "id": "ca38bfb0-6402-4e5b-a68c-75db70133d4e",
  262.       "name": "Reformat 1"
  263.     },
  264.     {
  265.       "parameters": {
  266.         "assignments": {
  267.           "assignments": [
  268.             {
  269.               "id": "61c919a3-0fcd-4475-89ab-21b5a65ac63a",
  270.               "name": "Rule ID",
  271.               "value": "={{ $json.data.rule_id }}",
  272.               "type": "string"
  273.             },
  274.             {
  275.               "id": "dc422ac5-973e-4db0-be03-e6bf19245cf3",
  276.               "name": "Rule Name",
  277.               "value": "={{ $json.data.name }}",
  278.               "type": "string"
  279.             },
  280.             {
  281.               "id": "4815a3e8-7d7f-459d-bb75-a6dcb085751f",
  282.               "name": "Rule Query",
  283.               "value": "={{ $json.data.query }}",
  284.               "type": "string"
  285.             },
  286.             {
  287.               "id": "1e518516-afc4-42f0-a566-03fc5af10887",
  288.               "name": "MITRE Technique",
  289.               "value": "={{ $('Parse AI output').item.json.mitre_id }}",
  290.               "type": "string"
  291.             },
  292.             {
  293.               "id": "cd459136-8872-40fe-8889-4a66f3a457e4",
  294.               "name": "Technique Name",
  295.               "value": "={{ $('Parse AI output').item.json.technique_name }}",
  296.               "type": "string"
  297.             },
  298.             {
  299.               "id": "b75228ea-3f38-402b-9597-9aaa511ee618",
  300.               "name": "Mapping Method",
  301.               "value": "=LLM",
  302.               "type": "string"
  303.             },
  304.             {
  305.               "id": "9d046d11-b118-4ce2-9a64-616641a28a4b",
  306.               "name": "Mapping Rationale",
  307.               "value": "={{ $('Parse AI output').item.json.rationale }}",
  308.               "type": "string"
  309.             },
  310.             {
  311.               "id": "67145de9-c762-4e01-802a-587b4ece1fe8",
  312.               "name": "Required Fields",
  313.               "value": "={{ $('MITRE Exist').item.json[\"Required Fields\"] }}",
  314.               "type": "string"
  315.             },
  316.             {
  317.               "id": "4cde6e15-e78e-4fe7-98bc-e85496fcfd9f",
  318.               "name": "Log Source Covered",
  319.               "value": "=",
  320.               "type": "string"
  321.             },
  322.             {
  323.               "id": "834493b7-47cc-4446-a466-68d092d9aaba",
  324.               "name": "Fields Covered",
  325.               "value": "=",
  326.               "type": "string"
  327.             },
  328.             {
  329.               "id": "b8c7cbd1-d099-4b3f-95c6-5744fcb57165",
  330.               "name": "Coverage Notes",
  331.               "value": "={{ $('MITRE Exist').item.json[\"Coverage Notes\"] }}",
  332.               "type": "string"
  333.             },
  334.             {
  335.               "id": "32565562-10dd-440c-84dc-e4cdec43f4c2",
  336.               "name": "Reviewed By",
  337.               "value": "={{ $json[\"Reviewed By\"] }}",
  338.               "type": "string"
  339.             },
  340.             {
  341.               "id": "1b8d3d72-3ea4-4880-9254-d505d919e522",
  342.               "name": "Rule Index",
  343.               "value": "={{ $json.data.index }}",
  344.               "type": "string"
  345.             }
  346.           ]
  347.         },
  348.         "options": {}
  349.       },
  350.       "type": "n8n-nodes-base.set",
  351.       "typeVersion": 3.4,
  352.       "position": [
  353.         752,
  354.         160
  355.       ],
  356.       "id": "1212bb5f-a011-41bf-b26c-3951d6f167ac",
  357.       "name": "Reformat 2"
  358.     },
  359.     {
  360.       "parameters": {
  361.         "assignments": {
  362.           "assignments": [
  363.             {
  364.               "id": "b8b862dd-acce-44e0-8702-36f0b0d0911c",
  365.               "name": "data.rule_id",
  366.               "value": "={{ $json.data.rule_id }}",
  367.               "type": "string"
  368.             },
  369.             {
  370.               "id": "84916eb0-694f-45f1-a64b-f7a28724d66b",
  371.               "name": "data.name",
  372.               "value": "={{ $json.data.name }}",
  373.               "type": "string"
  374.             },
  375.             {
  376.               "id": "9ab376c0-ceba-415f-bf54-f0ff08b11bd1",
  377.               "name": "data.description",
  378.               "value": "={{ $json.data.description }}",
  379.               "type": "string"
  380.             },
  381.             {
  382.               "id": "029cca8e-b1cd-4caf-ac0f-8ef40b347b15",
  383.               "name": "data.query",
  384.               "value": "={{ $json.data.query.replace(/\\n+/g, ' ').trim() }}",
  385.               "type": "string"
  386.             },
  387.             {
  388.               "id": "e55c6f85-e298-4050-a79c-fff665322e0f",
  389.               "name": "data.tags",
  390.               "value": "={{ $json.data.tags.filter(t => t.startsWith('Mitre')) }}",
  391.               "type": "array"
  392.             },
  393.             {
  394.               "id": "f1188b45-f510-45e7-b313-0d619f09294c",
  395.               "name": "MITRE existing",
  396.               "value": "={{ \n  ($json.data.tags && $json.data.tags.some(t => t.startsWith('Mitre'))) \n  || \n  ($json.data.threat && $json.data.threat.length > 0 && $json.data.threat[0].technique && $json.data.threat[0].technique.length > 0) \n}}",
  397.               "type": "boolean"
  398.             },
  399.             {
  400.               "id": "ba2486fa-3466-42a3-8c04-fff4eba8b3e3",
  401.               "name": "Threat",
  402.               "value": "={{ $json.data.threat }}",
  403.               "type": "array"
  404.             },
  405.             {
  406.               "id": "192445f8-0cc5-4ddc-82dd-f74986992c13",
  407.               "name": "Mapping Method",
  408.               "value": "={{ $json.mitre_existing ? 'Existing' : 'LLM' }}",
  409.               "type": "string"
  410.             },
  411.             {
  412.               "id": "6f0be795-f0dd-4e9d-9fa0-f941528ef632",
  413.               "name": "Mapping Rationale",
  414.               "value": "={{ '' }}",
  415.               "type": "string"
  416.             },
  417.             {
  418.               "id": "330f0fa3-39a5-44d6-a459-b4893b3517e7",
  419.               "name": "Required Fields",
  420.               "value": "={{ $json.data.required_fields.map(f => f.name).join(', ') }}",
  421.               "type": "string"
  422.             },
  423.             {
  424.               "id": "46a3c144-7d06-4a3f-b359-330dd2586189",
  425.               "name": "Log Source Covered",
  426.               "value": "={{ '' }}",
  427.               "type": "string"
  428.             },
  429.             {
  430.               "id": "e9bd835c-7e72-42d6-9012-1b83ebbe7f86",
  431.               "name": "Fields Covered",
  432.               "value": "={{ '' }}",
  433.               "type": "string"
  434.             },
  435.             {
  436.               "id": "f1ae2658-7863-4f75-80dc-fd0e9035e590",
  437.               "name": "Coverage Notes",
  438.               "value": "={{ '' }}",
  439.               "type": "string"
  440.             },
  441.             {
  442.               "id": "472bb85c-4a6c-4681-b07b-0602a8937d32",
  443.               "name": "Reviewed By",
  444.               "value": "Shehab",
  445.               "type": "string"
  446.             },
  447.             {
  448.               "id": "35c0f47b-017e-4caf-9c81-1cfb653f099c",
  449.               "name": "data.index",
  450.               "value": "={{ $json.data?.index ?? null }}",
  451.               "type": "string"
  452.             }
  453.           ]
  454.         },
  455.         "options": {
  456.           "ignoreConversionErrors": false
  457.         }
  458.       },
  459.       "type": "n8n-nodes-base.set",
  460.       "typeVersion": 3.4,
  461.       "position": [
  462.         -176,
  463.         -128
  464.       ],
  465.       "id": "ddb15057-ad6a-47bf-8975-995e64f29ca3",
  466.       "name": "Important Fields For LLM"
  467.     },
  468.     {
  469.       "parameters": {
  470.         "url": "http://208.73.204.77:5601/api/detection_engine/rules/_find?per_page=2000",
  471.         "authentication": "genericCredentialType",
  472.         "genericAuthType": "httpBasicAuth",
  473.         "options": {
  474.           "allowUnauthorizedCerts": false
  475.         }
  476.       },
  477.       "type": "n8n-nodes-base.httpRequest",
  478.       "typeVersion": 4.3,
  479.       "position": [
  480.         -704,
  481.         64
  482.       ],
  483.       "id": "3fe64ee0-f237-42fb-92cb-bca9ce94d0dd",
  484.       "name": "Get Rules",
  485.       "executeOnce": false,
  486.       "retryOnFail": false,
  487.       "credentials": {
  488.         "httpBasicAuth": {
  489.           "id": "k42XGGNE51AgavbK",
  490.           "name": "Elastic OJT creds"
  491.         }
  492.       },
  493.       "onError": "continueRegularOutput"
  494.     },
  495.     {
  496.       "parameters": {
  497.         "conditions": {
  498.           "options": {
  499.             "caseSensitive": true,
  500.             "leftValue": "",
  501.             "typeValidation": "strict",
  502.             "version": 3
  503.           },
  504.           "conditions": [
  505.             {
  506.               "id": "a240939c-3b6e-4593-a369-d7f3e88b8176",
  507.               "leftValue": "={{ $json.data.enabled }}",
  508.               "rightValue": true,
  509.               "operator": {
  510.                 "type": "boolean",
  511.                 "operation": "equals"
  512.               }
  513.             }
  514.           ],
  515.           "combinator": "and"
  516.         },
  517.         "options": {}
  518.       },
  519.       "type": "n8n-nodes-base.filter",
  520.       "typeVersion": 2.3,
  521.       "position": [
  522.         -352,
  523.         -128
  524.       ],
  525.       "id": "9b42061a-bab7-4790-8d9f-3da8b759b7c7",
  526.       "name": "Filter Enabled Rules"
  527.     },
  528.     {
  529.       "parameters": {
  530.         "fieldToSplitOut": "data",
  531.         "include": "allOtherFields",
  532.         "options": {}
  533.       },
  534.       "type": "n8n-nodes-base.splitOut",
  535.       "typeVersion": 1,
  536.       "position": [
  537.         -528,
  538.         -64
  539.       ],
  540.       "id": "a5bd7b29-dd4a-487e-a477-8def57772926",
  541.       "name": "Split Out 1",
  542.       "onError": "continueRegularOutput"
  543.     },
  544.     {
  545.       "parameters": {
  546.         "jsCode": "const itemsByTechnique = {};\n\nfor (const item of items) {\n  const techId = item.json[\"MITRE Technique\"];\n  const techName = item.json[\"Technique Name\"];\n\n  if (!itemsByTechnique[techId]) {\n    itemsByTechnique[techId] = {\n      technique_id: techId,\n      technique_name: techName,\n      count: 0,\n    };\n  }\n\n  itemsByTechnique[techId].count++;\n}\n\nconst output = [];\n\nfor (const tech of Object.values(itemsByTechnique)) {\n  let coverage;\n  let notes;\n\nif (tech.count >= 5) {\n  coverage = \"Good\";\n  notes = \"\";\n} else if (tech.count >= 1) {\n  coverage = \"Partial\";\n  notes = \"Missing fields\";\n} else {\n  coverage = \"Broken\";\n  notes = \"No telemetry\";\n}\n\n\noutput.push({\n  json: {\n    // 1. The ID column (Clickable Formula)\n    \"Technique ID\": `=HYPERLINK(\"https://attack.mitre.org/techniques/${\n      tech.technique_id.includes('.') \n        ? tech.technique_id.replace('.', '/') \n        : tech.technique_id\n    }\", \"${tech.technique_id}\")`,\n\n    \"Technique Name\": tech.technique_name, \n\n    \"Rules Mapped Count\": tech.count,\n    \"Covered By Telemetry\": coverage,\n    \"Coverage Notes\": notes,\n  },\n});\n\n\n}\n\nreturn output;\n"
  547.       },
  548.       "type": "n8n-nodes-base.code",
  549.       "typeVersion": 2,
  550.       "position": [
  551.         1184,
  552.         320
  553.       ],
  554.       "id": "3969712f-9d34-42f3-b582-1192ad15aeae",
  555.       "name": "MITRE Coverage Sheet"
  556.     },
  557.     {
  558.       "parameters": {
  559.         "assignments": {
  560.           "assignments": [
  561.             {
  562.               "id": "1f612020-e810-43e4-ab2f-e85ad13e0930",
  563.               "name": "Rule ID",
  564.               "value": "={{ $json[\"Rule ID\"] }}",
  565.               "type": "string"
  566.             },
  567.             {
  568.               "id": "cf7a50ee-b71d-4342-a698-5843b493ccb8",
  569.               "name": "Rule Name",
  570.               "value": "={{ $json[\"Rule Name\"] }}",
  571.               "type": "string"
  572.             },
  573.             {
  574.               "id": "56b53d9c-9680-449b-8e51-bfad8c32abc9",
  575.               "name": "Rule Query",
  576.               "value": "={{ $json[\"Rule Query\"] }}",
  577.               "type": "string"
  578.             },
  579.             {
  580.               "id": "d324768b-cc0d-4684-bf1a-416b41062c1b",
  581.               "name": "Rule Index",
  582.               "value": "={{ JSON.parse($json[\"Rule Index\"]).join(\", \") }}",
  583.               "type": "string"
  584.             },
  585.             {
  586.               "id": "7197209d-d562-4ebf-9a19-81fbe2fd9285",
  587.               "name": "MITRE Technique",
  588.               "value": "==HYPERLINK(\n  \"https://attack.mitre.org/techniques/{{ $json[\"MITRE Technique\"].includes('.') ? $json[\"MITRE Technique\"].replace('.', '/') + '/' : $json[\"MITRE Technique\"] + '/' }}\",\n  \"{{ $json[\"MITRE Technique\"] }}\"\n)\n",
  589.               "type": "string"
  590.             },
  591.             {
  592.               "id": "73d463d7-a1d0-46e0-8ea3-07e273d255e9",
  593.               "name": "Mapping Method",
  594.               "value": "={{ $json[\"Mapping Method\"] }}",
  595.               "type": "string"
  596.             },
  597.             {
  598.               "id": "3286ccb8-1c32-4a79-b588-fc7b654a94f0",
  599.               "name": "Mapping Rationale",
  600.               "value": "={{ $json[\"Mapping Rationale\"] }}",
  601.               "type": "string"
  602.             },
  603.             {
  604.               "id": "77572f5f-2ec0-4eab-bb23-5cb61facd2fd",
  605.               "name": "Required Fields",
  606.               "value": "={{ $json[\"Required Fields\"] }}",
  607.               "type": "string"
  608.             },
  609.             {
  610.               "id": "b1c2631c-e528-42e6-b2e7-6b75c50c0224",
  611.               "name": "Log Source Covered",
  612.               "value": "={{ $json[\"Log Source Covered\"] }}",
  613.               "type": "string"
  614.             },
  615.             {
  616.               "id": "bca94689-98bf-4708-90ec-a7568e1c7ea3",
  617.               "name": "Fields Covered",
  618.               "value": "={{ $json[\"Fields Covered\"] }}",
  619.               "type": "string"
  620.             },
  621.             {
  622.               "id": "4cf49151-6e1f-47f0-909c-dfbdafc8bec9",
  623.               "name": "Coverage Notes",
  624.               "value": "={{ $json[\"Coverage Notes\"] }}",
  625.               "type": "string"
  626.             },
  627.             {
  628.               "id": "42241552-3b57-4ea0-8507-abef93c5f8a6",
  629.               "name": "Reviewed By",
  630.               "value": "={{ $json[\"Reviewed By\"] }}",
  631.               "type": "string"
  632.             }
  633.           ]
  634.         },
  635.         "options": {}
  636.       },
  637.       "type": "n8n-nodes-base.set",
  638.       "typeVersion": 3.4,
  639.       "position": [
  640.         1232,
  641.         96
  642.       ],
  643.       "id": "e377e355-fee5-4b73-82ff-b1b515fd9e65",
  644.       "name": "Rules Sheet"
  645.     },
  646.     {
  647.       "parameters": {
  648.         "operation": "appendOrUpdate",
  649.         "documentId": {
  650.           "__rl": true,
  651.           "value": "10KcsY87LIDqYkh__e0TUK7tLMszijuiMP70ji9wNZjs",
  652.           "mode": "list",
  653.           "cachedResultName": "Automated Detection Coverage - Shehab",
  654.           "cachedResultUrl": "https://docs.google.com/spreadsheets/d/10KcsY87LIDqYkh__e0TUK7tLMszijuiMP70ji9wNZjs/edit?usp=drivesdk"
  655.         },
  656.         "sheetName": {
  657.           "__rl": true,
  658.           "value": "gid=0",
  659.           "mode": "list",
  660.           "cachedResultName": "Rules Sheet",
  661.           "cachedResultUrl": "https://docs.google.com/spreadsheets/d/10KcsY87LIDqYkh__e0TUK7tLMszijuiMP70ji9wNZjs/edit#gid=0"
  662.         },
  663.         "columns": {
  664.           "mappingMode": "autoMapInputData",
  665.           "value": {
  666.             "Rule ID": "={{ $json[\"Rule ID\"] }}",
  667.             "Rule Name": "={{ $json[\"Rule Name\"] }}",
  668.             "Rule Query": "={{ $json[\"Rule Query\"] }}",
  669.             "Rule Index": "={{ $json[\"Rule Index\"] }}",
  670.             "MITRE Technique": "="
  671.           },
  672.           "matchingColumns": [
  673.             "Rule ID"
  674.           ],
  675.           "schema": [
  676.             {
  677.               "id": "Rule ID",
  678.               "displayName": "Rule ID",
  679.               "required": false,
  680.               "defaultMatch": false,
  681.               "display": true,
  682.               "type": "string",
  683.               "canBeUsedToMatch": true,
  684.               "removed": false
  685.             },
  686.             {
  687.               "id": "Rule Name",
  688.               "displayName": "Rule Name",
  689.               "required": false,
  690.               "defaultMatch": false,
  691.               "display": true,
  692.               "type": "string",
  693.               "canBeUsedToMatch": true
  694.             },
  695.             {
  696.               "id": "Rule Query",
  697.               "displayName": "Rule Query",
  698.               "required": false,
  699.               "defaultMatch": false,
  700.               "display": true,
  701.               "type": "string",
  702.               "canBeUsedToMatch": true
  703.             },
  704.             {
  705.               "id": "Rule Index",
  706.               "displayName": "Rule Index",
  707.               "required": false,
  708.               "defaultMatch": false,
  709.               "display": true,
  710.               "type": "string",
  711.               "canBeUsedToMatch": true,
  712.               "removed": false
  713.             },
  714.             {
  715.               "id": "MITRE Technique",
  716.               "displayName": "MITRE Technique",
  717.               "required": false,
  718.               "defaultMatch": false,
  719.               "display": true,
  720.               "type": "string",
  721.               "canBeUsedToMatch": true
  722.             },
  723.             {
  724.               "id": "Mapping Method",
  725.               "displayName": "Mapping Method",
  726.               "required": false,
  727.               "defaultMatch": false,
  728.               "display": true,
  729.               "type": "string",
  730.               "canBeUsedToMatch": true
  731.             },
  732.             {
  733.               "id": "Mapping Rationale",
  734.               "displayName": "Mapping Rationale",
  735.               "required": false,
  736.               "defaultMatch": false,
  737.               "display": true,
  738.               "type": "string",
  739.               "canBeUsedToMatch": true
  740.             },
  741.             {
  742.               "id": "Required Fields",
  743.               "displayName": "Required Fields",
  744.               "required": false,
  745.               "defaultMatch": false,
  746.               "display": true,
  747.               "type": "string",
  748.               "canBeUsedToMatch": true
  749.             },
  750.             {
  751.               "id": "Log Source Covered",
  752.               "displayName": "Log Source Covered",
  753.               "required": false,
  754.               "defaultMatch": false,
  755.               "display": true,
  756.               "type": "string",
  757.               "canBeUsedToMatch": true
  758.             },
  759.             {
  760.               "id": "Fields Covered",
  761.               "displayName": "Fields Covered",
  762.               "required": false,
  763.               "defaultMatch": false,
  764.               "display": true,
  765.               "type": "string",
  766.               "canBeUsedToMatch": true
  767.             },
  768.             {
  769.               "id": "Coverage Notes",
  770.               "displayName": "Coverage Notes",
  771.               "required": false,
  772.               "defaultMatch": false,
  773.               "display": true,
  774.               "type": "string",
  775.               "canBeUsedToMatch": true
  776.             },
  777.             {
  778.               "id": "Reviewed By",
  779.               "displayName": "Reviewed By",
  780.               "required": false,
  781.               "defaultMatch": false,
  782.               "display": true,
  783.               "type": "string",
  784.               "canBeUsedToMatch": true
  785.             }
  786.           ],
  787.           "attemptToConvertTypes": false,
  788.           "convertFieldsToString": false
  789.         },
  790.         "options": {}
  791.       },
  792.       "type": "n8n-nodes-base.googleSheets",
  793.       "typeVersion": 4.7,
  794.       "position": [
  795.         1440,
  796.         96
  797.       ],
  798.       "id": "608edc00-fabf-44fe-9f1e-c000fd2cc657",
  799.       "name": "Rules Table",
  800.       "credentials": {
  801.         "googleSheetsOAuth2Api": {
  802.           "id": "Ij6ijI3slM4jU3nJ",
  803.           "name": "Google Sheets account"
  804.         }
  805.       }
  806.     },
  807.     {
  808.       "parameters": {
  809.         "operation": "appendOrUpdate",
  810.         "documentId": {
  811.           "__rl": true,
  812.           "value": "10KcsY87LIDqYkh__e0TUK7tLMszijuiMP70ji9wNZjs",
  813.           "mode": "list",
  814.           "cachedResultName": "Automated Detection Coverage - Shehab",
  815.           "cachedResultUrl": "https://docs.google.com/spreadsheets/d/10KcsY87LIDqYkh__e0TUK7tLMszijuiMP70ji9wNZjs/edit?usp=drivesdk"
  816.         },
  817.         "sheetName": {
  818.           "__rl": true,
  819.           "value": 2059778413,
  820.           "mode": "list",
  821.           "cachedResultName": "MITRE Coverage",
  822.           "cachedResultUrl": "https://docs.google.com/spreadsheets/d/10KcsY87LIDqYkh__e0TUK7tLMszijuiMP70ji9wNZjs/edit#gid=2059778413"
  823.         },
  824.         "columns": {
  825.           "mappingMode": "autoMapInputData",
  826.           "value": {},
  827.           "matchingColumns": [
  828.             "Technique Name"
  829.           ],
  830.           "schema": [
  831.             {
  832.               "id": "Technique ID",
  833.               "displayName": "Technique ID",
  834.               "required": false,
  835.               "defaultMatch": false,
  836.               "display": true,
  837.               "type": "string",
  838.               "canBeUsedToMatch": true,
  839.               "removed": false
  840.             },
  841.             {
  842.               "id": "Technique Name",
  843.               "displayName": "Technique Name",
  844.               "required": false,
  845.               "defaultMatch": false,
  846.               "display": true,
  847.               "type": "string",
  848.               "canBeUsedToMatch": true,
  849.               "removed": false
  850.             },
  851.             {
  852.               "id": "Rules Mapped Count",
  853.               "displayName": "Rules Mapped Count",
  854.               "required": false,
  855.               "defaultMatch": false,
  856.               "display": true,
  857.               "type": "string",
  858.               "canBeUsedToMatch": true
  859.             },
  860.             {
  861.               "id": "Covered By Telemetry",
  862.               "displayName": "Covered By Telemetry",
  863.               "required": false,
  864.               "defaultMatch": false,
  865.               "display": true,
  866.               "type": "string",
  867.               "canBeUsedToMatch": true
  868.             },
  869.             {
  870.               "id": "Coverage Notes",
  871.               "displayName": "Coverage Notes",
  872.               "required": false,
  873.               "defaultMatch": false,
  874.               "display": true,
  875.               "type": "string",
  876.               "canBeUsedToMatch": true
  877.             },
  878.             {
  879.               "id": "Good -> have 5 or more rules per technique\nPartial -> have more than 1 and less than 5 rule per technique\nBroken -> No rules for this technique",
  880.               "displayName": "Good -> have 5 or more rules per technique\nPartial -> have more than 1 and less than 5 rule per technique\nBroken -> No rules for this technique",
  881.               "required": false,
  882.               "defaultMatch": false,
  883.               "display": true,
  884.               "type": "string",
  885.               "canBeUsedToMatch": true,
  886.               "removed": false
  887.             }
  888.           ],
  889.           "attemptToConvertTypes": false,
  890.           "convertFieldsToString": false
  891.         },
  892.         "options": {}
  893.       },
  894.       "type": "n8n-nodes-base.googleSheets",
  895.       "typeVersion": 4.7,
  896.       "position": [
  897.         1600,
  898.         320
  899.       ],
  900.       "id": "0e3667f1-f402-4250-8ab3-e9ab77c6d20e",
  901.       "name": "MITRE Coverage Table",
  902.       "credentials": {
  903.         "googleSheetsOAuth2Api": {
  904.           "id": "Ij6ijI3slM4jU3nJ",
  905.           "name": "Google Sheets account"
  906.         }
  907.       }
  908.     },
  909.     {
  910.       "parameters": {
  911.         "sortFieldsUi": {
  912.           "sortField": [
  913.             {
  914.               "fieldName": "Rules Mapped Count",
  915.               "order": "descending"
  916.             }
  917.           ]
  918.         },
  919.         "options": {}
  920.       },
  921.       "type": "n8n-nodes-base.sort",
  922.       "typeVersion": 1,
  923.       "position": [
  924.         1392,
  925.         320
  926.       ],
  927.       "id": "2e1c1c85-d2f1-4e0a-97af-b409b79ff13f",
  928.       "name": "Sort"
  929.     },
  930.     {
  931.       "parameters": {
  932.         "content": "## Trigger A",
  933.         "height": 608,
  934.         "width": 2752,
  935.         "color": 3
  936.       },
  937.       "type": "n8n-nodes-base.stickyNote",
  938.       "typeVersion": 1,
  939.       "position": [
  940.         -976,
  941.         -128
  942.       ],
  943.       "id": "43dd8306-ef96-4132-8a93-13b4933298ef",
  944.       "name": "Sticky Note1"
  945.     },
  946.     {
  947.       "parameters": {
  948.         "assignments": {
  949.           "assignments": [
  950.             {
  951.               "id": "42cf10fd-a8e3-4deb-9947-f0a833de069f",
  952.               "name": "Rule ID",
  953.               "value": "={{ $('Get Rules Rows1').item.json[\"Rule ID\"] }}",
  954.               "type": "string"
  955.             },
  956.             {
  957.               "id": "3ac7403a-ed7f-404e-83c5-6a12440913e2",
  958.               "name": "Rule Name",
  959.               "value": "={{ $('Get Rules Rows1').item.json[\"Rule Name\"] }}",
  960.               "type": "string"
  961.             },
  962.             {
  963.               "id": "b18dd293-f1bd-4d04-91d6-8729403c3de8",
  964.               "name": "Exclusion Reason",
  965.               "value": "={{ ($json['Log Source Covered'] === true && $json['Fields Covered'] === true) ? 'Accepted rule' : $json['Coverage Notes'] }}",
  966.               "type": "string"
  967.             },
  968.             {
  969.               "id": "3cd52f3c-2c8b-4295-96ff-46930cad12cf",
  970.               "name": "Reviewed By",
  971.               "value": "Shehab ",
  972.               "type": "string"
  973.             }
  974.           ]
  975.         },
  976.         "options": {}
  977.       },
  978.       "type": "n8n-nodes-base.set",
  979.       "typeVersion": 3.4,
  980.       "position": [
  981.         1168,
  982.         1072
  983.       ],
  984.       "id": "cd0d452a-0bb6-46f4-b38a-b1881e31b020",
  985.       "name": "Format 2"
  986.     },
  987.     {
  988.       "parameters": {
  989.         "assignments": {
  990.           "assignments": [
  991.             {
  992.               "id": "9cdd6c3b-09be-470d-bbd1-2b5a489142ec",
  993.               "name": "Rule Name",
  994.               "value": "={{ $json[\"Rule Name\"] }}",
  995.               "type": "string"
  996.             },
  997.             {
  998.               "id": "82350fda-23ce-4aaa-bc7c-af13b59c7fe0",
  999.               "name": "Log Source Covered",
  1000.               "value": false,
  1001.               "type": "boolean"
  1002.             },
  1003.             {
  1004.               "id": "145761c0-dc2f-4f04-8d2e-ee229d8e75e7",
  1005.               "name": "Fields Covered",
  1006.               "value": false,
  1007.               "type": "boolean"
  1008.             },
  1009.             {
  1010.               "id": "9f17acd9-8ac3-45ad-a038-6d5650eef1fc",
  1011.               "name": "Coverage Notes",
  1012.               "value": "No log source found",
  1013.               "type": "string"
  1014.             }
  1015.           ]
  1016.         },
  1017.         "options": {}
  1018.       },
  1019.       "type": "n8n-nodes-base.set",
  1020.       "typeVersion": 3.4,
  1021.       "position": [
  1022.         864,
  1023.         944
  1024.       ],
  1025.       "id": "a42313e3-117e-4da6-8d02-a0a0fcc7b189",
  1026.       "name": "Format"
  1027.     },
  1028.     {
  1029.       "parameters": {
  1030.         "mode": "combine",
  1031.         "fieldsToMatchString": "[\"Log Source Name\"]",
  1032.         "options": {}
  1033.       },
  1034.       "type": "n8n-nodes-base.merge",
  1035.       "typeVersion": 3.2,
  1036.       "position": [
  1037.         720,
  1038.         704
  1039.       ],
  1040.       "id": "55108d27-0c17-4f4c-96bb-6cc45a5d1c4e",
  1041.       "name": "Merge"
  1042.     },
  1043.     {
  1044.       "parameters": {
  1045.         "jsCode": "// Normalize fields: lowercase and trimmed\nfunction normalizeFields(fields) {\n  if (!fields) return [];\n  return fields.split(',').map(f => f.trim().toLowerCase()).filter(f => f.length > 0);\n}\n\n// Check which required fields are covered and which are missing\nfunction checkFields(requiredFields, availableFields) {\n  const availableSet = new Set(availableFields.map(f => f.toLowerCase().trim()));\n  const missing = requiredFields.filter(f => !availableSet.has(f.toLowerCase().trim()));\n  const allCovered = missing.length === 0;\n  return { allCovered, missing };\n}\n\n// Map log source from index keywords\nconst LOG_SOURCES_INDEX = {\n  \"Elastic Agent\": \"elastic_agent\",\n  \"Endpoint – Elastic Agent Security\": \"endpoint_security\",\n  \"Elastic Agent Filebeat\": \"filebeat\",\n  \"Elastic Agent Fleet Server\": \"fleet_server\",\n  \"Elastic Agent Metricbeat\": \"metricbeat\",\n  \"Elastic Agent Packetbeat\": \"packetbeat\",\n  \"Elastic Agent Status Change\": \"status_change\",\n  \"Endpoint – Events File\": \"endpoint.events.file\",\n  \"Endpoint – Events Library\": \"endpoint.events.library\",\n  \"Endpoint – Events Network\": \"endpoint.events.network\",\n  \"Endpoint – Events Process\": \"endpoint.events.process\",\n  \"Endpoint – Events Registry\": \"endpoint.events.registry\",\n  \"Network Traffic DHCPv4\": \"network_traffic.dhcpv4\",\n  \"Network Traffic DNS\": \"network_traffic.dns\",\n  \"Network Traffic Flow\": \"network_traffic.flow\",\n  \"Network Traffic HTTP\": \"network_traffic.http\",\n  \"Network Traffic ICMP\": \"network_traffic.icmp\",\n  \"Network Traffic TLS\": \"network_traffic.tls\",\n  \"System Application\": \"system.application\",\n  \"System Security\": \"system.security\",\n  \"System System\": \"system.system\",\n  \"Windows PowerShell\": \"windows.powershell\",\n  \"Windows PowerShell Operational\": \"windows.powershell_operational\",\n  \"Windows Sysmon Operational\": \"windows.sysmon_operational\",\n  \"Windows Windows Defender\": \"windows.windows_defender\",\n  \"Winlog Winlog\": \"winlog.winlog\"\n};\n\n// Detect log source from rule index\nfunction detectLogSource(ruleIndex) {\n  if (!ruleIndex) return \"No log source\";\n  const indices = ruleIndex.split(\",\").map(i => i.trim().toLowerCase());\n  for (const idx of indices) {\n    for (const [source, keyword] of Object.entries(LOG_SOURCES_INDEX)) {\n      if (idx.includes(keyword)) {\n        return source;\n      }\n    }\n  }\n  return \"No log source\";\n}\n\nconst output = [];\n\nfor (const item of $input.all()) {\n  const rule = item.json;\n\n  const detectedLogSource = detectLogSource(rule[\"Rule Index\"]);\n  const logSourceCovered = detectedLogSource !== \"No log source\";\n\n  const availableFields = normalizeFields(rule[\"Fields Available\"]);\n  const requiredFields = normalizeFields(rule[\"Required Fields\"]);\n\n  const { allCovered, missing } = checkFields(requiredFields, availableFields);\n\n  // Decide Coverage Notes\n  let coverageNotes = \"\";\n  if (!logSourceCovered && !allCovered) coverageNotes = \"No log source found and missing required fields\";\n  else if (!logSourceCovered) coverageNotes = \"No log source found\";\n  else if (!allCovered) coverageNotes = `Missing required fields: ${missing.join(', ')}`;\n  else coverageNotes = \"All fields present\";\n\n  output.push({\n    json: {\n      \"Rule Name\": rule[\"Rule Name\"],\n      \"Log Source Covered\": logSourceCovered,\n      \"Fields Covered\": allCovered,\n      \"Coverage Notes\": coverageNotes\n    }\n  });\n}\n\nreturn output;\n"
  1046.       },
  1047.       "type": "n8n-nodes-base.code",
  1048.       "typeVersion": 2,
  1049.       "position": [
  1050.         928,
  1051.         704
  1052.       ],
  1053.       "id": "7c30b6f2-cf04-40e6-8699-499d2cf45138",
  1054.       "name": "Updating code"
  1055.     },
  1056.     {
  1057.       "parameters": {
  1058.         "rules": {
  1059.           "values": [
  1060.             {
  1061.               "conditions": {
  1062.                 "options": {
  1063.                   "caseSensitive": true,
  1064.                   "leftValue": "",
  1065.                   "typeValidation": "strict",
  1066.                   "version": 3
  1067.                 },
  1068.                 "conditions": [
  1069.                   {
  1070.                     "leftValue": "={{ $json[\"Log Source Name\"] }}",
  1071.                     "rightValue": "No log source",
  1072.                     "operator": {
  1073.                       "type": "string",
  1074.                       "operation": "notEquals"
  1075.                     },
  1076.                     "id": "34a2c78a-eb95-4619-893a-d4c6f6376e9b"
  1077.                   }
  1078.                 ],
  1079.                 "combinator": "and"
  1080.               },
  1081.               "renameOutput": true,
  1082.               "outputKey": "Has Log Source "
  1083.             },
  1084.             {
  1085.               "conditions": {
  1086.                 "options": {
  1087.                   "caseSensitive": true,
  1088.                   "leftValue": "",
  1089.                   "typeValidation": "strict",
  1090.                   "version": 3
  1091.                 },
  1092.                 "conditions": [
  1093.                   {
  1094.                     "id": "3115bb9c-e13c-46df-bf41-2409ea2e87d5",
  1095.                     "leftValue": "={{ $json[\"Log Source Name\"] }}",
  1096.                     "rightValue": "No log source",
  1097.                     "operator": {
  1098.                       "type": "string",
  1099.                       "operation": "equals"
  1100.                     }
  1101.                   }
  1102.                 ],
  1103.                 "combinator": "and"
  1104.               },
  1105.               "renameOutput": true,
  1106.               "outputKey": "No Log Source"
  1107.             }
  1108.           ]
  1109.         },
  1110.         "options": {}
  1111.       },
  1112.       "type": "n8n-nodes-base.switch",
  1113.       "typeVersion": 3.4,
  1114.       "position": [
  1115.         464,
  1116.         816
  1117.       ],
  1118.       "id": "9a315c16-dd45-40a5-9be6-307aaa10889b",
  1119.       "name": "Log source check"
  1120.     },
  1121.     {
  1122.       "parameters": {
  1123.         "url": "https://208.73.204.77:9200/_data_stream",
  1124.         "authentication": "genericCredentialType",
  1125.         "genericAuthType": "httpBasicAuth",
  1126.         "options": {
  1127.           "allowUnauthorizedCerts": true
  1128.         }
  1129.       },
  1130.       "type": "n8n-nodes-base.httpRequest",
  1131.       "typeVersion": 4.3,
  1132.       "position": [
  1133.         -528,
  1134.         608
  1135.       ],
  1136.       "id": "f3ce8264-eee5-4d49-857e-0d0a80eacb43",
  1137.       "name": "Get Data Streams1",
  1138.       "credentials": {
  1139.         "httpBasicAuth": {
  1140.           "id": "k42XGGNE51AgavbK",
  1141.           "name": "Elastic OJT creds"
  1142.         }
  1143.       }
  1144.     },
  1145.     {
  1146.       "parameters": {
  1147.         "operation": "appendOrUpdate",
  1148.         "documentId": {
  1149.           "__rl": true,
  1150.           "value": "10KcsY87LIDqYkh__e0TUK7tLMszijuiMP70ji9wNZjs",
  1151.           "mode": "list",
  1152.           "cachedResultName": "Automated Detection Coverage - Shehab",
  1153.           "cachedResultUrl": "https://docs.google.com/spreadsheets/d/10KcsY87LIDqYkh__e0TUK7tLMszijuiMP70ji9wNZjs/edit?usp=drivesdk"
  1154.         },
  1155.         "sheetName": {
  1156.           "__rl": true,
  1157.           "value": "gid=0",
  1158.           "mode": "list",
  1159.           "cachedResultName": "Rules Sheet",
  1160.           "cachedResultUrl": "https://docs.google.com/spreadsheets/d/10KcsY87LIDqYkh__e0TUK7tLMszijuiMP70ji9wNZjs/edit#gid=0"
  1161.         },
  1162.         "columns": {
  1163.           "mappingMode": "autoMapInputData",
  1164.           "value": {
  1165.             "Log Source Covered": "={{ $json[\"Log Source Covered\"] }}",
  1166.             "Fields Covered": "={{ $json[\"Fields Covered\"] }}",
  1167.             "Coverage Notes": "={{ $json[\"Coverage Notes\"] }}",
  1168.             "Rule Name": "={{ $json[\"Rule Name\"] }}"
  1169.           },
  1170.           "matchingColumns": [
  1171.             "Rule Name"
  1172.           ],
  1173.           "schema": [
  1174.             {
  1175.               "id": "Rule ID",
  1176.               "displayName": "Rule ID",
  1177.               "required": false,
  1178.               "defaultMatch": false,
  1179.               "display": true,
  1180.               "type": "string",
  1181.               "canBeUsedToMatch": true
  1182.             },
  1183.             {
  1184.               "id": "Rule Name",
  1185.               "displayName": "Rule Name",
  1186.               "required": false,
  1187.               "defaultMatch": false,
  1188.               "display": true,
  1189.               "type": "string",
  1190.               "canBeUsedToMatch": true,
  1191.               "removed": false
  1192.             },
  1193.             {
  1194.               "id": "Rule Query",
  1195.               "displayName": "Rule Query",
  1196.               "required": false,
  1197.               "defaultMatch": false,
  1198.               "display": true,
  1199.               "type": "string",
  1200.               "canBeUsedToMatch": true
  1201.             },
  1202.             {
  1203.               "id": "Rule Index",
  1204.               "displayName": "Rule Index",
  1205.               "required": false,
  1206.               "defaultMatch": false,
  1207.               "display": true,
  1208.               "type": "string",
  1209.               "canBeUsedToMatch": true
  1210.             },
  1211.             {
  1212.               "id": "MITRE Technique",
  1213.               "displayName": "MITRE Technique",
  1214.               "required": false,
  1215.               "defaultMatch": false,
  1216.               "display": true,
  1217.               "type": "string",
  1218.               "canBeUsedToMatch": true
  1219.             },
  1220.             {
  1221.               "id": "Mapping Method",
  1222.               "displayName": "Mapping Method",
  1223.               "required": false,
  1224.               "defaultMatch": false,
  1225.               "display": true,
  1226.               "type": "string",
  1227.               "canBeUsedToMatch": true
  1228.             },
  1229.             {
  1230.               "id": "Mapping Rationale",
  1231.               "displayName": "Mapping Rationale",
  1232.               "required": false,
  1233.               "defaultMatch": false,
  1234.               "display": true,
  1235.               "type": "string",
  1236.               "canBeUsedToMatch": true
  1237.             },
  1238.             {
  1239.               "id": "Required Fields",
  1240.               "displayName": "Required Fields",
  1241.               "required": false,
  1242.               "defaultMatch": false,
  1243.               "display": true,
  1244.               "type": "string",
  1245.               "canBeUsedToMatch": true
  1246.             },
  1247.             {
  1248.               "id": "Log Source Covered",
  1249.               "displayName": "Log Source Covered",
  1250.               "required": false,
  1251.               "defaultMatch": false,
  1252.               "display": true,
  1253.               "type": "string",
  1254.               "canBeUsedToMatch": true
  1255.             },
  1256.             {
  1257.               "id": "Fields Covered",
  1258.               "displayName": "Fields Covered",
  1259.               "required": false,
  1260.               "defaultMatch": false,
  1261.               "display": true,
  1262.               "type": "string",
  1263.               "canBeUsedToMatch": true
  1264.             },
  1265.             {
  1266.               "id": "Coverage Notes",
  1267.               "displayName": "Coverage Notes",
  1268.               "required": false,
  1269.               "defaultMatch": false,
  1270.               "display": true,
  1271.               "type": "string",
  1272.               "canBeUsedToMatch": true
  1273.             },
  1274.             {
  1275.               "id": "Reviewed By",
  1276.               "displayName": "Reviewed By",
  1277.               "required": false,
  1278.               "defaultMatch": false,
  1279.               "display": true,
  1280.               "type": "string",
  1281.               "canBeUsedToMatch": true
  1282.             }
  1283.           ],
  1284.           "attemptToConvertTypes": false,
  1285.           "convertFieldsToString": false
  1286.         },
  1287.         "options": {}
  1288.       },
  1289.       "type": "n8n-nodes-base.googleSheets",
  1290.       "typeVersion": 4.7,
  1291.       "position": [
  1292.         1376,
  1293.         752
  1294.       ],
  1295.       "id": "09121a9f-40e6-4b40-a0de-3708f743c2e9",
  1296.       "name": "Update Rules Table1",
  1297.       "credentials": {
  1298.         "googleSheetsOAuth2Api": {
  1299.           "id": "Ij6ijI3slM4jU3nJ",
  1300.           "name": "Google Sheets account"
  1301.         }
  1302.       }
  1303.     },
  1304.     {
  1305.       "parameters": {
  1306.         "jsCode": "const LOG_SOURCES_INDEX = {\n  \"Elastic Agent\": \"elastic_agent\",\n  \"Endpoint – Elastic Agent Security\": \"endpoint_security\",\n  \"Elastic Agent Filebeat\": \"filebeat\",\n  \"Elastic Agent Fleet Server\": \"fleet_server\",\n  \"Elastic Agent Metricbeat\": \"metricbeat\",\n  \"Elastic Agent Packetbeat\": \"packetbeat\",\n  \"Elastic Agent Status Change\": \"status_change\",\n  \"Endpoint – Events File\": \"endpoint.events.file\",\n  \"Endpoint – Events Library\": \"endpoint.events.library\",\n  \"Endpoint – Events Network\": \"endpoint.events.network\",\n  \"Endpoint – Events Process\": \"endpoint.events.process\",\n  \"Endpoint – Events Registry\": \"endpoint.events.registry\",\n  \"Network Traffic DHCPv4\": \"network_traffic.dhcpv4\",\n  \"Network Traffic DNS\": \"network_traffic.dns\",\n  \"Network Traffic Flow\": \"network_traffic.flow\",\n  \"Network Traffic HTTP\": \"network_traffic.http\",\n  \"Network Traffic ICMP\": \"network_traffic.icmp\",\n  \"Network Traffic TLS\": \"network_traffic.tls\",\n  \"System Application\": \"system.application\",\n  \"System Security\": \"system.security\",\n  \"System System\": \"system.system\",\n  \"Windows PowerShell\": \"windows.powershell\",\n  \"Windows PowerShell Operational\": \"windows.powershell_operational\",\n  \"Windows Sysmon Operational\": \"windows.sysmon_operational\",\n  \"Windows Windows Defender\": \"windows.windows_defender\",\n  \"Winlog Winlog\": \"winlog.winlog\"\n};\n\nfunction detectLogSource(ruleIndex) {\n  if (!ruleIndex) return \"No log source\";\n\n  const indices = ruleIndex.split(\",\").map(i => i.trim().toLowerCase());\n\n  for (const idx of indices) {\n    for (const [source, keyword] of Object.entries(LOG_SOURCES_INDEX)) {\n      if (idx.includes(keyword)) {\n        return source;\n      }\n    }\n  }\n\n  return \"No log source\";\n}\n\nconst output = items.map(item => {\n  return {\n    json: {\n      ...item.json,\n      \"Log Source Name\": detectLogSource(item.json[\"Rule Index\"])\n    }\n  };\n});\n\nreturn output;\n"
  1307.       },
  1308.       "type": "n8n-nodes-base.code",
  1309.       "typeVersion": 2,
  1310.       "position": [
  1311.         240,
  1312.         816
  1313.       ],
  1314.       "id": "9e25af2c-8eb2-4039-bfa0-dd5b9bba6797",
  1315.       "name": "Maps rules to logsources1"
  1316.     },
  1317.     {
  1318.       "parameters": {
  1319.         "conditions": {
  1320.           "options": {
  1321.             "caseSensitive": true,
  1322.             "leftValue": "",
  1323.             "typeValidation": "strict",
  1324.             "version": 3
  1325.           },
  1326.           "conditions": [
  1327.             {
  1328.               "id": "f324a282-8eb6-4d1d-ad20-95891245ebf2",
  1329.               "leftValue": "={{ $json.data_streams.name }}",
  1330.               "rightValue": "metrics",
  1331.               "operator": {
  1332.                 "type": "string",
  1333.                 "operation": "notContains"
  1334.               }
  1335.             },
  1336.             {
  1337.               "id": "f60429b7-da25-4861-90f7-6ae1408f1085",
  1338.               "leftValue": "={{ $json.data_streams.name }}",
  1339.               "rightValue": ".",
  1340.               "operator": {
  1341.                 "type": "string",
  1342.                 "operation": "notStartsWith"
  1343.               }
  1344.             }
  1345.           ],
  1346.           "combinator": "and"
  1347.         },
  1348.         "options": {}
  1349.       },
  1350.       "type": "n8n-nodes-base.filter",
  1351.       "typeVersion": 2.3,
  1352.       "position": [
  1353.         -80,
  1354.         608
  1355.       ],
  1356.       "id": "370d2d3a-b5e4-427c-b190-7f04352a469a",
  1357.       "name": "Filter1"
  1358.     },
  1359.     {
  1360.       "parameters": {
  1361.         "rule": {
  1362.           "interval": [
  1363.             {
  1364.               "field": "seconds",
  1365.               "secondsInterval": 5
  1366.             }
  1367.           ]
  1368.         }
  1369.       },
  1370.       "type": "n8n-nodes-base.scheduleTrigger",
  1371.       "typeVersion": 1.3,
  1372.       "position": [
  1373.         -752,
  1374.         704
  1375.       ],
  1376.       "id": "e1407bde-967d-4d47-8fde-3bd15b59c9f7",
  1377.       "name": "Trigger B1"
  1378.     },
  1379.     {
  1380.       "parameters": {
  1381.         "fieldToSplitOut": "data_streams",
  1382.         "include": "allOtherFields",
  1383.         "options": {}
  1384.       },
  1385.       "type": "n8n-nodes-base.splitOut",
  1386.       "typeVersion": 1,
  1387.       "position": [
  1388.         -304,
  1389.         608
  1390.       ],
  1391.       "id": "eab87c8b-4223-4e3c-9590-dda7c08223cc",
  1392.       "name": "Split Out "
  1393.     },
  1394.     {
  1395.       "parameters": {
  1396.         "operation": "appendOrUpdate",
  1397.         "documentId": {
  1398.           "__rl": true,
  1399.           "value": "10KcsY87LIDqYkh__e0TUK7tLMszijuiMP70ji9wNZjs",
  1400.           "mode": "list",
  1401.           "cachedResultName": "Automated Detection Coverage - Shehab",
  1402.           "cachedResultUrl": "https://docs.google.com/spreadsheets/d/10KcsY87LIDqYkh__e0TUK7tLMszijuiMP70ji9wNZjs/edit?usp=drivesdk"
  1403.         },
  1404.         "sheetName": {
  1405.           "__rl": true,
  1406.           "value": 706068663,
  1407.           "mode": "list",
  1408.           "cachedResultName": "LogSourceTable",
  1409.           "cachedResultUrl": "https://docs.google.com/spreadsheets/d/10KcsY87LIDqYkh__e0TUK7tLMszijuiMP70ji9wNZjs/edit#gid=706068663"
  1410.         },
  1411.         "columns": {
  1412.           "mappingMode": "autoMapInputData",
  1413.           "value": {},
  1414.           "matchingColumns": [
  1415.             "Log Source Name"
  1416.           ],
  1417.           "schema": [
  1418.             {
  1419.               "id": "Log Source Name",
  1420.               "displayName": "Log Source Name",
  1421.               "required": false,
  1422.               "defaultMatch": false,
  1423.               "display": true,
  1424.               "type": "string",
  1425.               "canBeUsedToMatch": true,
  1426.               "removed": false
  1427.             },
  1428.             {
  1429.               "id": "Index / Data Stream",
  1430.               "displayName": "Index / Data Stream",
  1431.               "required": false,
  1432.               "defaultMatch": false,
  1433.               "display": true,
  1434.               "type": "string",
  1435.               "canBeUsedToMatch": true
  1436.             },
  1437.             {
  1438.               "id": "Fields Available",
  1439.               "displayName": "Fields Available",
  1440.               "required": false,
  1441.               "defaultMatch": false,
  1442.               "display": true,
  1443.               "type": "string",
  1444.               "canBeUsedToMatch": true
  1445.             },
  1446.             {
  1447.               "id": "Parsing Status",
  1448.               "displayName": "Parsing Status",
  1449.               "required": false,
  1450.               "defaultMatch": false,
  1451.               "display": true,
  1452.               "type": "string",
  1453.               "canBeUsedToMatch": true
  1454.             },
  1455.             {
  1456.               "id": "Last Updated",
  1457.               "displayName": "Last Updated",
  1458.               "required": false,
  1459.               "defaultMatch": false,
  1460.               "display": true,
  1461.               "type": "string",
  1462.               "canBeUsedToMatch": true
  1463.             }
  1464.           ],
  1465.           "attemptToConvertTypes": false,
  1466.           "convertFieldsToString": false
  1467.         },
  1468.         "options": {}
  1469.       },
  1470.       "type": "n8n-nodes-base.googleSheets",
  1471.       "typeVersion": 4.7,
  1472.       "position": [
  1473.         816,
  1474.         528
  1475.       ],
  1476.       "id": "16ae6a83-70b0-4c86-a72c-a7e3a8d3d64d",
  1477.       "name": "LogSource Table1",
  1478.       "credentials": {
  1479.         "googleSheetsOAuth2Api": {
  1480.           "id": "Ij6ijI3slM4jU3nJ",
  1481.           "name": "Google Sheets account"
  1482.         }
  1483.       }
  1484.     },
  1485.     {
  1486.       "parameters": {
  1487.         "documentId": {
  1488.           "__rl": true,
  1489.           "value": "10KcsY87LIDqYkh__e0TUK7tLMszijuiMP70ji9wNZjs",
  1490.           "mode": "list",
  1491.           "cachedResultName": "Automated Detection Coverage - Shehab",
  1492.           "cachedResultUrl": "https://docs.google.com/spreadsheets/d/10KcsY87LIDqYkh__e0TUK7tLMszijuiMP70ji9wNZjs/edit?usp=drivesdk"
  1493.         },
  1494.         "sheetName": {
  1495.           "__rl": true,
  1496.           "value": "gid=0",
  1497.           "mode": "list",
  1498.           "cachedResultName": "Rules Sheet",
  1499.           "cachedResultUrl": "https://docs.google.com/spreadsheets/d/10KcsY87LIDqYkh__e0TUK7tLMszijuiMP70ji9wNZjs/edit#gid=0"
  1500.         },
  1501.         "options": {}
  1502.       },
  1503.       "type": "n8n-nodes-base.googleSheets",
  1504.       "typeVersion": 4.7,
  1505.       "position": [
  1506.         -400,
  1507.         896
  1508.       ],
  1509.       "id": "3affc445-15b4-48c2-a437-06e2aa51c3a4",
  1510.       "name": "Get Rules Rows1",
  1511.       "credentials": {
  1512.         "googleSheetsOAuth2Api": {
  1513.           "id": "Ij6ijI3slM4jU3nJ",
  1514.           "name": "Google Sheets account"
  1515.         }
  1516.       }
  1517.     },
  1518.     {
  1519.       "parameters": {
  1520.         "jsCode": "const rows = [];\n\n/**\n * Flatten Elasticsearch mapping fields\n */\nfunction getFlatKeys(obj, prefix = '') {\n  let keys = [];\n\n  for (const key in obj) {\n    if (!Object.prototype.hasOwnProperty.call(obj, key)) continue;\n    const val = obj[key];\n\n    if (key === 'properties' && typeof val === 'object') {\n      keys.push(...getFlatKeys(val, prefix));\n      continue;\n    }\n\n    if (typeof val === 'object' && val !== null && val.properties) {\n      const newPrefix = prefix ? `${prefix}.${key}` : key;\n      keys.push(...getFlatKeys(val, newPrefix));\n      continue;\n    }\n\n    if (key !== 'type') {\n      const fullPath = prefix ? `${prefix}.${key}` : key;\n      if (!fullPath.startsWith('_')) {\n        keys.push(fullPath);\n      }\n    }\n  }\n\n  return keys;\n}\n\n/**\n * Convert backing index name into SOC-friendly log source name\n */\nfunction formatLogSourceName(indexName) {\n  let name = indexName;\n\n  // Remove backing index markers and lifecycle noise\n  name = name\n    .replace(/^\\.ds-/, '')\n    .replace(/^logs-/, '')\n    .replace(/-default.*$/, '');\n\n  // Split hierarchy\n  const parts = name.split(/[._]/);\n\n  const dictionary = {\n    elastic: 'Elastic',\n    elasticagent: 'Elastic Agent',\n    agent: 'Agent',\n    endpoint: 'Endpoint',\n    events: 'Events',\n    security: 'Security',\n    file: 'File',\n    process: 'Process',\n    network: 'Network',\n    registry: 'Registry',\n    library: 'Library',\n    windows: 'Windows',\n    powershell: 'PowerShell',\n    sysmon: 'Sysmon',\n    defender: 'Defender',\n    winlog: 'Winlog',\n    system: 'System',\n    application: 'Application',\n    dns: 'DNS',\n    dhcpv4: 'DHCPv4',\n    tls: 'TLS',\n    icmp: 'ICMP',\n    http: 'HTTP',\n    flow: 'Flow',\n    metricbeat: 'Metricbeat',\n    packetbeat: 'Packetbeat',\n    filebeat: 'Filebeat',\n    fleet: 'Fleet',\n    server: 'Server',\n    status: 'Status',\n    change: 'Change'\n  };\n\n  const words = parts.map(p => {\n    const clean = p.toLowerCase().replace(/[^a-z0-9]/g, '');\n    return dictionary[clean] || clean.charAt(0).toUpperCase() + clean.slice(1);\n  });\n\n  // Build readable structure\n  if (words.includes('Elastic Agent')) {\n    const rest = words.filter(w => w !== 'Elastic Agent');\n    return `Elastic Agent – ${rest.join(' ')}`;\n  }\n\n  if (words.includes('Endpoint')) {\n    return `Endpoint – ${words.filter(w => w !== 'Endpoint').join(' ')}`;\n  }\n\n  return words.join(' ');\n}\n\nfor (const item of $input.all()) {\n  const indexName = Object.keys(item.json)[0];\n  const mappingData = item.json[indexName];\n\n  if (!mappingData || !mappingData.mappings) continue;\n\n  const fields = [...new Set(getFlatKeys(mappingData.mappings))].sort();\n\n  rows.push({\n    json: {\n      \"Log Source Name\": formatLogSourceName(indexName),\n      \"Index / Data Stream\": indexName,\n      \"Fields Available\": fields.join(','),\n      \"Parsing Status\": fields.length ? \"Good\" : \"Broken\",\n      \"Last Updated\": new Date().toISOString().slice(0, 10)\n    }\n  });\n}\n\nreturn rows;\n"
  1521.       },
  1522.       "type": "n8n-nodes-base.code",
  1523.       "typeVersion": 2,
  1524.       "position": [
  1525.         368,
  1526.         608
  1527.       ],
  1528.       "id": "5d1707eb-17c4-4640-b856-48c4acd467dc",
  1529.       "name": "Reformating1"
  1530.     },
  1531.     {
  1532.       "parameters": {
  1533.         "url": "=https://208.73.204.77:9200/{{ $json.data_streams.name }}/_mapping",
  1534.         "authentication": "genericCredentialType",
  1535.         "genericAuthType": "httpBasicAuth",
  1536.         "options": {
  1537.           "allowUnauthorizedCerts": true
  1538.         }
  1539.       },
  1540.       "type": "n8n-nodes-base.httpRequest",
  1541.       "typeVersion": 4.3,
  1542.       "position": [
  1543.         144,
  1544.         608
  1545.       ],
  1546.       "id": "3f0b418a-068d-4ea3-bb2e-effaaf49a81b",
  1547.       "name": "Data stream mapping1",
  1548.       "credentials": {
  1549.         "httpBasicAuth": {
  1550.           "id": "k42XGGNE51AgavbK",
  1551.           "name": "Elastic OJT creds"
  1552.         }
  1553.       }
  1554.     },
  1555.     {
  1556.       "parameters": {
  1557.         "assignments": {
  1558.           "assignments": [
  1559.             {
  1560.               "id": "76a82a4e-3d5b-4f25-86e8-3399d4629113",
  1561.               "name": "Rule Name",
  1562.               "value": "={{ $json[\"Rule Name\"] }}",
  1563.               "type": "string"
  1564.             },
  1565.             {
  1566.               "id": "50292156-41c0-4d56-8bcd-2b4deb9c3b84",
  1567.               "name": "Rule Index",
  1568.               "value": "={{ $json[\"Rule Index\"] }}",
  1569.               "type": "string"
  1570.             },
  1571.             {
  1572.               "id": "4f25113b-0798-4b55-a318-ddd384b8018a",
  1573.               "name": "Required Fields",
  1574.               "value": "={{ $json[\"Required Fields\"] }}",
  1575.               "type": "string"
  1576.             }
  1577.           ]
  1578.         },
  1579.         "options": {}
  1580.       },
  1581.       "type": "n8n-nodes-base.set",
  1582.       "typeVersion": 3.4,
  1583.       "position": [
  1584.         0,
  1585.         832
  1586.       ],
  1587.       "id": "ba8758a0-edfe-40ad-9545-35a9b7008745",
  1588.       "name": "Edit Fields1"
  1589.     },
  1590.     {
  1591.       "parameters": {
  1592.         "operation": "appendOrUpdate",
  1593.         "documentId": {
  1594.           "__rl": true,
  1595.           "value": "10KcsY87LIDqYkh__e0TUK7tLMszijuiMP70ji9wNZjs",
  1596.           "mode": "list",
  1597.           "cachedResultName": "Automated Detection Coverage - Shehab",
  1598.           "cachedResultUrl": "https://docs.google.com/spreadsheets/d/10KcsY87LIDqYkh__e0TUK7tLMszijuiMP70ji9wNZjs/edit?usp=drivesdk"
  1599.         },
  1600.         "sheetName": {
  1601.           "__rl": true,
  1602.           "value": 618184922,
  1603.           "mode": "list",
  1604.           "cachedResultName": "Summary Exclusions",
  1605.           "cachedResultUrl": "https://docs.google.com/spreadsheets/d/10KcsY87LIDqYkh__e0TUK7tLMszijuiMP70ji9wNZjs/edit#gid=618184922"
  1606.         },
  1607.         "columns": {
  1608.           "mappingMode": "autoMapInputData",
  1609.           "value": {},
  1610.           "matchingColumns": [
  1611.             "Rule ID"
  1612.           ],
  1613.           "schema": [
  1614.             {
  1615.               "id": "Rule ID",
  1616.               "displayName": "Rule ID",
  1617.               "required": false,
  1618.               "defaultMatch": false,
  1619.               "display": true,
  1620.               "type": "string",
  1621.               "canBeUsedToMatch": true,
  1622.               "removed": false
  1623.             },
  1624.             {
  1625.               "id": "Rule Name",
  1626.               "displayName": "Rule Name",
  1627.               "required": false,
  1628.               "defaultMatch": false,
  1629.               "display": true,
  1630.               "type": "string",
  1631.               "canBeUsedToMatch": true
  1632.             },
  1633.             {
  1634.               "id": "Exclusion Reason",
  1635.               "displayName": "Exclusion Reason",
  1636.               "required": false,
  1637.               "defaultMatch": false,
  1638.               "display": true,
  1639.               "type": "string",
  1640.               "canBeUsedToMatch": true
  1641.             },
  1642.             {
  1643.               "id": "Reviewed By",
  1644.               "displayName": "Reviewed By",
  1645.               "required": false,
  1646.               "defaultMatch": false,
  1647.               "display": true,
  1648.               "type": "string",
  1649.               "canBeUsedToMatch": true
  1650.             }
  1651.           ],
  1652.           "attemptToConvertTypes": false,
  1653.           "convertFieldsToString": false
  1654.         },
  1655.         "options": {}
  1656.       },
  1657.       "type": "n8n-nodes-base.googleSheets",
  1658.       "typeVersion": 4.7,
  1659.       "position": [
  1660.         1568,
  1661.         912
  1662.       ],
  1663.       "id": "af1bd14d-620b-43fd-8980-7da8c2edd4ce",
  1664.       "name": "Summary Table",
  1665.       "credentials": {
  1666.         "googleSheetsOAuth2Api": {
  1667.           "id": "Ij6ijI3slM4jU3nJ",
  1668.           "name": "Google Sheets account"
  1669.         }
  1670.       }
  1671.     },
  1672.     {
  1673.       "parameters": {
  1674.         "content": "## Trigger B",
  1675.         "height": 720,
  1676.         "width": 2576,
  1677.         "color": 6
  1678.       },
  1679.       "type": "n8n-nodes-base.stickyNote",
  1680.       "typeVersion": 1,
  1681.       "position": [
  1682.         -880,
  1683.         512
  1684.       ],
  1685.       "id": "c4a37485-cb6a-4412-95ed-222d9361074b",
  1686.       "name": "Sticky Note"
  1687.     },
  1688.     {
  1689.       "parameters": {
  1690.         "sortFieldsUi": {
  1691.           "sortField": [
  1692.             {
  1693.               "fieldName": "Exclusion Reason"
  1694.             }
  1695.           ]
  1696.         },
  1697.         "options": {}
  1698.       },
  1699.       "type": "n8n-nodes-base.sort",
  1700.       "typeVersion": 1,
  1701.       "position": [
  1702.         1360,
  1703.         1024
  1704.       ],
  1705.       "id": "2f8a2ac3-51b0-4357-9fc9-81cb43d272f5",
  1706.       "name": "Sort1"
  1707.     }
  1708.   ],
  1709.   "connections": {
  1710.     "Trigger A": {
  1711.       "main": [
  1712.         [
  1713.           {
  1714.             "node": "Get Rules",
  1715.             "type": "main",
  1716.             "index": 0
  1717.           }
  1718.         ]
  1719.       ]
  1720.     },
  1721.     "MITRE Exist": {
  1722.       "main": [
  1723.         [
  1724.           {
  1725.             "node": "Reformat 1",
  1726.             "type": "main",
  1727.             "index": 0
  1728.           }
  1729.         ],
  1730.         [
  1731.           {
  1732.             "node": "Aggregate",
  1733.             "type": "main",
  1734.             "index": 0
  1735.           },
  1736.           {
  1737.             "node": "Merge 1",
  1738.             "type": "main",
  1739.             "index": 0
  1740.           }
  1741.         ]
  1742.       ]
  1743.     },
  1744.     "Aggregate": {
  1745.       "main": [
  1746.         [
  1747.           {
  1748.             "node": "Map to MITRE Agent",
  1749.             "type": "main",
  1750.             "index": 0
  1751.           }
  1752.         ]
  1753.       ]
  1754.     },
  1755.     "Simple Memory": {
  1756.       "ai_memory": [
  1757.         [
  1758.           {
  1759.             "node": "Map to MITRE Agent",
  1760.             "type": "ai_memory",
  1761.             "index": 0
  1762.           }
  1763.         ]
  1764.       ]
  1765.     },
  1766.     "Map to MITRE Agent": {
  1767.       "main": [
  1768.         [
  1769.           {
  1770.             "node": "Parse AI output",
  1771.             "type": "main",
  1772.             "index": 0
  1773.           }
  1774.         ]
  1775.       ]
  1776.     },
  1777.     "Parse AI output": {
  1778.       "main": [
  1779.         [
  1780.           {
  1781.             "node": "Merge 1",
  1782.             "type": "main",
  1783.             "index": 1
  1784.           }
  1785.         ]
  1786.       ]
  1787.     },
  1788.     "Google Gemini": {
  1789.       "ai_languageModel": [
  1790.         [
  1791.           {
  1792.             "node": "Map to MITRE Agent",
  1793.             "type": "ai_languageModel",
  1794.             "index": 0
  1795.           }
  1796.         ]
  1797.       ]
  1798.     },
  1799.     "Merge 2": {
  1800.       "main": [
  1801.         [
  1802.           {
  1803.             "node": "MITRE Coverage Sheet",
  1804.             "type": "main",
  1805.             "index": 0
  1806.           },
  1807.           {
  1808.             "node": "Rules Sheet",
  1809.             "type": "main",
  1810.             "index": 0
  1811.           }
  1812.         ]
  1813.       ]
  1814.     },
  1815.     "Merge 1": {
  1816.       "main": [
  1817.         [
  1818.           {
  1819.             "node": "Reformat 2",
  1820.             "type": "main",
  1821.             "index": 0
  1822.           }
  1823.         ]
  1824.       ]
  1825.     },
  1826.     "Reformat 1": {
  1827.       "main": [
  1828.         [
  1829.           {
  1830.             "node": "Merge 2",
  1831.             "type": "main",
  1832.             "index": 0
  1833.           }
  1834.         ]
  1835.       ]
  1836.     },
  1837.     "Reformat 2": {
  1838.       "main": [
  1839.         [
  1840.           {
  1841.             "node": "Merge 2",
  1842.             "type": "main",
  1843.             "index": 1
  1844.           }
  1845.         ]
  1846.       ]
  1847.     },
  1848.     "Important Fields For LLM": {
  1849.       "main": [
  1850.         [
  1851.           {
  1852.             "node": "MITRE Exist",
  1853.             "type": "main",
  1854.             "index": 0
  1855.           }
  1856.         ]
  1857.       ]
  1858.     },
  1859.     "Get Rules": {
  1860.       "main": [
  1861.         [
  1862.           {
  1863.             "node": "Split Out 1",
  1864.             "type": "main",
  1865.             "index": 0
  1866.           }
  1867.         ]
  1868.       ]
  1869.     },
  1870.     "Filter Enabled Rules": {
  1871.       "main": [
  1872.         [
  1873.           {
  1874.             "node": "Important Fields For LLM",
  1875.             "type": "main",
  1876.             "index": 0
  1877.           }
  1878.         ]
  1879.       ]
  1880.     },
  1881.     "Split Out 1": {
  1882.       "main": [
  1883.         [
  1884.           {
  1885.             "node": "Filter Enabled Rules",
  1886.             "type": "main",
  1887.             "index": 0
  1888.           }
  1889.         ]
  1890.       ]
  1891.     },
  1892.     "MITRE Coverage Sheet": {
  1893.       "main": [
  1894.         [
  1895.           {
  1896.             "node": "Sort",
  1897.             "type": "main",
  1898.             "index": 0
  1899.           }
  1900.         ]
  1901.       ]
  1902.     },
  1903.     "Rules Sheet": {
  1904.       "main": [
  1905.         [
  1906.           {
  1907.             "node": "Rules Table",
  1908.             "type": "main",
  1909.             "index": 0
  1910.           }
  1911.         ]
  1912.       ]
  1913.     },
  1914.     "Sort": {
  1915.       "main": [
  1916.         [
  1917.           {
  1918.             "node": "MITRE Coverage Table",
  1919.             "type": "main",
  1920.             "index": 0
  1921.           }
  1922.         ]
  1923.       ]
  1924.     },
  1925.     "Format 2": {
  1926.       "main": [
  1927.         [
  1928.           {
  1929.             "node": "Sort1",
  1930.             "type": "main",
  1931.             "index": 0
  1932.           }
  1933.         ]
  1934.       ]
  1935.     },
  1936.     "Format": {
  1937.       "main": [
  1938.         [
  1939.           {
  1940.             "node": "Update Rules Table1",
  1941.             "type": "main",
  1942.             "index": 0
  1943.           }
  1944.         ]
  1945.       ]
  1946.     },
  1947.     "Merge": {
  1948.       "main": [
  1949.         [
  1950.           {
  1951.             "node": "Updating code",
  1952.             "type": "main",
  1953.             "index": 0
  1954.           }
  1955.         ]
  1956.       ]
  1957.     },
  1958.     "Updating code": {
  1959.       "main": [
  1960.         [
  1961.           {
  1962.             "node": "Format 2",
  1963.             "type": "main",
  1964.             "index": 0
  1965.           },
  1966.           {
  1967.             "node": "Update Rules Table1",
  1968.             "type": "main",
  1969.             "index": 0
  1970.           }
  1971.         ]
  1972.       ]
  1973.     },
  1974.     "Log source check": {
  1975.       "main": [
  1976.         [
  1977.           {
  1978.             "node": "Merge",
  1979.             "type": "main",
  1980.             "index": 1
  1981.           }
  1982.         ],
  1983.         [
  1984.           {
  1985.             "node": "Format",
  1986.             "type": "main",
  1987.             "index": 0
  1988.           }
  1989.         ]
  1990.       ]
  1991.     },
  1992.     "Get Data Streams1": {
  1993.       "main": [
  1994.         [
  1995.           {
  1996.             "node": "Split Out ",
  1997.             "type": "main",
  1998.             "index": 0
  1999.           }
  2000.         ]
  2001.       ]
  2002.     },
  2003.     "Maps rules to logsources1": {
  2004.       "main": [
  2005.         [
  2006.           {
  2007.             "node": "Log source check",
  2008.             "type": "main",
  2009.             "index": 0
  2010.           }
  2011.         ]
  2012.       ]
  2013.     },
  2014.     "Filter1": {
  2015.       "main": [
  2016.         [
  2017.           {
  2018.             "node": "Data stream mapping1",
  2019.             "type": "main",
  2020.             "index": 0
  2021.           }
  2022.         ]
  2023.       ]
  2024.     },
  2025.     "Trigger B1": {
  2026.       "main": [
  2027.         [
  2028.           {
  2029.             "node": "Get Data Streams1",
  2030.             "type": "main",
  2031.             "index": 0
  2032.           },
  2033.           {
  2034.             "node": "Get Rules Rows1",
  2035.             "type": "main",
  2036.             "index": 0
  2037.           }
  2038.         ]
  2039.       ]
  2040.     },
  2041.     "Split Out ": {
  2042.       "main": [
  2043.         [
  2044.           {
  2045.             "node": "Filter1",
  2046.             "type": "main",
  2047.             "index": 0
  2048.           }
  2049.         ]
  2050.       ]
  2051.     },
  2052.     "Get Rules Rows1": {
  2053.       "main": [
  2054.         [
  2055.           {
  2056.             "node": "Format 2",
  2057.             "type": "main",
  2058.             "index": 0
  2059.           },
  2060.           {
  2061.             "node": "Edit Fields1",
  2062.             "type": "main",
  2063.             "index": 0
  2064.           }
  2065.         ]
  2066.       ]
  2067.     },
  2068.     "Reformating1": {
  2069.       "main": [
  2070.         [
  2071.           {
  2072.             "node": "LogSource Table1",
  2073.             "type": "main",
  2074.             "index": 0
  2075.           },
  2076.           {
  2077.             "node": "Merge",
  2078.             "type": "main",
  2079.             "index": 0
  2080.           }
  2081.         ]
  2082.       ]
  2083.     },
  2084.     "Data stream mapping1": {
  2085.       "main": [
  2086.         [
  2087.           {
  2088.             "node": "Reformating1",
  2089.             "type": "main",
  2090.             "index": 0
  2091.           }
  2092.         ]
  2093.       ]
  2094.     },
  2095.     "Edit Fields1": {
  2096.       "main": [
  2097.         [
  2098.           {
  2099.             "node": "Maps rules to logsources1",
  2100.             "type": "main",
  2101.             "index": 0
  2102.           }
  2103.         ]
  2104.       ]
  2105.     },
  2106.     "Sort1": {
  2107.       "main": [
  2108.         [
  2109.           {
  2110.             "node": "Summary Table",
  2111.             "type": "main",
  2112.             "index": 0
  2113.           }
  2114.         ]
  2115.       ]
  2116.     }
  2117.   },
  2118.   "pinData": {},
  2119.   "meta": {
  2120.     "templateCredsSetupCompleted": true,
  2121.     "instanceId": "5b5c49feff61a1791b94945a856f2e513b70f058a7d673ff4fd15e9381c9e076"
  2122.   }
  2123. }
Add Comment
Please, Sign In to add comment