n8n-nodes-tenable 1.0.0 → 1.0.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.
|
@@ -17,7 +17,8 @@ async function tenableApiRequest(method, endpoint, body = {}, qs = {}) {
|
|
|
17
17
|
body,
|
|
18
18
|
json: true,
|
|
19
19
|
};
|
|
20
|
-
|
|
20
|
+
// Only remove body for GET requests - POST/PUT requests may need empty body
|
|
21
|
+
if (Object.keys(body).length === 0 && method === 'GET') {
|
|
21
22
|
delete options.body;
|
|
22
23
|
}
|
|
23
24
|
if (Object.keys(qs).length === 0) {
|
|
@@ -125,6 +125,12 @@ class TenableOne {
|
|
|
125
125
|
},
|
|
126
126
|
},
|
|
127
127
|
options: [
|
|
128
|
+
{
|
|
129
|
+
name: 'Get All Assets',
|
|
130
|
+
value: 'getAllAssets',
|
|
131
|
+
description: 'Get all assets from exposure management',
|
|
132
|
+
action: 'Get all assets',
|
|
133
|
+
},
|
|
128
134
|
{
|
|
129
135
|
name: 'Get Asset Properties',
|
|
130
136
|
value: 'getAssetProperties',
|
|
@@ -258,6 +264,76 @@ class TenableOne {
|
|
|
258
264
|
default: '',
|
|
259
265
|
description: 'The ID of the exposure view card',
|
|
260
266
|
},
|
|
267
|
+
// Return All for Get All Assets
|
|
268
|
+
{
|
|
269
|
+
displayName: 'Return All',
|
|
270
|
+
name: 'returnAll',
|
|
271
|
+
type: 'boolean',
|
|
272
|
+
displayOptions: {
|
|
273
|
+
show: {
|
|
274
|
+
resource: ['inventory'],
|
|
275
|
+
operation: ['getAllAssets'],
|
|
276
|
+
},
|
|
277
|
+
},
|
|
278
|
+
default: false,
|
|
279
|
+
description: 'Whether to return all results or only up to a given limit',
|
|
280
|
+
},
|
|
281
|
+
// Limit for Get All Assets
|
|
282
|
+
{
|
|
283
|
+
displayName: 'Limit',
|
|
284
|
+
name: 'limit',
|
|
285
|
+
type: 'number',
|
|
286
|
+
displayOptions: {
|
|
287
|
+
show: {
|
|
288
|
+
resource: ['inventory'],
|
|
289
|
+
operation: ['getAllAssets'],
|
|
290
|
+
returnAll: [false],
|
|
291
|
+
},
|
|
292
|
+
},
|
|
293
|
+
typeOptions: {
|
|
294
|
+
minValue: 1,
|
|
295
|
+
maxValue: 1000,
|
|
296
|
+
},
|
|
297
|
+
default: 100,
|
|
298
|
+
description: 'Max number of results to return',
|
|
299
|
+
},
|
|
300
|
+
// Options for Get All Assets
|
|
301
|
+
{
|
|
302
|
+
displayName: 'Options',
|
|
303
|
+
name: 'getAllAssetsOptions',
|
|
304
|
+
type: 'collection',
|
|
305
|
+
placeholder: 'Add Option',
|
|
306
|
+
default: {},
|
|
307
|
+
displayOptions: {
|
|
308
|
+
show: {
|
|
309
|
+
resource: ['inventory'],
|
|
310
|
+
operation: ['getAllAssets'],
|
|
311
|
+
},
|
|
312
|
+
},
|
|
313
|
+
options: [
|
|
314
|
+
{
|
|
315
|
+
displayName: 'Extra Properties',
|
|
316
|
+
name: 'extra_properties',
|
|
317
|
+
type: 'string',
|
|
318
|
+
default: '',
|
|
319
|
+
description: 'Comma-separated list of extra properties to include in the response',
|
|
320
|
+
},
|
|
321
|
+
{
|
|
322
|
+
displayName: 'Filters (JSON)',
|
|
323
|
+
name: 'filters',
|
|
324
|
+
type: 'string',
|
|
325
|
+
default: '',
|
|
326
|
+
description: 'JSON array of filter objects. Each filter has "property", "operator", and "value" fields.',
|
|
327
|
+
},
|
|
328
|
+
{
|
|
329
|
+
displayName: 'Sort',
|
|
330
|
+
name: 'sort',
|
|
331
|
+
type: 'string',
|
|
332
|
+
default: '',
|
|
333
|
+
description: 'Sort results by property:direction (e.g., "aes:desc")',
|
|
334
|
+
},
|
|
335
|
+
],
|
|
336
|
+
},
|
|
261
337
|
// Search Query Mode
|
|
262
338
|
{
|
|
263
339
|
displayName: 'Query Mode',
|
|
@@ -524,6 +600,34 @@ class TenableOne {
|
|
|
524
600
|
if (operation === 'getSoftwareProperties') {
|
|
525
601
|
responseData = (await GenericFunctions_1.tenableApiRequest.call(this, 'GET', '/api/v1/t1/inventory/software/properties'));
|
|
526
602
|
}
|
|
603
|
+
if (operation === 'getAllAssets') {
|
|
604
|
+
const returnAll = this.getNodeParameter('returnAll', i);
|
|
605
|
+
const options = this.getNodeParameter('getAllAssetsOptions', i);
|
|
606
|
+
const body = {};
|
|
607
|
+
const qs = {};
|
|
608
|
+
// Handle optional filters
|
|
609
|
+
if (options.filters) {
|
|
610
|
+
const filters = (0, GenericFunctions_1.validateJSON)(options.filters);
|
|
611
|
+
if (filters) {
|
|
612
|
+
body.filters = filters;
|
|
613
|
+
}
|
|
614
|
+
}
|
|
615
|
+
// Handle query string options
|
|
616
|
+
if (options.sort)
|
|
617
|
+
qs.sort = options.sort;
|
|
618
|
+
if (options.extra_properties)
|
|
619
|
+
qs.extra_properties = options.extra_properties;
|
|
620
|
+
if (returnAll) {
|
|
621
|
+
// Fetch all assets with pagination
|
|
622
|
+
responseData = await GenericFunctions_1.tenableApiRequestAllItems.call(this, 'POST', '/api/v1/t1/inventory/assets/search', 'items', body, qs);
|
|
623
|
+
}
|
|
624
|
+
else {
|
|
625
|
+
// Fetch limited results
|
|
626
|
+
const limit = this.getNodeParameter('limit', i);
|
|
627
|
+
qs.limit = limit;
|
|
628
|
+
responseData = (await GenericFunctions_1.tenableApiRequest.call(this, 'POST', '/api/v1/t1/inventory/assets/search', body, qs));
|
|
629
|
+
}
|
|
630
|
+
}
|
|
527
631
|
if (operation === 'searchAssets' ||
|
|
528
632
|
operation === 'searchFindings' ||
|
|
529
633
|
operation === 'searchSoftware') {
|