n8n-nodes-microsoft-sentinel
Advanced tools
Comparing version
@@ -54,3 +54,2 @@ "use strict"; | ||
async function (items, response) { | ||
console.log('items', items); | ||
for (const item of items) { | ||
@@ -159,2 +158,35 @@ item.json = { _status: response.statusCode === 200 ? 'Deleted' : 'Not Found' }; | ||
}, | ||
{ | ||
name: 'Get Comments', | ||
value: 'getComments', | ||
action: 'Gets all comments for an incident', | ||
routing: { | ||
request: { | ||
method: 'GET', | ||
url: '=/incidents/{{ $parameter.incidentId }}/comments', | ||
}, | ||
output: { | ||
postReceive: [ | ||
{ | ||
type: 'rootProperty', | ||
properties: { | ||
property: 'value', | ||
}, | ||
}, | ||
GenericFunctions_1.prepareOutput, | ||
], | ||
}, | ||
operations: { | ||
pagination: { | ||
type: 'generic', | ||
properties: { | ||
continue: '={{ $response.body?.nextLink }}', | ||
request: { | ||
url: '={{ $response.body.nextLink }}', | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
], | ||
@@ -378,2 +410,9 @@ default: 'getAll', | ||
{ | ||
displayName: 'Title', | ||
name: 'title', | ||
type: 'string', | ||
default: '', | ||
description: 'Filter incidents where title contains the given string (case-insensitive)', | ||
}, | ||
{ | ||
displayName: 'Filter Query Parameter', | ||
@@ -397,3 +436,3 @@ name: 'filter', | ||
resource: ['incident'], | ||
operation: ['get', 'getAlerts', 'getEntities'], | ||
operation: ['get', 'getAlerts', 'getEntities', 'getComments'], | ||
}, | ||
@@ -414,3 +453,3 @@ }, | ||
resource: ['incident'], | ||
operation: ['get', 'getAlerts', 'getEntities'], | ||
operation: ['get', 'getAlerts', 'getEntities', 'getComments'], | ||
}, | ||
@@ -427,2 +466,14 @@ }, | ||
}, | ||
{ | ||
displayName: 'Split Results', | ||
name: 'splitResults', | ||
type: 'boolean', | ||
default: false, | ||
displayOptions: { | ||
show: { | ||
'/operation': ['getAlerts', 'getEntities', 'getComments'], | ||
}, | ||
}, | ||
description: 'Whether to split the results into individual items', | ||
} | ||
], | ||
@@ -429,0 +480,0 @@ }, |
@@ -11,3 +11,3 @@ import type { IExecuteSingleFunctions, IHttpRequestOptions, INodeExecutionData, IN8nHttpFullResponse } from 'n8n-workflow'; | ||
export declare function processQueryResults(this: IExecuteSingleFunctions, items: INodeExecutionData[], response: IN8nHttpFullResponse): Promise<INodeExecutionData[]>; | ||
export declare function prepareOutput(this: IExecuteSingleFunctions, items: INodeExecutionData[]): Promise<INodeExecutionData[]>; | ||
export declare function prepareOutput(this: IExecuteSingleFunctions, items: INodeExecutionData[], response: IN8nHttpFullResponse): Promise<INodeExecutionData[]>; | ||
export declare const workspaceQuery = "\nresources\n| where type =~ 'microsoft.operationsmanagement/solutions'\n| where name contains 'SecurityInsights'\n| project id = tolower(tostring(properties.workspaceResourceId))\n| join kind = inner (\n resources\n | where type =~ 'microsoft.operationalinsights/workspaces'\n | extend id=tolower(id)\n )\n on id\n| extend path = strcat(\"/subscriptions/\", subscriptionId, \"/resourcegroups/\", resourceGroup, \"/providers/Microsoft.OperationalInsights/workspaces/\", name, \"/providers/Microsoft.SecurityInsights\")\n| extend sentinelInstance = strcat(subscriptionId, \"/\", resourceGroup, \"/\", name)\n| join kind=leftouter (ResourceContainers | where type =~ 'microsoft.resources/subscriptions' | project subscriptionId, subscriptionName = name) on subscriptionId\n| project\n name,\n resourceGroup,\n subscriptionName,\n subscriptionId,\n location,\n tags,\n sentinelInstance,\n path\n| sort by (tolower(tostring(name))) asc\n"; |
@@ -35,3 +35,9 @@ "use strict"; | ||
} | ||
if (filters.title) { | ||
queryFilter.push(`contains(toLower(properties/title), '${filters.title.replace(/'/g, '%27')}')`); | ||
} | ||
if ((_a = filters.severity) === null || _a === void 0 ? void 0 : _a.length) { | ||
if (typeof filters.severity === 'string') { | ||
filters.severity = filters.severity.split(/, */); | ||
} | ||
queryFilter.push(_addFilter('properties/severity', 'eq', filters.severity)); | ||
@@ -140,5 +146,6 @@ } | ||
} | ||
async function prepareOutput(items) { | ||
async function prepareOutput(items, response) { | ||
const nodeDebug = this.getNodeParameter('nodeDebug', 0); | ||
const simple = this.getNodeParameter('options.simple', true); | ||
const splitResults = this.getNodeParameter('options.splitResults', true); | ||
if (nodeDebug) { | ||
@@ -159,3 +166,19 @@ this.logger.info(`[${this.getNode().type} | ${this.getNode().name}] - Parsing properties of ${items.length} items}`); | ||
}); | ||
return items; | ||
if (splitResults) { | ||
return items; | ||
} | ||
else { | ||
let outKey = this.getNodeParameter('operation', 'results').toLowerCase(); | ||
if (outKey.startsWith('get')) { | ||
outKey = outKey.slice(3); | ||
} | ||
return [ | ||
{ | ||
json: { | ||
[outKey]: items.map((item) => item.json) | ||
}, | ||
pairedItem: this.getItemIndex() | ||
} | ||
]; | ||
} | ||
} | ||
@@ -162,0 +185,0 @@ exports.workspaceQuery = ` |
{ | ||
"name": "n8n-nodes-microsoft-sentinel", | ||
"version": "0.1.4", | ||
"version": "0.1.5", | ||
"description": "n8n node for interacting with Microsoft Sentinel", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
{ | ||
"name": "n8n-nodes-microsoft-sentinel", | ||
"version": "0.1.4", | ||
"version": "0.1.5", | ||
"description": "n8n node for interacting with Microsoft Sentinel", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
190046
2.33%2694
2.82%