@mlabsh/n8n-nodes-mlab 0.1.2 → 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +57 -66
- package/dist/nodes/{MlabCve/MlabCve.node.d.ts → Mlab/Mlab.node.d.ts} +1 -1
- package/dist/nodes/Mlab/Mlab.node.js +960 -0
- package/dist/nodes/Mlab/Mlab.node.js.map +1 -0
- package/dist/nodes/shared/GenericFunctions.js +9 -2
- package/dist/nodes/shared/GenericFunctions.js.map +1 -1
- package/package.json +2 -4
- package/dist/nodes/MlabCore/MlabCore.node.d.ts +0 -5
- package/dist/nodes/MlabCore/MlabCore.node.js +0 -348
- package/dist/nodes/MlabCore/MlabCore.node.js.map +0 -1
- package/dist/nodes/MlabCve/MlabCve.node.js +0 -161
- package/dist/nodes/MlabCve/MlabCve.node.js.map +0 -1
- package/dist/nodes/MlabCve/mlab.svg +0 -9
- package/dist/nodes/MlabThreatActors/MlabThreatActors.node.d.ts +0 -5
- package/dist/nodes/MlabThreatActors/MlabThreatActors.node.js +0 -167
- package/dist/nodes/MlabThreatActors/MlabThreatActors.node.js.map +0 -1
- package/dist/nodes/MlabThreatActors/mlab.svg +0 -9
- /package/dist/nodes/{MlabCore → Mlab}/mlab.svg +0 -0
|
@@ -0,0 +1,960 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Mlab = void 0;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
const GenericFunctions_1 = require("../shared/GenericFunctions");
|
|
6
|
+
function splitList(raw) {
|
|
7
|
+
return [...new Set(raw.split(/[\s,;]+/).filter(Boolean))];
|
|
8
|
+
}
|
|
9
|
+
async function executeBulk(items, resource) {
|
|
10
|
+
const max = resource === 'hash' ? 500 : 100;
|
|
11
|
+
const field = resource === 'hash' ? 'hashes' : 'addresses';
|
|
12
|
+
const groups = new Map();
|
|
13
|
+
for (let i = 0; i < items.length; i++) {
|
|
14
|
+
const chain = resource === 'crypto' ? this.getNodeParameter('chain', i) : '';
|
|
15
|
+
let group = groups.get(chain);
|
|
16
|
+
if (!group)
|
|
17
|
+
groups.set(chain, (group = { values: new Set(), items: [] }));
|
|
18
|
+
for (const v of splitList(this.getNodeParameter(field, i)))
|
|
19
|
+
group.values.add(v);
|
|
20
|
+
group.items.push(i);
|
|
21
|
+
}
|
|
22
|
+
const out = [];
|
|
23
|
+
for (const [chain, group] of groups) {
|
|
24
|
+
const values = [...group.values];
|
|
25
|
+
const pairedItem = group.items.map((item) => ({ item }));
|
|
26
|
+
for (let start = 0; start < values.length; start += max) {
|
|
27
|
+
const body = { [field]: values.slice(start, start + max) };
|
|
28
|
+
if (chain)
|
|
29
|
+
body.chain = chain;
|
|
30
|
+
try {
|
|
31
|
+
const json = (await GenericFunctions_1.mlabCoreApiRequest.call(this, 'POST', resource === 'hash' ? '/scan/hash' : '/scan/crypto', body));
|
|
32
|
+
out.push({ json, pairedItem });
|
|
33
|
+
}
|
|
34
|
+
catch (error) {
|
|
35
|
+
if (!this.continueOnFail())
|
|
36
|
+
throw error;
|
|
37
|
+
out.push({ json: { error: error.message }, pairedItem });
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
return out;
|
|
42
|
+
}
|
|
43
|
+
class Mlab {
|
|
44
|
+
constructor() {
|
|
45
|
+
this.description = {
|
|
46
|
+
displayName: 'mlab.sh',
|
|
47
|
+
name: 'mlab',
|
|
48
|
+
icon: 'file:mlab.svg',
|
|
49
|
+
group: ['transform'],
|
|
50
|
+
version: 1,
|
|
51
|
+
subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
|
|
52
|
+
description: 'mlab.sh security tooling: domain, IP, crypto, file, hash, URL, email, phone, MAC and IOC analysis, CVE search and threat actor intelligence',
|
|
53
|
+
defaults: {
|
|
54
|
+
name: 'mlab.sh',
|
|
55
|
+
},
|
|
56
|
+
inputs: ['main'],
|
|
57
|
+
outputs: ['main'],
|
|
58
|
+
credentials: [
|
|
59
|
+
{
|
|
60
|
+
name: 'mlabApi',
|
|
61
|
+
required: true,
|
|
62
|
+
displayOptions: {
|
|
63
|
+
show: {
|
|
64
|
+
resource: [
|
|
65
|
+
'domain',
|
|
66
|
+
'ip',
|
|
67
|
+
'crypto',
|
|
68
|
+
'file',
|
|
69
|
+
'quota',
|
|
70
|
+
'hash',
|
|
71
|
+
'url',
|
|
72
|
+
'email',
|
|
73
|
+
'phone',
|
|
74
|
+
'mac',
|
|
75
|
+
'ioc',
|
|
76
|
+
],
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
],
|
|
81
|
+
properties: [
|
|
82
|
+
{
|
|
83
|
+
displayName: 'Resource',
|
|
84
|
+
name: 'resource',
|
|
85
|
+
type: 'options',
|
|
86
|
+
noDataExpression: true,
|
|
87
|
+
options: [
|
|
88
|
+
{ name: 'Crypto Address', value: 'crypto' },
|
|
89
|
+
{ name: 'CVE', value: 'cve' },
|
|
90
|
+
{ name: 'Domain', value: 'domain' },
|
|
91
|
+
{ name: 'Email Address', value: 'email' },
|
|
92
|
+
{ name: 'File', value: 'file' },
|
|
93
|
+
{ name: 'Hash', value: 'hash' },
|
|
94
|
+
{ name: 'IOC', value: 'ioc' },
|
|
95
|
+
{ name: 'IP Address', value: 'ip' },
|
|
96
|
+
{ name: 'MAC Address', value: 'mac' },
|
|
97
|
+
{ name: 'Phone Number', value: 'phone' },
|
|
98
|
+
{ name: 'Quota', value: 'quota' },
|
|
99
|
+
{ name: 'Threat Actor', value: 'threatActor' },
|
|
100
|
+
{ name: 'URL', value: 'url' },
|
|
101
|
+
],
|
|
102
|
+
default: 'domain',
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
displayName: 'Operation',
|
|
106
|
+
name: 'operation',
|
|
107
|
+
type: 'options',
|
|
108
|
+
noDataExpression: true,
|
|
109
|
+
displayOptions: { show: { resource: ['domain'] } },
|
|
110
|
+
options: [
|
|
111
|
+
{
|
|
112
|
+
name: 'Capture Network Requests',
|
|
113
|
+
value: 'networkRequests',
|
|
114
|
+
action: 'Capture the network requests of a page',
|
|
115
|
+
description: 'Load a URL in a headless browser and list every request it makes. Counts as one domain scan.',
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
name: 'Get Results',
|
|
119
|
+
value: 'results',
|
|
120
|
+
action: 'Get the results of a domain scan',
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
name: 'Get SSL Certificates',
|
|
124
|
+
value: 'ssl',
|
|
125
|
+
action: 'Get SSL certificate history of a domain',
|
|
126
|
+
description: 'Certificates seen for the domain in certificate transparency logs',
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
name: 'Get Status',
|
|
130
|
+
value: 'status',
|
|
131
|
+
action: 'Get the status of a domain scan',
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
name: 'Scan',
|
|
135
|
+
value: 'scan',
|
|
136
|
+
action: 'Scan a domain',
|
|
137
|
+
description: 'Launch a domain scan and (optionally) wait for the results',
|
|
138
|
+
},
|
|
139
|
+
],
|
|
140
|
+
default: 'scan',
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
displayName: 'Domain',
|
|
144
|
+
name: 'domain',
|
|
145
|
+
type: 'string',
|
|
146
|
+
required: true,
|
|
147
|
+
default: '',
|
|
148
|
+
placeholder: 'example.com',
|
|
149
|
+
displayOptions: {
|
|
150
|
+
show: { resource: ['domain'], operation: ['scan', 'status', 'results', 'ssl'] },
|
|
151
|
+
},
|
|
152
|
+
description: 'The domain to scan (without protocol)',
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
displayName: 'Page URL',
|
|
156
|
+
name: 'pageUrl',
|
|
157
|
+
type: 'string',
|
|
158
|
+
required: true,
|
|
159
|
+
default: '',
|
|
160
|
+
placeholder: 'https://example.com',
|
|
161
|
+
displayOptions: { show: { resource: ['domain'], operation: ['networkRequests'] } },
|
|
162
|
+
description: 'The page to load',
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
displayName: 'Wait for Completion',
|
|
166
|
+
name: 'waitForCompletion',
|
|
167
|
+
type: 'boolean',
|
|
168
|
+
default: true,
|
|
169
|
+
displayOptions: { show: { resource: ['domain'], operation: ['scan'] } },
|
|
170
|
+
description: 'Whether to poll until the scan finishes and return the full results. If disabled, only the job acknowledgement is returned.',
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
displayName: 'Timeout (Seconds)',
|
|
174
|
+
name: 'timeout',
|
|
175
|
+
type: 'number',
|
|
176
|
+
default: 120,
|
|
177
|
+
typeOptions: { minValue: 10 },
|
|
178
|
+
displayOptions: {
|
|
179
|
+
show: { resource: ['domain'], operation: ['scan'], waitForCompletion: [true] },
|
|
180
|
+
},
|
|
181
|
+
description: 'How long to wait for the scan to complete before giving up',
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
displayName: 'Operation',
|
|
185
|
+
name: 'operation',
|
|
186
|
+
type: 'options',
|
|
187
|
+
noDataExpression: true,
|
|
188
|
+
displayOptions: { show: { resource: ['ip'] } },
|
|
189
|
+
options: [
|
|
190
|
+
{
|
|
191
|
+
name: 'Lookup',
|
|
192
|
+
value: 'lookup',
|
|
193
|
+
action: 'Look up an IP address',
|
|
194
|
+
description: 'Resolve geolocation, ASN and ownership for an IP address',
|
|
195
|
+
},
|
|
196
|
+
],
|
|
197
|
+
default: 'lookup',
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
displayName: 'IP Address',
|
|
201
|
+
name: 'ip',
|
|
202
|
+
type: 'string',
|
|
203
|
+
required: true,
|
|
204
|
+
default: '',
|
|
205
|
+
placeholder: '8.8.8.8',
|
|
206
|
+
displayOptions: { show: { resource: ['ip'] } },
|
|
207
|
+
description: 'IPv4 or IPv6 address to look up',
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
displayName: 'Operation',
|
|
211
|
+
name: 'operation',
|
|
212
|
+
type: 'options',
|
|
213
|
+
noDataExpression: true,
|
|
214
|
+
displayOptions: { show: { resource: ['crypto'] } },
|
|
215
|
+
options: [
|
|
216
|
+
{
|
|
217
|
+
name: 'Lookup',
|
|
218
|
+
value: 'lookup',
|
|
219
|
+
action: 'Look up a crypto address',
|
|
220
|
+
description: 'Check sanctions, labels and risk score for a crypto address',
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
name: 'Bulk Lookup',
|
|
224
|
+
value: 'bulk',
|
|
225
|
+
action: 'Look up many crypto addresses',
|
|
226
|
+
description: 'Look up to 100 addresses in one request',
|
|
227
|
+
},
|
|
228
|
+
],
|
|
229
|
+
default: 'lookup',
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
displayName: 'Address',
|
|
233
|
+
name: 'address',
|
|
234
|
+
type: 'string',
|
|
235
|
+
required: true,
|
|
236
|
+
default: '',
|
|
237
|
+
placeholder: '0x...',
|
|
238
|
+
displayOptions: { show: { resource: ['crypto'], operation: ['lookup'] } },
|
|
239
|
+
description: 'The crypto address to look up',
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
displayName: 'Addresses',
|
|
243
|
+
name: 'addresses',
|
|
244
|
+
type: 'string',
|
|
245
|
+
typeOptions: { rows: 4 },
|
|
246
|
+
required: true,
|
|
247
|
+
default: '',
|
|
248
|
+
displayOptions: { show: { resource: ['crypto'], operation: ['bulk'] } },
|
|
249
|
+
description: 'Addresses separated by commas, spaces or new lines. Values from all input items are pooled and sent 100 per request.',
|
|
250
|
+
},
|
|
251
|
+
{
|
|
252
|
+
displayName: 'Chain',
|
|
253
|
+
name: 'chain',
|
|
254
|
+
type: 'options',
|
|
255
|
+
default: '',
|
|
256
|
+
displayOptions: { show: { resource: ['crypto'] } },
|
|
257
|
+
description: 'Blockchain of the address. Leave on "Auto-detect" when unsure. For bulk lookups it applies to every address.',
|
|
258
|
+
options: [
|
|
259
|
+
{ name: 'Arbitrum', value: 'arbitrum' },
|
|
260
|
+
{ name: 'Auto-Detect', value: '' },
|
|
261
|
+
{ name: 'Avalanche', value: 'avax' },
|
|
262
|
+
{ name: 'Base', value: 'base' },
|
|
263
|
+
{ name: 'Bitcoin', value: 'btc' },
|
|
264
|
+
{ name: 'BSC', value: 'bsc' },
|
|
265
|
+
{ name: 'Dogecoin', value: 'doge' },
|
|
266
|
+
{ name: 'Ethereum', value: 'eth' },
|
|
267
|
+
{ name: 'Optimism', value: 'optimism' },
|
|
268
|
+
{ name: 'Polygon', value: 'polygon' },
|
|
269
|
+
{ name: 'Solana', value: 'sol' },
|
|
270
|
+
{ name: 'TON', value: 'ton' },
|
|
271
|
+
{ name: 'Tron', value: 'trx' },
|
|
272
|
+
],
|
|
273
|
+
},
|
|
274
|
+
{
|
|
275
|
+
displayName: 'Operation',
|
|
276
|
+
name: 'operation',
|
|
277
|
+
type: 'options',
|
|
278
|
+
noDataExpression: true,
|
|
279
|
+
displayOptions: { show: { resource: ['file'] } },
|
|
280
|
+
options: [
|
|
281
|
+
{
|
|
282
|
+
name: 'Upload',
|
|
283
|
+
value: 'upload',
|
|
284
|
+
action: 'Upload a file for analysis',
|
|
285
|
+
description: 'Upload a file (max 10MB) and launch analysis',
|
|
286
|
+
},
|
|
287
|
+
{
|
|
288
|
+
name: 'Get Results',
|
|
289
|
+
value: 'results',
|
|
290
|
+
action: 'Get file analysis results',
|
|
291
|
+
description: 'Fetch analysis results by SHA-256 hash',
|
|
292
|
+
},
|
|
293
|
+
{
|
|
294
|
+
name: 'Get Tool Output',
|
|
295
|
+
value: 'output',
|
|
296
|
+
action: 'Get the raw output of one analysis tool',
|
|
297
|
+
description: 'Raw output of a single tool listed in the results',
|
|
298
|
+
},
|
|
299
|
+
],
|
|
300
|
+
default: 'upload',
|
|
301
|
+
},
|
|
302
|
+
{
|
|
303
|
+
displayName: 'Input Binary Field',
|
|
304
|
+
name: 'binaryPropertyName',
|
|
305
|
+
type: 'string',
|
|
306
|
+
default: 'data',
|
|
307
|
+
required: true,
|
|
308
|
+
hint: 'The name of the input binary field containing the file to upload',
|
|
309
|
+
displayOptions: { show: { resource: ['file'], operation: ['upload'] } },
|
|
310
|
+
},
|
|
311
|
+
{
|
|
312
|
+
displayName: 'SHA-256',
|
|
313
|
+
name: 'sha256',
|
|
314
|
+
type: 'string',
|
|
315
|
+
required: true,
|
|
316
|
+
default: '',
|
|
317
|
+
displayOptions: { show: { resource: ['file'], operation: ['results', 'output'] } },
|
|
318
|
+
description: 'SHA-256 hash returned by the upload operation',
|
|
319
|
+
},
|
|
320
|
+
{
|
|
321
|
+
displayName: 'Tool',
|
|
322
|
+
name: 'tool',
|
|
323
|
+
type: 'string',
|
|
324
|
+
required: true,
|
|
325
|
+
default: '',
|
|
326
|
+
placeholder: 'yara',
|
|
327
|
+
displayOptions: { show: { resource: ['file'], operation: ['output'] } },
|
|
328
|
+
description: 'Tool name, as listed in the file results',
|
|
329
|
+
},
|
|
330
|
+
{
|
|
331
|
+
displayName: 'Operation',
|
|
332
|
+
name: 'operation',
|
|
333
|
+
type: 'options',
|
|
334
|
+
noDataExpression: true,
|
|
335
|
+
displayOptions: { show: { resource: ['hash'] } },
|
|
336
|
+
options: [
|
|
337
|
+
{
|
|
338
|
+
name: 'Lookup',
|
|
339
|
+
value: 'lookup',
|
|
340
|
+
action: 'Look up a file hash',
|
|
341
|
+
description: 'Known-good / known-malicious verdict for an MD5, SHA-1 or SHA-256',
|
|
342
|
+
},
|
|
343
|
+
{
|
|
344
|
+
name: 'Bulk Lookup',
|
|
345
|
+
value: 'bulk',
|
|
346
|
+
action: 'Look up many file hashes',
|
|
347
|
+
description: 'Look up to 500 hashes in one request',
|
|
348
|
+
},
|
|
349
|
+
],
|
|
350
|
+
default: 'lookup',
|
|
351
|
+
},
|
|
352
|
+
{
|
|
353
|
+
displayName: 'Hash',
|
|
354
|
+
name: 'hash',
|
|
355
|
+
type: 'string',
|
|
356
|
+
required: true,
|
|
357
|
+
default: '',
|
|
358
|
+
displayOptions: { show: { resource: ['hash'], operation: ['lookup'] } },
|
|
359
|
+
description: 'MD5, SHA-1, SHA-256 or SHA-512 hex digest',
|
|
360
|
+
},
|
|
361
|
+
{
|
|
362
|
+
displayName: 'Hashes',
|
|
363
|
+
name: 'hashes',
|
|
364
|
+
type: 'string',
|
|
365
|
+
typeOptions: { rows: 4 },
|
|
366
|
+
required: true,
|
|
367
|
+
default: '',
|
|
368
|
+
displayOptions: { show: { resource: ['hash'], operation: ['bulk'] } },
|
|
369
|
+
description: 'Digests separated by commas, spaces or new lines. Values from all input items are pooled and sent 500 per request.',
|
|
370
|
+
},
|
|
371
|
+
{
|
|
372
|
+
displayName: 'Operation',
|
|
373
|
+
name: 'operation',
|
|
374
|
+
type: 'options',
|
|
375
|
+
noDataExpression: true,
|
|
376
|
+
displayOptions: { show: { resource: ['url'] } },
|
|
377
|
+
options: [
|
|
378
|
+
{
|
|
379
|
+
name: 'Analyze',
|
|
380
|
+
value: 'analyze',
|
|
381
|
+
action: 'Analyze a URL',
|
|
382
|
+
description: 'Phishing shapes, embedded redirects and what mlab knows about the host',
|
|
383
|
+
},
|
|
384
|
+
],
|
|
385
|
+
default: 'analyze',
|
|
386
|
+
},
|
|
387
|
+
{
|
|
388
|
+
displayName: 'URL',
|
|
389
|
+
name: 'url',
|
|
390
|
+
type: 'string',
|
|
391
|
+
required: true,
|
|
392
|
+
default: '',
|
|
393
|
+
placeholder: 'https://bit.ly/3xYz',
|
|
394
|
+
displayOptions: { show: { resource: ['url'] } },
|
|
395
|
+
},
|
|
396
|
+
{
|
|
397
|
+
displayName: 'Follow Redirects',
|
|
398
|
+
name: 'resolve',
|
|
399
|
+
type: 'boolean',
|
|
400
|
+
default: false,
|
|
401
|
+
displayOptions: { show: { resource: ['url'] } },
|
|
402
|
+
description: 'Whether to visit the URL and follow it to its final destination. Off by default: the link is never fetched otherwise.',
|
|
403
|
+
},
|
|
404
|
+
{
|
|
405
|
+
displayName: 'Operation',
|
|
406
|
+
name: 'operation',
|
|
407
|
+
type: 'options',
|
|
408
|
+
noDataExpression: true,
|
|
409
|
+
displayOptions: { show: { resource: ['email'] } },
|
|
410
|
+
options: [
|
|
411
|
+
{
|
|
412
|
+
name: 'Analyze',
|
|
413
|
+
value: 'analyze',
|
|
414
|
+
action: 'Analyze an email address',
|
|
415
|
+
description: 'Mailbox type, spoofability of the domain and risk score',
|
|
416
|
+
},
|
|
417
|
+
],
|
|
418
|
+
default: 'analyze',
|
|
419
|
+
},
|
|
420
|
+
{
|
|
421
|
+
displayName: 'Email',
|
|
422
|
+
name: 'email',
|
|
423
|
+
type: 'string',
|
|
424
|
+
placeholder: 'name@email.com',
|
|
425
|
+
required: true,
|
|
426
|
+
default: '',
|
|
427
|
+
displayOptions: { show: { resource: ['email'] } },
|
|
428
|
+
},
|
|
429
|
+
{
|
|
430
|
+
displayName: 'Operation',
|
|
431
|
+
name: 'operation',
|
|
432
|
+
type: 'options',
|
|
433
|
+
noDataExpression: true,
|
|
434
|
+
displayOptions: { show: { resource: ['phone'] } },
|
|
435
|
+
options: [
|
|
436
|
+
{
|
|
437
|
+
name: 'Analyze',
|
|
438
|
+
value: 'analyze',
|
|
439
|
+
action: 'Analyze a phone number',
|
|
440
|
+
description: 'Validity, line type, allocated operator and scam shapes',
|
|
441
|
+
},
|
|
442
|
+
],
|
|
443
|
+
default: 'analyze',
|
|
444
|
+
},
|
|
445
|
+
{
|
|
446
|
+
displayName: 'Phone Number',
|
|
447
|
+
name: 'number',
|
|
448
|
+
type: 'string',
|
|
449
|
+
required: true,
|
|
450
|
+
default: '',
|
|
451
|
+
placeholder: '+33612345678',
|
|
452
|
+
displayOptions: { show: { resource: ['phone'] } },
|
|
453
|
+
description: 'Phone number in E.164 form',
|
|
454
|
+
},
|
|
455
|
+
{
|
|
456
|
+
displayName: 'Operation',
|
|
457
|
+
name: 'operation',
|
|
458
|
+
type: 'options',
|
|
459
|
+
noDataExpression: true,
|
|
460
|
+
displayOptions: { show: { resource: ['mac'] } },
|
|
461
|
+
options: [
|
|
462
|
+
{
|
|
463
|
+
name: 'Lookup',
|
|
464
|
+
value: 'lookup',
|
|
465
|
+
action: 'Look up a MAC address',
|
|
466
|
+
description: 'Vendor, randomization, virtualization and every notation',
|
|
467
|
+
},
|
|
468
|
+
],
|
|
469
|
+
default: 'lookup',
|
|
470
|
+
},
|
|
471
|
+
{
|
|
472
|
+
displayName: 'MAC Address',
|
|
473
|
+
name: 'mac',
|
|
474
|
+
type: 'string',
|
|
475
|
+
required: true,
|
|
476
|
+
default: '',
|
|
477
|
+
placeholder: '00:1A:2B:3C:4D:5E',
|
|
478
|
+
displayOptions: { show: { resource: ['mac'] } },
|
|
479
|
+
},
|
|
480
|
+
{
|
|
481
|
+
displayName: 'Operation',
|
|
482
|
+
name: 'operation',
|
|
483
|
+
type: 'options',
|
|
484
|
+
noDataExpression: true,
|
|
485
|
+
displayOptions: { show: { resource: ['ioc'] } },
|
|
486
|
+
options: [
|
|
487
|
+
{
|
|
488
|
+
name: 'Extract',
|
|
489
|
+
value: 'extract',
|
|
490
|
+
action: 'Extract indicators from text',
|
|
491
|
+
description: 'Pull every indicator out of raw text, with optional SMS threat scoring',
|
|
492
|
+
},
|
|
493
|
+
],
|
|
494
|
+
default: 'extract',
|
|
495
|
+
},
|
|
496
|
+
{
|
|
497
|
+
displayName: 'Text',
|
|
498
|
+
name: 'text',
|
|
499
|
+
type: 'string',
|
|
500
|
+
typeOptions: { rows: 6 },
|
|
501
|
+
required: true,
|
|
502
|
+
default: '',
|
|
503
|
+
displayOptions: { show: { resource: ['ioc'] } },
|
|
504
|
+
description: 'Raw text (report, log, email, SMS), up to 1 MB',
|
|
505
|
+
},
|
|
506
|
+
{
|
|
507
|
+
displayName: 'Risk Scoring',
|
|
508
|
+
name: 'risk',
|
|
509
|
+
type: 'options',
|
|
510
|
+
default: '',
|
|
511
|
+
displayOptions: { show: { resource: ['ioc'] } },
|
|
512
|
+
description: 'Score the text as an SMS threat (smishing)',
|
|
513
|
+
options: [
|
|
514
|
+
{ name: 'Off', value: '' },
|
|
515
|
+
{
|
|
516
|
+
name: 'Fast',
|
|
517
|
+
value: 'fast',
|
|
518
|
+
description: 'Offline scorer, safe on a blocking path',
|
|
519
|
+
},
|
|
520
|
+
{
|
|
521
|
+
name: 'Deep',
|
|
522
|
+
value: 'deep',
|
|
523
|
+
description: 'Also unmasks short links and checks IP hosts (network calls, slower)',
|
|
524
|
+
},
|
|
525
|
+
],
|
|
526
|
+
},
|
|
527
|
+
{
|
|
528
|
+
displayName: 'Country',
|
|
529
|
+
name: 'country',
|
|
530
|
+
type: 'string',
|
|
531
|
+
default: 'fr',
|
|
532
|
+
displayOptions: { show: { resource: ['ioc'], risk: ['fast', 'deep'] } },
|
|
533
|
+
description: 'Keyword and brand pack used by the scorer',
|
|
534
|
+
},
|
|
535
|
+
{
|
|
536
|
+
displayName: 'Operation',
|
|
537
|
+
name: 'operation',
|
|
538
|
+
type: 'options',
|
|
539
|
+
noDataExpression: true,
|
|
540
|
+
displayOptions: { show: { resource: ['quota'] } },
|
|
541
|
+
options: [
|
|
542
|
+
{
|
|
543
|
+
name: 'Get',
|
|
544
|
+
value: 'get',
|
|
545
|
+
action: 'Get remaining quota',
|
|
546
|
+
description: 'Get the remaining daily quota for a scan type',
|
|
547
|
+
},
|
|
548
|
+
],
|
|
549
|
+
default: 'get',
|
|
550
|
+
},
|
|
551
|
+
{
|
|
552
|
+
displayName: 'Scan Type',
|
|
553
|
+
name: 'scanType',
|
|
554
|
+
type: 'options',
|
|
555
|
+
default: 'domain',
|
|
556
|
+
displayOptions: { show: { resource: ['quota'] } },
|
|
557
|
+
options: [
|
|
558
|
+
{ name: 'Domain', value: 'domain' },
|
|
559
|
+
{ name: 'IP', value: 'ip' },
|
|
560
|
+
{ name: 'File', value: 'file' },
|
|
561
|
+
{ name: 'Crypto', value: 'crypto' },
|
|
562
|
+
],
|
|
563
|
+
},
|
|
564
|
+
{
|
|
565
|
+
displayName: 'Operation',
|
|
566
|
+
name: 'operation',
|
|
567
|
+
type: 'options',
|
|
568
|
+
noDataExpression: true,
|
|
569
|
+
displayOptions: { show: { resource: ['cve'] } },
|
|
570
|
+
options: [
|
|
571
|
+
{
|
|
572
|
+
name: 'Search',
|
|
573
|
+
value: 'search',
|
|
574
|
+
action: 'Search vulnerabilities',
|
|
575
|
+
description: 'Search vulnerabilities by keyword, vendor or product',
|
|
576
|
+
},
|
|
577
|
+
{
|
|
578
|
+
name: 'Get',
|
|
579
|
+
value: 'get',
|
|
580
|
+
action: 'Get a CVE by ID',
|
|
581
|
+
description: 'Retrieve full details for a CVE (including EPSS and KEV data)',
|
|
582
|
+
},
|
|
583
|
+
{
|
|
584
|
+
name: 'Get Latest',
|
|
585
|
+
value: 'latest',
|
|
586
|
+
action: 'Get latest vulnerabilities',
|
|
587
|
+
description: 'Fetch vulnerabilities from the last 7 days',
|
|
588
|
+
},
|
|
589
|
+
],
|
|
590
|
+
default: 'search',
|
|
591
|
+
},
|
|
592
|
+
{
|
|
593
|
+
displayName: 'CVE ID',
|
|
594
|
+
name: 'cveId',
|
|
595
|
+
type: 'string',
|
|
596
|
+
required: true,
|
|
597
|
+
default: '',
|
|
598
|
+
placeholder: 'CVE-2024-3094',
|
|
599
|
+
displayOptions: { show: { resource: ['cve'], operation: ['get'] } },
|
|
600
|
+
description: 'The CVE identifier to retrieve',
|
|
601
|
+
},
|
|
602
|
+
{
|
|
603
|
+
displayName: 'Query',
|
|
604
|
+
name: 'query',
|
|
605
|
+
type: 'string',
|
|
606
|
+
required: true,
|
|
607
|
+
default: '',
|
|
608
|
+
placeholder: 'openssl',
|
|
609
|
+
displayOptions: { show: { resource: ['cve'], operation: ['search'] } },
|
|
610
|
+
description: 'Keyword, vendor or product name to search for',
|
|
611
|
+
},
|
|
612
|
+
{
|
|
613
|
+
displayName: 'Filters',
|
|
614
|
+
name: 'cveFilters',
|
|
615
|
+
type: 'collection',
|
|
616
|
+
placeholder: 'Add Filter',
|
|
617
|
+
default: {},
|
|
618
|
+
displayOptions: { show: { resource: ['cve'], operation: ['search'] } },
|
|
619
|
+
options: [
|
|
620
|
+
{
|
|
621
|
+
displayName: 'Severity',
|
|
622
|
+
name: 'severity',
|
|
623
|
+
type: 'options',
|
|
624
|
+
default: 'CRITICAL',
|
|
625
|
+
options: [
|
|
626
|
+
{ name: 'Critical', value: 'CRITICAL' },
|
|
627
|
+
{ name: 'High', value: 'HIGH' },
|
|
628
|
+
{ name: 'Medium', value: 'MEDIUM' },
|
|
629
|
+
{ name: 'Low', value: 'LOW' },
|
|
630
|
+
],
|
|
631
|
+
},
|
|
632
|
+
{
|
|
633
|
+
displayName: 'Published After',
|
|
634
|
+
name: 'dateStart',
|
|
635
|
+
type: 'dateTime',
|
|
636
|
+
default: '',
|
|
637
|
+
description: 'Only return CVEs published on or after this date',
|
|
638
|
+
},
|
|
639
|
+
{
|
|
640
|
+
displayName: 'Exact Match',
|
|
641
|
+
name: 'exact',
|
|
642
|
+
type: 'boolean',
|
|
643
|
+
default: false,
|
|
644
|
+
description: 'Whether to perform an exact-match search instead of fuzzy',
|
|
645
|
+
},
|
|
646
|
+
{
|
|
647
|
+
displayName: 'Known Exploited Only (KEV)',
|
|
648
|
+
name: 'kev',
|
|
649
|
+
type: 'boolean',
|
|
650
|
+
default: false,
|
|
651
|
+
description: 'Whether to only return CVEs in the CISA Known Exploited Vulnerabilities catalog',
|
|
652
|
+
},
|
|
653
|
+
],
|
|
654
|
+
},
|
|
655
|
+
{
|
|
656
|
+
displayName: 'Operation',
|
|
657
|
+
name: 'operation',
|
|
658
|
+
type: 'options',
|
|
659
|
+
noDataExpression: true,
|
|
660
|
+
displayOptions: { show: { resource: ['threatActor'] } },
|
|
661
|
+
options: [
|
|
662
|
+
{
|
|
663
|
+
name: 'List / Search',
|
|
664
|
+
value: 'list',
|
|
665
|
+
action: 'List or search threat actors',
|
|
666
|
+
description: 'List actors with optional filters (origin, motivation, sector)',
|
|
667
|
+
},
|
|
668
|
+
{
|
|
669
|
+
name: 'Get',
|
|
670
|
+
value: 'get',
|
|
671
|
+
action: 'Get a threat actor',
|
|
672
|
+
description: 'Get a single actor by slug, including aliases, tools, CVEs and techniques',
|
|
673
|
+
},
|
|
674
|
+
{
|
|
675
|
+
name: 'Get by CVE',
|
|
676
|
+
value: 'byCve',
|
|
677
|
+
action: 'Get actors that exploit a CVE',
|
|
678
|
+
description: 'Reverse lookup: which actors are known to exploit a given CVE',
|
|
679
|
+
},
|
|
680
|
+
],
|
|
681
|
+
default: 'list',
|
|
682
|
+
},
|
|
683
|
+
{
|
|
684
|
+
displayName: 'Actor Slug',
|
|
685
|
+
name: 'slug',
|
|
686
|
+
type: 'string',
|
|
687
|
+
required: true,
|
|
688
|
+
default: '',
|
|
689
|
+
placeholder: 'apt28',
|
|
690
|
+
displayOptions: { show: { resource: ['threatActor'], operation: ['get'] } },
|
|
691
|
+
description: 'The slug of the actor to retrieve',
|
|
692
|
+
},
|
|
693
|
+
{
|
|
694
|
+
displayName: 'CVE ID',
|
|
695
|
+
name: 'actorCveId',
|
|
696
|
+
type: 'string',
|
|
697
|
+
required: true,
|
|
698
|
+
default: '',
|
|
699
|
+
placeholder: 'CVE-2021-44228',
|
|
700
|
+
displayOptions: { show: { resource: ['threatActor'], operation: ['byCve'] } },
|
|
701
|
+
description: 'The CVE identifier to reverse-lookup actors for',
|
|
702
|
+
},
|
|
703
|
+
{
|
|
704
|
+
displayName: 'Filters',
|
|
705
|
+
name: 'actorFilters',
|
|
706
|
+
type: 'collection',
|
|
707
|
+
placeholder: 'Add Filter',
|
|
708
|
+
default: {},
|
|
709
|
+
displayOptions: { show: { resource: ['threatActor'], operation: ['list'] } },
|
|
710
|
+
options: [
|
|
711
|
+
{
|
|
712
|
+
displayName: 'Origin',
|
|
713
|
+
name: 'origin',
|
|
714
|
+
type: 'string',
|
|
715
|
+
default: '',
|
|
716
|
+
description: 'Filter by country of origin (e.g. "China", "Russia")',
|
|
717
|
+
},
|
|
718
|
+
{
|
|
719
|
+
displayName: 'Motivation',
|
|
720
|
+
name: 'motivation',
|
|
721
|
+
type: 'string',
|
|
722
|
+
default: '',
|
|
723
|
+
placeholder: 'Espionage',
|
|
724
|
+
description: 'Filter by motivation type',
|
|
725
|
+
},
|
|
726
|
+
{
|
|
727
|
+
displayName: 'Sector',
|
|
728
|
+
name: 'sector',
|
|
729
|
+
type: 'string',
|
|
730
|
+
default: '',
|
|
731
|
+
placeholder: 'Government',
|
|
732
|
+
description: 'Filter by targeted sector',
|
|
733
|
+
},
|
|
734
|
+
],
|
|
735
|
+
},
|
|
736
|
+
{
|
|
737
|
+
displayName: 'Limit',
|
|
738
|
+
name: 'limit',
|
|
739
|
+
type: 'number',
|
|
740
|
+
typeOptions: { minValue: 1 },
|
|
741
|
+
default: 50,
|
|
742
|
+
displayOptions: { show: { resource: ['threatActor'], operation: ['list'] } },
|
|
743
|
+
description: 'Max number of results to return',
|
|
744
|
+
},
|
|
745
|
+
{
|
|
746
|
+
displayName: 'Offset',
|
|
747
|
+
name: 'offset',
|
|
748
|
+
type: 'number',
|
|
749
|
+
default: 0,
|
|
750
|
+
displayOptions: { show: { resource: ['threatActor'], operation: ['list'] } },
|
|
751
|
+
description: 'Number of results to skip (for pagination)',
|
|
752
|
+
},
|
|
753
|
+
],
|
|
754
|
+
};
|
|
755
|
+
}
|
|
756
|
+
async execute() {
|
|
757
|
+
var _a;
|
|
758
|
+
const items = this.getInputData();
|
|
759
|
+
const returnData = [];
|
|
760
|
+
const resource = this.getNodeParameter('resource', 0);
|
|
761
|
+
const operation = this.getNodeParameter('operation', 0);
|
|
762
|
+
if ((resource === 'hash' || resource === 'crypto') && operation === 'bulk') {
|
|
763
|
+
return [await executeBulk.call(this, items, resource)];
|
|
764
|
+
}
|
|
765
|
+
for (let i = 0; i < items.length; i++) {
|
|
766
|
+
try {
|
|
767
|
+
let responseData = {};
|
|
768
|
+
if (resource === 'domain' && operation !== 'networkRequests') {
|
|
769
|
+
const domain = this.getNodeParameter('domain', i);
|
|
770
|
+
if (operation === 'scan') {
|
|
771
|
+
const waitForCompletion = this.getNodeParameter('waitForCompletion', i);
|
|
772
|
+
const launch = (await GenericFunctions_1.mlabCoreApiRequest.call(this, 'POST', '/scan/domain', {
|
|
773
|
+
domain,
|
|
774
|
+
}));
|
|
775
|
+
if (waitForCompletion) {
|
|
776
|
+
const timeout = this.getNodeParameter('timeout', i);
|
|
777
|
+
const intervalMs = 4000;
|
|
778
|
+
const maxAttempts = Math.max(1, Math.ceil((timeout * 1000) / intervalMs));
|
|
779
|
+
responseData = await GenericFunctions_1.pollDomainScan.call(this, domain, maxAttempts, intervalMs);
|
|
780
|
+
}
|
|
781
|
+
else {
|
|
782
|
+
responseData = launch;
|
|
783
|
+
}
|
|
784
|
+
}
|
|
785
|
+
else if (operation === 'status') {
|
|
786
|
+
responseData = (await GenericFunctions_1.mlabCoreApiRequest.call(this, 'GET', '/scan/domain/status', {}, {
|
|
787
|
+
domain,
|
|
788
|
+
}));
|
|
789
|
+
}
|
|
790
|
+
else if (operation === 'results') {
|
|
791
|
+
responseData = (await GenericFunctions_1.mlabCoreApiRequest.call(this, 'GET', '/scan/domain/results', {}, {
|
|
792
|
+
domain,
|
|
793
|
+
}));
|
|
794
|
+
}
|
|
795
|
+
else if (operation === 'ssl') {
|
|
796
|
+
responseData = (await GenericFunctions_1.mlabCoreApiRequest.call(this, 'GET', '/domain/ssl', {}, {
|
|
797
|
+
domain,
|
|
798
|
+
}));
|
|
799
|
+
}
|
|
800
|
+
}
|
|
801
|
+
else if (resource === 'domain' && operation === 'networkRequests') {
|
|
802
|
+
const url = this.getNodeParameter('pageUrl', i);
|
|
803
|
+
responseData = (await GenericFunctions_1.mlabCoreApiRequest.call(this, 'GET', '/scan/domain/loadnetworkrequest', {}, { url }));
|
|
804
|
+
}
|
|
805
|
+
else if (resource === 'ip') {
|
|
806
|
+
const ip = this.getNodeParameter('ip', i);
|
|
807
|
+
responseData = (await GenericFunctions_1.mlabCoreApiRequest.call(this, 'GET', '/scan/ip', {}, {
|
|
808
|
+
ip,
|
|
809
|
+
}));
|
|
810
|
+
}
|
|
811
|
+
else if (resource === 'crypto') {
|
|
812
|
+
const chain = this.getNodeParameter('chain', i);
|
|
813
|
+
const address = this.getNodeParameter('address', i);
|
|
814
|
+
const qs = { address };
|
|
815
|
+
if (chain)
|
|
816
|
+
qs.chain = chain;
|
|
817
|
+
responseData = (await GenericFunctions_1.mlabCoreApiRequest.call(this, 'GET', '/scan/crypto', {}, qs));
|
|
818
|
+
}
|
|
819
|
+
else if (resource === 'file') {
|
|
820
|
+
if (operation === 'upload') {
|
|
821
|
+
const binaryPropertyName = this.getNodeParameter('binaryPropertyName', i);
|
|
822
|
+
const binaryData = this.helpers.assertBinaryData(i, binaryPropertyName);
|
|
823
|
+
const buffer = await this.helpers.getBinaryDataBuffer(i, binaryPropertyName);
|
|
824
|
+
responseData = (await GenericFunctions_1.mlabCoreApiRequest.call(this, 'POST', '/upload/file', {}, {}, {
|
|
825
|
+
body: {
|
|
826
|
+
file: {
|
|
827
|
+
value: buffer,
|
|
828
|
+
options: {
|
|
829
|
+
filename: (_a = binaryData.fileName) !== null && _a !== void 0 ? _a : 'file',
|
|
830
|
+
contentType: binaryData.mimeType,
|
|
831
|
+
},
|
|
832
|
+
},
|
|
833
|
+
},
|
|
834
|
+
headers: { 'Content-Type': 'multipart/form-data' },
|
|
835
|
+
json: false,
|
|
836
|
+
}));
|
|
837
|
+
}
|
|
838
|
+
else if (operation === 'results') {
|
|
839
|
+
const sha256 = this.getNodeParameter('sha256', i);
|
|
840
|
+
responseData = (await GenericFunctions_1.mlabCoreApiRequest.call(this, 'GET', '/scan/file/results', {}, {
|
|
841
|
+
sha256,
|
|
842
|
+
}));
|
|
843
|
+
}
|
|
844
|
+
else if (operation === 'output') {
|
|
845
|
+
responseData = (await GenericFunctions_1.mlabCoreApiRequest.call(this, 'GET', '/scan/file/output', {}, {
|
|
846
|
+
sha256: this.getNodeParameter('sha256', i),
|
|
847
|
+
tool: this.getNodeParameter('tool', i),
|
|
848
|
+
}));
|
|
849
|
+
}
|
|
850
|
+
}
|
|
851
|
+
else if (resource === 'hash') {
|
|
852
|
+
responseData = (await GenericFunctions_1.mlabCoreApiRequest.call(this, 'GET', '/scan/hash', {}, {
|
|
853
|
+
hash: this.getNodeParameter('hash', i),
|
|
854
|
+
}));
|
|
855
|
+
}
|
|
856
|
+
else if (resource === 'url') {
|
|
857
|
+
const qs = { url: this.getNodeParameter('url', i) };
|
|
858
|
+
if (this.getNodeParameter('resolve', i))
|
|
859
|
+
qs.resolve = 'true';
|
|
860
|
+
responseData = (await GenericFunctions_1.mlabCoreApiRequest.call(this, 'GET', '/scan/url', {}, qs));
|
|
861
|
+
}
|
|
862
|
+
else if (resource === 'email') {
|
|
863
|
+
responseData = (await GenericFunctions_1.mlabCoreApiRequest.call(this, 'GET', '/scan/email', {}, {
|
|
864
|
+
email: this.getNodeParameter('email', i),
|
|
865
|
+
}));
|
|
866
|
+
}
|
|
867
|
+
else if (resource === 'phone') {
|
|
868
|
+
responseData = (await GenericFunctions_1.mlabCoreApiRequest.call(this, 'GET', '/scan/phone', {}, {
|
|
869
|
+
number: this.getNodeParameter('number', i),
|
|
870
|
+
}));
|
|
871
|
+
}
|
|
872
|
+
else if (resource === 'mac') {
|
|
873
|
+
responseData = (await GenericFunctions_1.mlabCoreApiRequest.call(this, 'GET', '/scan/mac', {}, {
|
|
874
|
+
mac: this.getNodeParameter('mac', i),
|
|
875
|
+
}));
|
|
876
|
+
}
|
|
877
|
+
else if (resource === 'ioc') {
|
|
878
|
+
const risk = this.getNodeParameter('risk', i);
|
|
879
|
+
const qs = {};
|
|
880
|
+
if (risk) {
|
|
881
|
+
qs.risk = risk;
|
|
882
|
+
qs.country = this.getNodeParameter('country', i);
|
|
883
|
+
}
|
|
884
|
+
responseData = (await GenericFunctions_1.mlabCoreApiRequest.call(this, 'POST', '/scan/ioc', { text: this.getNodeParameter('text', i) }, qs));
|
|
885
|
+
}
|
|
886
|
+
else if (resource === 'quota') {
|
|
887
|
+
const scanType = this.getNodeParameter('scanType', i);
|
|
888
|
+
responseData = (await GenericFunctions_1.mlabCoreApiRequest.call(this, 'GET', `/limit/${scanType}`));
|
|
889
|
+
}
|
|
890
|
+
else if (resource === 'cve') {
|
|
891
|
+
if (operation === 'get') {
|
|
892
|
+
const cveId = this.getNodeParameter('cveId', i).trim().toUpperCase();
|
|
893
|
+
responseData = (await GenericFunctions_1.mlabPublicApiRequest.call(this, GenericFunctions_1.MLAB_CVE_BASE_URL, 'GET', `/cve/${encodeURIComponent(cveId)}`));
|
|
894
|
+
}
|
|
895
|
+
else if (operation === 'latest') {
|
|
896
|
+
responseData = (await GenericFunctions_1.mlabPublicApiRequest.call(this, GenericFunctions_1.MLAB_CVE_BASE_URL, 'GET', '/cve/latest'));
|
|
897
|
+
}
|
|
898
|
+
else if (operation === 'search') {
|
|
899
|
+
const query = this.getNodeParameter('query', i);
|
|
900
|
+
const filters = this.getNodeParameter('cveFilters', i, {});
|
|
901
|
+
const qs = { q: query };
|
|
902
|
+
if (filters.severity)
|
|
903
|
+
qs.severity = filters.severity;
|
|
904
|
+
if (filters.exact)
|
|
905
|
+
qs.exact = 1;
|
|
906
|
+
if (filters.kev)
|
|
907
|
+
qs.kev = 1;
|
|
908
|
+
if (filters.dateStart) {
|
|
909
|
+
qs.dateStart = filters.dateStart.slice(0, 10);
|
|
910
|
+
}
|
|
911
|
+
responseData = (await GenericFunctions_1.mlabPublicApiRequest.call(this, GenericFunctions_1.MLAB_CVE_BASE_URL, 'GET', '/cve', qs));
|
|
912
|
+
}
|
|
913
|
+
}
|
|
914
|
+
else if (resource === 'threatActor') {
|
|
915
|
+
if (operation === 'get') {
|
|
916
|
+
const slug = this.getNodeParameter('slug', i).trim();
|
|
917
|
+
responseData = (await GenericFunctions_1.mlabPublicApiRequest.call(this, GenericFunctions_1.MLAB_ACTORS_BASE_URL, 'GET', `/actors/${encodeURIComponent(slug)}`));
|
|
918
|
+
}
|
|
919
|
+
else if (operation === 'byCve') {
|
|
920
|
+
const cveId = this.getNodeParameter('actorCveId', i).trim().toUpperCase();
|
|
921
|
+
responseData = (await GenericFunctions_1.mlabPublicApiRequest.call(this, GenericFunctions_1.MLAB_ACTORS_BASE_URL, 'GET', `/cves/${encodeURIComponent(cveId)}/actors`));
|
|
922
|
+
}
|
|
923
|
+
else if (operation === 'list') {
|
|
924
|
+
const filters = this.getNodeParameter('actorFilters', i, {});
|
|
925
|
+
const limit = this.getNodeParameter('limit', i);
|
|
926
|
+
const offset = this.getNodeParameter('offset', i);
|
|
927
|
+
const qs = { limit, offset };
|
|
928
|
+
if (filters.origin)
|
|
929
|
+
qs.origin = filters.origin;
|
|
930
|
+
if (filters.motivation)
|
|
931
|
+
qs.motivation = filters.motivation;
|
|
932
|
+
if (filters.sector)
|
|
933
|
+
qs.sector = filters.sector;
|
|
934
|
+
responseData = (await GenericFunctions_1.mlabPublicApiRequest.call(this, GenericFunctions_1.MLAB_ACTORS_BASE_URL, 'GET', '/actors', qs));
|
|
935
|
+
}
|
|
936
|
+
}
|
|
937
|
+
else {
|
|
938
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Unknown resource "${resource}"`, {
|
|
939
|
+
itemIndex: i,
|
|
940
|
+
});
|
|
941
|
+
}
|
|
942
|
+
const executionData = this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray(responseData), { itemData: { item: i } });
|
|
943
|
+
returnData.push(...executionData);
|
|
944
|
+
}
|
|
945
|
+
catch (error) {
|
|
946
|
+
if (this.continueOnFail()) {
|
|
947
|
+
returnData.push({
|
|
948
|
+
json: { error: error.message },
|
|
949
|
+
pairedItem: { item: i },
|
|
950
|
+
});
|
|
951
|
+
continue;
|
|
952
|
+
}
|
|
953
|
+
throw error;
|
|
954
|
+
}
|
|
955
|
+
}
|
|
956
|
+
return [returnData];
|
|
957
|
+
}
|
|
958
|
+
}
|
|
959
|
+
exports.Mlab = Mlab;
|
|
960
|
+
//# sourceMappingURL=Mlab.node.js.map
|