n8n-nodes-dragosplatform 0.2.2 → 0.3.0

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 CHANGED
@@ -13,17 +13,27 @@ Follow the [installation guide](https://docs.n8n.io/integrations/community-nodes
13
13
  ## Operations
14
14
 
15
15
  ### Asset
16
+ - **Add Software Package**: Add a software package to an asset
17
+ - **Create**: Create a new asset
18
+ - **Delete**: Delete assets by ID
19
+ - **Delete Software Package**: Remove a software package from an asset
20
+ - **Export**: Export assets to CSV
21
+ - **Get Addresses**: Get addresses for assets
22
+ - **Get Attribute Names**: Get all asset attribute names
16
23
  - **Get Many**: Retrieve multiple assets
17
- - **Search**: Search assets with filters
18
24
  - **Get Stats**: Get asset statistics grouped by field
25
+ - **Search**: Search assets with filters
19
26
  - **Update Attributes**: Update asset attributes
20
- - **Add Software Package**: Add a software package to an asset
21
27
 
22
28
  ### Notification
23
- - **Get Many**: Retrieve notifications with FIQL filtering
29
+ - **Create**: Create a new notification
30
+ - **Delete**: Delete a notification by ID
31
+ - **Export**: Export notifications to CSV/JSON
24
32
  - **Get**: Get a specific notification by ID
25
- - **Update**: Update notifications matching a filter
33
+ - **Get Many**: Retrieve notifications with FIQL filtering
26
34
  - **Get Stats**: Get notification statistics
35
+ - **Review**: Mark notifications as reviewed
36
+ - **Update**: Update notifications matching a filter
27
37
 
28
38
  ### Vulnerability
29
39
  - **Get Many**: Retrieve vulnerabilities with pagination
@@ -37,20 +47,42 @@ Follow the [installation guide](https://docs.n8n.io/integrations/community-nodes
37
47
  - **Set Disposition**: Set disposition of detections
38
48
  - **Export**: Export detections as CSV
39
49
 
50
+ ### Vulnerability Detection Rule
51
+ - **Create**: Create a new detection rule
52
+ - **Delete**: Delete a detection rule
53
+ - **Get Many**: List detection rules
54
+ - **Update**: Update a detection rule
55
+
56
+ ### Vulnerability Audit Log
57
+ - **Get Many**: Retrieve vulnerability management audit logs
58
+ - **Get Stats**: Get audit log statistics
59
+
40
60
  ### Data Import Job
41
- - **Get Many**: List data import jobs
42
- - **Get**: Get a specific job
43
61
  - **Create**: Create a new import job
44
62
  - **Continue**: Continue a paused job
45
- - **Stop**: Stop a running job
46
63
  - **Delete**: Delete a job
64
+ - **Get**: Get a specific job
65
+ - **Get Many**: List data import jobs
66
+ - **Stop**: Stop a running job
67
+
68
+ ### Job Config
69
+ - **Create**: Create a new job configuration
70
+ - **Delete**: Delete a job configuration
71
+ - **Get**: Get a specific job configuration
72
+ - **Get Many**: List job configurations
73
+ - **Update**: Update a job configuration
74
+
75
+ ### Parser
76
+ - **Delete**: Delete a parser
77
+ - **Get**: Download a parser by ID
78
+ - **Get Many**: List available parsers
47
79
 
48
80
  ### Zone
49
- - **Get Many**: List zones
50
- - **Get**: Get a specific zone
51
81
  - **Create**: Create a new zone
52
- - **Update**: Update a zone
53
82
  - **Delete**: Delete a zone
83
+ - **Get**: Get a specific zone
84
+ - **Get Many**: List zones
85
+ - **Update**: Update a zone
54
86
 
55
87
  ## Credentials
56
88
 
@@ -66,7 +98,7 @@ You can generate API keys in the Dragos platform under Settings > API Keys.
66
98
 
67
99
  This node has been tested with:
68
100
  - n8n version 1.20+
69
- - Dragos Platform API v4 (Assets), v2 (Notifications), v1 (Vulnerabilities, Auth, Data Import)
101
+ - Dragos Platform API v4 (Assets, Zones), v2 (Notifications), v1 (Vulnerabilities, Data Import Service)
70
102
 
71
103
  ## Resources
72
104
 
@@ -88,6 +88,51 @@ async function executeAssetOperation(context, itemIndex, operation, baseUrl) {
88
88
  };
89
89
  return await makeRequest(context, 'POST', `${baseUrl}/api/v4/addAssetSoftwarePackage`, body);
90
90
  }
91
+ if (operation === 'create') {
92
+ const assetFields = context.getNodeParameter('assetFields', itemIndex, {});
93
+ return await makeRequest(context, 'POST', `${baseUrl}/api/v4/createAsset`, assetFields);
94
+ }
95
+ if (operation === 'delete') {
96
+ const assetIds = context.getNodeParameter('assetIds', itemIndex);
97
+ const ids = assetIds.split(',').map((id) => parseInt(id.trim(), 10));
98
+ const body = {
99
+ assetIds: ids,
100
+ };
101
+ return await makeRequest(context, 'POST', `${baseUrl}/api/v4/deleteAssets`, body);
102
+ }
103
+ if (operation === 'deleteSoftwarePackage') {
104
+ const assetId = context.getNodeParameter('assetId', itemIndex);
105
+ const softwareId = context.getNodeParameter('softwareId', itemIndex);
106
+ const body = {
107
+ assetId,
108
+ softwareId,
109
+ };
110
+ return await makeRequest(context, 'POST', `${baseUrl}/api/v4/deleteAssetSoftwarePackage`, body);
111
+ }
112
+ if (operation === 'export') {
113
+ const selector = context.getNodeParameter('selector', itemIndex, '{}');
114
+ const body = {
115
+ selector: JSON.parse(selector),
116
+ };
117
+ return await makeRequest(context, 'POST', `${baseUrl}/api/v4/exportAssets`, body);
118
+ }
119
+ if (operation === 'getAddresses') {
120
+ const selector = context.getNodeParameter('selector', itemIndex, '{}');
121
+ const returnAll = context.getNodeParameter('returnAll', itemIndex);
122
+ const limit = returnAll ? 1000 : context.getNodeParameter('limit', itemIndex);
123
+ const body = {
124
+ selector: JSON.parse(selector),
125
+ pagination: {
126
+ pageNumber: 0,
127
+ pageSize: limit,
128
+ },
129
+ };
130
+ const response = await makeRequest(context, 'POST', `${baseUrl}/api/v4/getAddresses`, body);
131
+ return response.content || response;
132
+ }
133
+ if (operation === 'getAttributeNames') {
134
+ return await makeRequest(context, 'POST', `${baseUrl}/api/v4/getAssetAttributeNames`, {});
135
+ }
91
136
  throw new n8n_workflow_1.NodeOperationError(context.getNode(), `Unknown operation: ${operation}`);
92
137
  }
93
138
  async function executeNotificationOperation(context, itemIndex, operation, baseUrl) {
@@ -133,6 +178,34 @@ async function executeNotificationOperation(context, itemIndex, operation, baseU
133
178
  }
134
179
  return await makeRequest(context, 'GET', `${baseUrl}/api/v2/notification/stats`, undefined, qs);
135
180
  }
181
+ if (operation === 'create') {
182
+ const notificationFields = context.getNodeParameter('notificationFields', itemIndex, {});
183
+ return await makeRequest(context, 'POST', `${baseUrl}/api/v2/notification`, notificationFields);
184
+ }
185
+ if (operation === 'delete') {
186
+ const notificationId = context.getNodeParameter('notificationId', itemIndex);
187
+ return await makeRequest(context, 'DELETE', `${baseUrl}/api/v2/notification/${notificationId}`);
188
+ }
189
+ if (operation === 'export') {
190
+ const filter = context.getNodeParameter('filter', itemIndex, '');
191
+ const exportFormat = context.getNodeParameter('exportFormat', itemIndex, 'csv');
192
+ const body = {
193
+ format: exportFormat,
194
+ };
195
+ const qs = {};
196
+ if (filter) {
197
+ qs.filter = filter;
198
+ }
199
+ return await makeRequest(context, 'POST', `${baseUrl}/api/v2/notification/export`, body, qs);
200
+ }
201
+ if (operation === 'review') {
202
+ const filter = context.getNodeParameter('filter', itemIndex, '');
203
+ const qs = {};
204
+ if (filter) {
205
+ qs.filter = filter;
206
+ }
207
+ return await makeRequest(context, 'POST', `${baseUrl}/api/v2/notification/review`, {}, qs);
208
+ }
136
209
  throw new n8n_workflow_1.NodeOperationError(context.getNode(), `Unknown operation: ${operation}`);
137
210
  }
138
211
  async function executeVulnerabilityOperation(context, itemIndex, operation, baseUrl) {
@@ -351,6 +424,145 @@ async function executeZoneOperation(context, itemIndex, operation, baseUrl) {
351
424
  }
352
425
  throw new n8n_workflow_1.NodeOperationError(context.getNode(), `Unknown operation: ${operation}`);
353
426
  }
427
+ async function executeParserOperation(context, itemIndex, operation, baseUrl) {
428
+ const ddisBaseUrl = `${baseUrl}/ddis`;
429
+ if (operation === 'getMany') {
430
+ const returnAll = context.getNodeParameter('returnAll', itemIndex);
431
+ const limit = returnAll ? 0 : context.getNodeParameter('limit', itemIndex);
432
+ const qs = {
433
+ page_size: limit,
434
+ page_number: 0,
435
+ };
436
+ const response = await makeRequest(context, 'GET', `${ddisBaseUrl}/api/v1/parsers/`, undefined, qs);
437
+ return response.content || response;
438
+ }
439
+ if (operation === 'get') {
440
+ const parserId = context.getNodeParameter('parserId', itemIndex);
441
+ return await makeRequest(context, 'GET', `${ddisBaseUrl}/api/v1/parsers/${parserId}`);
442
+ }
443
+ if (operation === 'delete') {
444
+ const parserId = context.getNodeParameter('parserId', itemIndex);
445
+ return await makeRequest(context, 'DELETE', `${ddisBaseUrl}/api/v1/parsers/${parserId}`);
446
+ }
447
+ throw new n8n_workflow_1.NodeOperationError(context.getNode(), `Unknown operation: ${operation}`);
448
+ }
449
+ async function executeJobConfigOperation(context, itemIndex, operation, baseUrl) {
450
+ const ddisBaseUrl = `${baseUrl}/ddis`;
451
+ if (operation === 'getMany') {
452
+ const returnAll = context.getNodeParameter('returnAll', itemIndex);
453
+ const limit = returnAll ? 0 : context.getNodeParameter('limit', itemIndex);
454
+ const qs = {
455
+ page_size: limit,
456
+ page_number: 0,
457
+ };
458
+ const response = await makeRequest(context, 'GET', `${ddisBaseUrl}/api/v1/configs/`, undefined, qs);
459
+ return response.content || response;
460
+ }
461
+ if (operation === 'get') {
462
+ const configId = context.getNodeParameter('configId', itemIndex);
463
+ return await makeRequest(context, 'GET', `${ddisBaseUrl}/api/v1/configs/${configId}`);
464
+ }
465
+ if (operation === 'create') {
466
+ const configFields = context.getNodeParameter('jobConfigFields', itemIndex, {});
467
+ return await makeRequest(context, 'POST', `${ddisBaseUrl}/api/v1/configs/`, configFields);
468
+ }
469
+ if (operation === 'update') {
470
+ const configId = context.getNodeParameter('configId', itemIndex);
471
+ const configFields = context.getNodeParameter('jobConfigFields', itemIndex, {});
472
+ return await makeRequest(context, 'PUT', `${ddisBaseUrl}/api/v1/configs/${configId}`, configFields);
473
+ }
474
+ if (operation === 'delete') {
475
+ const configId = context.getNodeParameter('configId', itemIndex);
476
+ return await makeRequest(context, 'DELETE', `${ddisBaseUrl}/api/v1/configs/${configId}`);
477
+ }
478
+ throw new n8n_workflow_1.NodeOperationError(context.getNode(), `Unknown operation: ${operation}`);
479
+ }
480
+ async function executeVulnerabilityDetectionRuleOperation(context, itemIndex, operation, baseUrl) {
481
+ if (operation === 'getMany') {
482
+ const selector = context.getNodeParameter('selector', itemIndex, '{}');
483
+ const returnAll = context.getNodeParameter('returnAll', itemIndex);
484
+ const limit = returnAll ? 1000 : context.getNodeParameter('limit', itemIndex);
485
+ const body = {
486
+ selector: JSON.parse(selector),
487
+ pagination: {
488
+ pageNumber: 0,
489
+ pageSize: limit,
490
+ },
491
+ };
492
+ const response = await makeRequest(context, 'POST', `${baseUrl}/api/v1/vulnerability/detection/rules`, body);
493
+ return response.content || response;
494
+ }
495
+ if (operation === 'create') {
496
+ const ruleFields = context.getNodeParameter('ruleFields', itemIndex, {});
497
+ const body = {
498
+ name: ruleFields.name || '',
499
+ description: ruleFields.description || '',
500
+ selector: ruleFields.selector ? JSON.parse(ruleFields.selector) : {},
501
+ actions: [],
502
+ };
503
+ if (ruleFields.category)
504
+ body.category = ruleFields.category;
505
+ if (ruleFields.expiration)
506
+ body.expiration = ruleFields.expiration;
507
+ return await makeRequest(context, 'POST', `${baseUrl}/api/v1/vulnerability/detection/rules/create`, body);
508
+ }
509
+ if (operation === 'update') {
510
+ const ruleUuid = context.getNodeParameter('ruleUuid', itemIndex);
511
+ const ruleFields = context.getNodeParameter('ruleFields', itemIndex, {});
512
+ const body = {
513
+ uuid: ruleUuid,
514
+ };
515
+ if (ruleFields.name)
516
+ body.name = ruleFields.name;
517
+ if (ruleFields.description)
518
+ body.description = ruleFields.description;
519
+ if (ruleFields.selector)
520
+ body.selector = JSON.parse(ruleFields.selector);
521
+ if (ruleFields.category)
522
+ body.category = ruleFields.category;
523
+ if (ruleFields.expiration)
524
+ body.expiration = ruleFields.expiration;
525
+ return await makeRequest(context, 'POST', `${baseUrl}/api/v1/vulnerability/detection/rules/update`, body);
526
+ }
527
+ if (operation === 'delete') {
528
+ const ruleUuid = context.getNodeParameter('ruleUuid', itemIndex);
529
+ const body = {
530
+ uuid: ruleUuid,
531
+ };
532
+ return await makeRequest(context, 'POST', `${baseUrl}/api/v1/vulnerability/detection/rules/delete`, body);
533
+ }
534
+ throw new n8n_workflow_1.NodeOperationError(context.getNode(), `Unknown operation: ${operation}`);
535
+ }
536
+ async function executeVulnerabilityAuditLogOperation(context, itemIndex, operation, baseUrl) {
537
+ var _a;
538
+ if (operation === 'getMany') {
539
+ const selector = context.getNodeParameter('selector', itemIndex, '{}');
540
+ const returnAll = context.getNodeParameter('returnAll', itemIndex);
541
+ const limit = returnAll ? 1000 : context.getNodeParameter('limit', itemIndex);
542
+ const body = {
543
+ selector: JSON.parse(selector),
544
+ pagination: {
545
+ pageNumber: 0,
546
+ pageSize: limit,
547
+ },
548
+ };
549
+ const response = await makeRequest(context, 'POST', `${baseUrl}/api/v1/vulnerability/managementAuditLogs`, body);
550
+ return response.content || response;
551
+ }
552
+ if (operation === 'getStats') {
553
+ const selector = context.getNodeParameter('selector', itemIndex, '{}');
554
+ const groupBys = context.getNodeParameter('groupBys', itemIndex, {});
555
+ const body = {
556
+ selector: JSON.parse(selector),
557
+ groupBys: ((_a = groupBys.groupBy) === null || _a === void 0 ? void 0 : _a.map((g) => ({
558
+ field: g.field,
559
+ interval: g.interval || undefined,
560
+ }))) || [],
561
+ };
562
+ return await makeRequest(context, 'POST', `${baseUrl}/api/v1/vulnerability/managementAuditLogs/stats`, body);
563
+ }
564
+ throw new n8n_workflow_1.NodeOperationError(context.getNode(), `Unknown operation: ${operation}`);
565
+ }
354
566
  class Dragos {
355
567
  constructor() {
356
568
  this.description = {
@@ -383,21 +595,37 @@ class Dragos {
383
595
  name: 'Asset',
384
596
  value: 'asset',
385
597
  },
598
+ {
599
+ name: 'Data Import Job',
600
+ value: 'job',
601
+ },
602
+ {
603
+ name: 'Job Config',
604
+ value: 'jobConfig',
605
+ },
386
606
  {
387
607
  name: 'Notification',
388
608
  value: 'notification',
389
609
  },
610
+ {
611
+ name: 'Parser',
612
+ value: 'parser',
613
+ },
390
614
  {
391
615
  name: 'Vulnerability',
392
616
  value: 'vulnerability',
393
617
  },
618
+ {
619
+ name: 'Vulnerability Audit Log',
620
+ value: 'vulnerabilityAuditLog',
621
+ },
394
622
  {
395
623
  name: 'Vulnerability Detection',
396
624
  value: 'vulnerabilityDetection',
397
625
  },
398
626
  {
399
- name: 'Data Import Job',
400
- value: 'job',
627
+ name: 'Vulnerability Detection Rule',
628
+ value: 'vulnerabilityDetectionRule',
401
629
  },
402
630
  {
403
631
  name: 'Zone',
@@ -418,36 +646,72 @@ class Dragos {
418
646
  },
419
647
  },
420
648
  options: [
649
+ {
650
+ name: 'Add Software Package',
651
+ value: 'addSoftwarePackage',
652
+ description: 'Add software package to asset',
653
+ action: 'Add software package to asset',
654
+ },
655
+ {
656
+ name: 'Create',
657
+ value: 'create',
658
+ description: 'Create a new asset',
659
+ action: 'Create an asset',
660
+ },
661
+ {
662
+ name: 'Delete',
663
+ value: 'delete',
664
+ description: 'Delete assets',
665
+ action: 'Delete assets',
666
+ },
667
+ {
668
+ name: 'Delete Software Package',
669
+ value: 'deleteSoftwarePackage',
670
+ description: 'Remove software package from asset',
671
+ action: 'Remove software package from asset',
672
+ },
673
+ {
674
+ name: 'Export',
675
+ value: 'export',
676
+ description: 'Export assets to CSV',
677
+ action: 'Export assets',
678
+ },
679
+ {
680
+ name: 'Get Addresses',
681
+ value: 'getAddresses',
682
+ description: 'Get addresses for assets',
683
+ action: 'Get addresses',
684
+ },
685
+ {
686
+ name: 'Get Attribute Names',
687
+ value: 'getAttributeNames',
688
+ description: 'Get all asset attribute names',
689
+ action: 'Get attribute names',
690
+ },
421
691
  {
422
692
  name: 'Get Many',
423
693
  value: 'getMany',
424
694
  description: 'Get many assets',
425
695
  action: 'Get many assets',
426
696
  },
427
- {
428
- name: 'Search',
429
- value: 'search',
430
- description: 'Search assets with filters',
431
- action: 'Search assets',
432
- },
433
697
  {
434
698
  name: 'Get Stats',
435
699
  value: 'getStats',
436
700
  description: 'Get asset statistics',
437
701
  action: 'Get asset statistics',
438
702
  },
703
+ {
704
+ name: 'Search',
705
+ value: 'search',
706
+ description: 'Search assets with filters',
707
+ action: 'Search assets',
708
+ },
439
709
  {
440
710
  name: 'Update Attributes',
441
711
  value: 'updateAttributes',
442
712
  description: 'Update asset attributes',
443
713
  action: 'Update asset attributes',
444
714
  },
445
- {
446
- name: 'Add Software Package',
447
- value: 'addSoftwarePackage',
448
- description: 'Add software package to asset',
449
- action: 'Add software package to asset',
450
- },
451
715
  ],
452
716
  default: 'getMany',
453
717
  },
@@ -464,10 +728,22 @@ class Dragos {
464
728
  },
465
729
  options: [
466
730
  {
467
- name: 'Get Many',
468
- value: 'getMany',
469
- description: 'Get many notifications',
470
- action: 'Get many notifications',
731
+ name: 'Create',
732
+ value: 'create',
733
+ description: 'Create a new notification',
734
+ action: 'Create a notification',
735
+ },
736
+ {
737
+ name: 'Delete',
738
+ value: 'delete',
739
+ description: 'Delete a notification',
740
+ action: 'Delete a notification',
741
+ },
742
+ {
743
+ name: 'Export',
744
+ value: 'export',
745
+ description: 'Export notifications to CSV',
746
+ action: 'Export notifications',
471
747
  },
472
748
  {
473
749
  name: 'Get',
@@ -476,10 +752,10 @@ class Dragos {
476
752
  action: 'Get a notification',
477
753
  },
478
754
  {
479
- name: 'Update',
480
- value: 'update',
481
- description: 'Update notifications',
482
- action: 'Update notifications',
755
+ name: 'Get Many',
756
+ value: 'getMany',
757
+ description: 'Get many notifications',
758
+ action: 'Get many notifications',
483
759
  },
484
760
  {
485
761
  name: 'Get Stats',
@@ -487,6 +763,18 @@ class Dragos {
487
763
  description: 'Get notification statistics',
488
764
  action: 'Get notification statistics',
489
765
  },
766
+ {
767
+ name: 'Review',
768
+ value: 'review',
769
+ description: 'Mark notifications as reviewed',
770
+ action: 'Review notifications',
771
+ },
772
+ {
773
+ name: 'Update',
774
+ value: 'update',
775
+ description: 'Update notifications',
776
+ action: 'Update notifications',
777
+ },
490
778
  ],
491
779
  default: 'getMany',
492
780
  },
@@ -580,46 +868,208 @@ class Dragos {
580
868
  },
581
869
  },
582
870
  options: [
583
- {
584
- name: 'Get Many',
585
- value: 'getMany',
586
- description: 'Get many data import jobs',
587
- action: 'Get many data import jobs',
588
- },
589
- {
590
- name: 'Get',
591
- value: 'get',
592
- description: 'Get a data import job by ID',
593
- action: 'Get a data import job',
594
- },
871
+ {
872
+ name: 'Get Many',
873
+ value: 'getMany',
874
+ description: 'Get many data import jobs',
875
+ action: 'Get many data import jobs',
876
+ },
877
+ {
878
+ name: 'Get',
879
+ value: 'get',
880
+ description: 'Get a data import job by ID',
881
+ action: 'Get a data import job',
882
+ },
883
+ {
884
+ name: 'Create',
885
+ value: 'create',
886
+ description: 'Create a new data import job',
887
+ action: 'Create a data import job',
888
+ },
889
+ {
890
+ name: 'Continue',
891
+ value: 'continue',
892
+ description: 'Continue a data import job',
893
+ action: 'Continue a data import job',
894
+ },
895
+ {
896
+ name: 'Stop',
897
+ value: 'stop',
898
+ description: 'Stop a running data import job',
899
+ action: 'Stop a data import job',
900
+ },
901
+ {
902
+ name: 'Delete',
903
+ value: 'delete',
904
+ description: 'Delete a data import job',
905
+ action: 'Delete a data import job',
906
+ },
907
+ ],
908
+ default: 'getMany',
909
+ },
910
+ // Zone Operations
911
+ {
912
+ displayName: 'Operation',
913
+ name: 'operation',
914
+ type: 'options',
915
+ noDataExpression: true,
916
+ displayOptions: {
917
+ show: {
918
+ resource: ['zone'],
919
+ },
920
+ },
921
+ options: [
922
+ {
923
+ name: 'Get Many',
924
+ value: 'getMany',
925
+ description: 'Get many zones',
926
+ action: 'Get many zones',
927
+ },
928
+ {
929
+ name: 'Get',
930
+ value: 'get',
931
+ description: 'Get a zone by ID',
932
+ action: 'Get a zone',
933
+ },
934
+ {
935
+ name: 'Create',
936
+ value: 'create',
937
+ description: 'Create a new zone',
938
+ action: 'Create a zone',
939
+ },
940
+ {
941
+ name: 'Update',
942
+ value: 'update',
943
+ description: 'Update a zone',
944
+ action: 'Update a zone',
945
+ },
946
+ {
947
+ name: 'Delete',
948
+ value: 'delete',
949
+ description: 'Delete a zone',
950
+ action: 'Delete a zone',
951
+ },
952
+ ],
953
+ default: 'getMany',
954
+ },
955
+ // Parser Operations
956
+ {
957
+ displayName: 'Operation',
958
+ name: 'operation',
959
+ type: 'options',
960
+ noDataExpression: true,
961
+ displayOptions: {
962
+ show: {
963
+ resource: ['parser'],
964
+ },
965
+ },
966
+ options: [
967
+ {
968
+ name: 'Get Many',
969
+ value: 'getMany',
970
+ description: 'Get many parsers',
971
+ action: 'Get many parsers',
972
+ },
973
+ {
974
+ name: 'Get',
975
+ value: 'get',
976
+ description: 'Download a parser by ID',
977
+ action: 'Get a parser',
978
+ },
979
+ {
980
+ name: 'Delete',
981
+ value: 'delete',
982
+ description: 'Delete a parser',
983
+ action: 'Delete a parser',
984
+ },
985
+ ],
986
+ default: 'getMany',
987
+ },
988
+ // Job Config Operations
989
+ {
990
+ displayName: 'Operation',
991
+ name: 'operation',
992
+ type: 'options',
993
+ noDataExpression: true,
994
+ displayOptions: {
995
+ show: {
996
+ resource: ['jobConfig'],
997
+ },
998
+ },
999
+ options: [
1000
+ {
1001
+ name: 'Create',
1002
+ value: 'create',
1003
+ description: 'Create a new job config',
1004
+ action: 'Create a job config',
1005
+ },
1006
+ {
1007
+ name: 'Delete',
1008
+ value: 'delete',
1009
+ description: 'Delete a job config',
1010
+ action: 'Delete a job config',
1011
+ },
1012
+ {
1013
+ name: 'Get',
1014
+ value: 'get',
1015
+ description: 'Get a job config by ID',
1016
+ action: 'Get a job config',
1017
+ },
1018
+ {
1019
+ name: 'Get Many',
1020
+ value: 'getMany',
1021
+ description: 'Get many job configs',
1022
+ action: 'Get many job configs',
1023
+ },
1024
+ {
1025
+ name: 'Update',
1026
+ value: 'update',
1027
+ description: 'Update a job config',
1028
+ action: 'Update a job config',
1029
+ },
1030
+ ],
1031
+ default: 'getMany',
1032
+ },
1033
+ // Vulnerability Detection Rule Operations
1034
+ {
1035
+ displayName: 'Operation',
1036
+ name: 'operation',
1037
+ type: 'options',
1038
+ noDataExpression: true,
1039
+ displayOptions: {
1040
+ show: {
1041
+ resource: ['vulnerabilityDetectionRule'],
1042
+ },
1043
+ },
1044
+ options: [
595
1045
  {
596
1046
  name: 'Create',
597
1047
  value: 'create',
598
- description: 'Create a new data import job',
599
- action: 'Create a data import job',
1048
+ description: 'Create a new detection rule',
1049
+ action: 'Create a detection rule',
600
1050
  },
601
1051
  {
602
- name: 'Continue',
603
- value: 'continue',
604
- description: 'Continue a data import job',
605
- action: 'Continue a data import job',
1052
+ name: 'Delete',
1053
+ value: 'delete',
1054
+ description: 'Delete a detection rule',
1055
+ action: 'Delete a detection rule',
606
1056
  },
607
1057
  {
608
- name: 'Stop',
609
- value: 'stop',
610
- description: 'Stop a running data import job',
611
- action: 'Stop a data import job',
1058
+ name: 'Get Many',
1059
+ value: 'getMany',
1060
+ description: 'Get many detection rules',
1061
+ action: 'Get many detection rules',
612
1062
  },
613
1063
  {
614
- name: 'Delete',
615
- value: 'delete',
616
- description: 'Delete a data import job',
617
- action: 'Delete a data import job',
1064
+ name: 'Update',
1065
+ value: 'update',
1066
+ description: 'Update a detection rule',
1067
+ action: 'Update a detection rule',
618
1068
  },
619
1069
  ],
620
1070
  default: 'getMany',
621
1071
  },
622
- // Zone Operations
1072
+ // Vulnerability Audit Log Operations
623
1073
  {
624
1074
  displayName: 'Operation',
625
1075
  name: 'operation',
@@ -627,39 +1077,21 @@ class Dragos {
627
1077
  noDataExpression: true,
628
1078
  displayOptions: {
629
1079
  show: {
630
- resource: ['zone'],
1080
+ resource: ['vulnerabilityAuditLog'],
631
1081
  },
632
1082
  },
633
1083
  options: [
634
1084
  {
635
1085
  name: 'Get Many',
636
1086
  value: 'getMany',
637
- description: 'Get many zones',
638
- action: 'Get many zones',
639
- },
640
- {
641
- name: 'Get',
642
- value: 'get',
643
- description: 'Get a zone by ID',
644
- action: 'Get a zone',
645
- },
646
- {
647
- name: 'Create',
648
- value: 'create',
649
- description: 'Create a new zone',
650
- action: 'Create a zone',
1087
+ description: 'Get many audit logs',
1088
+ action: 'Get many audit logs',
651
1089
  },
652
1090
  {
653
- name: 'Update',
654
- value: 'update',
655
- description: 'Update a zone',
656
- action: 'Update a zone',
657
- },
658
- {
659
- name: 'Delete',
660
- value: 'delete',
661
- description: 'Delete a zone',
662
- action: 'Delete a zone',
1091
+ name: 'Get Stats',
1092
+ value: 'getStats',
1093
+ description: 'Get audit log statistics',
1094
+ action: 'Get audit log statistics',
663
1095
  },
664
1096
  ],
665
1097
  default: 'getMany',
@@ -1278,6 +1710,294 @@ class Dragos {
1278
1710
  },
1279
1711
  ],
1280
1712
  },
1713
+ // ========== New Asset Parameters ==========
1714
+ {
1715
+ displayName: 'Asset IDs',
1716
+ name: 'assetIds',
1717
+ type: 'string',
1718
+ displayOptions: {
1719
+ show: {
1720
+ resource: ['asset'],
1721
+ operation: ['delete'],
1722
+ },
1723
+ },
1724
+ default: '',
1725
+ required: true,
1726
+ description: 'Comma-separated list of asset IDs to delete',
1727
+ },
1728
+ {
1729
+ displayName: 'Asset Fields',
1730
+ name: 'assetFields',
1731
+ type: 'json',
1732
+ displayOptions: {
1733
+ show: {
1734
+ resource: ['asset'],
1735
+ operation: ['create'],
1736
+ },
1737
+ },
1738
+ default: '{}',
1739
+ description: 'JSON object with asset fields',
1740
+ },
1741
+ {
1742
+ displayName: 'Software ID',
1743
+ name: 'softwareId',
1744
+ type: 'number',
1745
+ displayOptions: {
1746
+ show: {
1747
+ resource: ['asset'],
1748
+ operation: ['deleteSoftwarePackage'],
1749
+ },
1750
+ },
1751
+ default: 0,
1752
+ required: true,
1753
+ description: 'The ID of the software package to remove',
1754
+ },
1755
+ // ========== New Notification Parameters ==========
1756
+ {
1757
+ displayName: 'Notification Fields',
1758
+ name: 'notificationFields',
1759
+ type: 'collection',
1760
+ placeholder: 'Add Field',
1761
+ displayOptions: {
1762
+ show: {
1763
+ resource: ['notification'],
1764
+ operation: ['create'],
1765
+ },
1766
+ },
1767
+ default: {},
1768
+ options: [
1769
+ {
1770
+ displayName: 'Source',
1771
+ name: 'source',
1772
+ type: 'string',
1773
+ default: '',
1774
+ description: 'Source of the notification',
1775
+ },
1776
+ {
1777
+ displayName: 'Type',
1778
+ name: 'type',
1779
+ type: 'string',
1780
+ default: '',
1781
+ description: 'Type of the notification',
1782
+ },
1783
+ {
1784
+ displayName: 'Summary',
1785
+ name: 'summary',
1786
+ type: 'string',
1787
+ default: '',
1788
+ description: 'Summary of the notification',
1789
+ },
1790
+ {
1791
+ displayName: 'Severity',
1792
+ name: 'severity',
1793
+ type: 'number',
1794
+ default: 1,
1795
+ description: 'Severity level (1-5)',
1796
+ },
1797
+ {
1798
+ displayName: 'Message',
1799
+ name: 'message',
1800
+ type: 'string',
1801
+ default: '',
1802
+ description: 'Notification message',
1803
+ },
1804
+ ],
1805
+ },
1806
+ {
1807
+ displayName: 'Export Format',
1808
+ name: 'exportFormat',
1809
+ type: 'options',
1810
+ displayOptions: {
1811
+ show: {
1812
+ resource: ['notification'],
1813
+ operation: ['export'],
1814
+ },
1815
+ },
1816
+ options: [
1817
+ { name: 'CSV', value: 'csv' },
1818
+ { name: 'JSON', value: 'json' },
1819
+ ],
1820
+ default: 'csv',
1821
+ description: 'Format for export',
1822
+ },
1823
+ // ========== Parser Parameters ==========
1824
+ {
1825
+ displayName: 'Parser ID',
1826
+ name: 'parserId',
1827
+ type: 'string',
1828
+ displayOptions: {
1829
+ show: {
1830
+ resource: ['parser'],
1831
+ operation: ['get', 'delete'],
1832
+ },
1833
+ },
1834
+ default: '',
1835
+ required: true,
1836
+ description: 'The UUID of the parser',
1837
+ },
1838
+ // ========== Job Config Parameters ==========
1839
+ {
1840
+ displayName: 'Config ID',
1841
+ name: 'configId',
1842
+ type: 'string',
1843
+ displayOptions: {
1844
+ show: {
1845
+ resource: ['jobConfig'],
1846
+ operation: ['get', 'update', 'delete'],
1847
+ },
1848
+ },
1849
+ default: '',
1850
+ required: true,
1851
+ description: 'The UUID of the job config',
1852
+ },
1853
+ {
1854
+ displayName: 'Job Config Fields',
1855
+ name: 'jobConfigFields',
1856
+ type: 'collection',
1857
+ placeholder: 'Add Field',
1858
+ displayOptions: {
1859
+ show: {
1860
+ resource: ['jobConfig'],
1861
+ operation: ['create', 'update'],
1862
+ },
1863
+ },
1864
+ default: {},
1865
+ options: [
1866
+ {
1867
+ displayName: 'Name',
1868
+ name: 'name',
1869
+ type: 'string',
1870
+ default: '',
1871
+ description: 'Name of the job config',
1872
+ },
1873
+ {
1874
+ displayName: 'Description',
1875
+ name: 'description',
1876
+ type: 'string',
1877
+ default: '',
1878
+ description: 'Description of the job config',
1879
+ },
1880
+ {
1881
+ displayName: 'Job Type',
1882
+ name: 'job_type',
1883
+ type: 'options',
1884
+ options: [
1885
+ { name: 'Asset', value: 'ASSET' },
1886
+ { name: 'SBOM', value: 'SBOM' },
1887
+ { name: 'Unstructured', value: 'UNSTRUCTURED' },
1888
+ ],
1889
+ default: 'ASSET',
1890
+ description: 'The type of import job',
1891
+ },
1892
+ {
1893
+ displayName: 'Parser ID',
1894
+ name: 'parser_id',
1895
+ type: 'string',
1896
+ default: '',
1897
+ description: 'The UUID of the parser to use',
1898
+ },
1899
+ {
1900
+ displayName: 'Network ID',
1901
+ name: 'network_id',
1902
+ type: 'string',
1903
+ default: '',
1904
+ description: 'The ID of the network',
1905
+ },
1906
+ {
1907
+ displayName: 'Confidence',
1908
+ name: 'confidence',
1909
+ type: 'number',
1910
+ default: 60,
1911
+ description: 'Confidence setting (1-255)',
1912
+ },
1913
+ {
1914
+ displayName: 'Retention (Hours)',
1915
+ name: 'retention',
1916
+ type: 'number',
1917
+ default: 48,
1918
+ description: 'Hours to keep job files',
1919
+ },
1920
+ {
1921
+ displayName: 'Preview',
1922
+ name: 'preview',
1923
+ type: 'boolean',
1924
+ default: false,
1925
+ description: 'Whether to stop for preview after enrichment',
1926
+ },
1927
+ {
1928
+ displayName: 'Create New Assets',
1929
+ name: 'create_new_assets',
1930
+ type: 'boolean',
1931
+ default: false,
1932
+ description: 'Whether to create new assets when no match found',
1933
+ },
1934
+ ],
1935
+ },
1936
+ // ========== Vulnerability Detection Rule Parameters ==========
1937
+ {
1938
+ displayName: 'Rule UUID',
1939
+ name: 'ruleUuid',
1940
+ type: 'string',
1941
+ displayOptions: {
1942
+ show: {
1943
+ resource: ['vulnerabilityDetectionRule'],
1944
+ operation: ['update', 'delete'],
1945
+ },
1946
+ },
1947
+ default: '',
1948
+ required: true,
1949
+ description: 'The UUID of the detection rule',
1950
+ },
1951
+ {
1952
+ displayName: 'Rule Fields',
1953
+ name: 'ruleFields',
1954
+ type: 'collection',
1955
+ placeholder: 'Add Field',
1956
+ displayOptions: {
1957
+ show: {
1958
+ resource: ['vulnerabilityDetectionRule'],
1959
+ operation: ['create', 'update'],
1960
+ },
1961
+ },
1962
+ default: {},
1963
+ options: [
1964
+ {
1965
+ displayName: 'Name',
1966
+ name: 'name',
1967
+ type: 'string',
1968
+ default: '',
1969
+ description: 'Name of the rule',
1970
+ },
1971
+ {
1972
+ displayName: 'Description',
1973
+ name: 'description',
1974
+ type: 'string',
1975
+ default: '',
1976
+ description: 'Description of the rule',
1977
+ },
1978
+ {
1979
+ displayName: 'Selector (JSON)',
1980
+ name: 'selector',
1981
+ type: 'json',
1982
+ default: '{}',
1983
+ description: 'JSON selector for matching vulnerabilities',
1984
+ },
1985
+ {
1986
+ displayName: 'Category',
1987
+ name: 'category',
1988
+ type: 'string',
1989
+ default: '',
1990
+ description: 'Category of the rule',
1991
+ },
1992
+ {
1993
+ displayName: 'Expiration',
1994
+ name: 'expiration',
1995
+ type: 'dateTime',
1996
+ default: '',
1997
+ description: 'Expiration date of the rule',
1998
+ },
1999
+ ],
2000
+ },
1281
2001
  // ========== Additional Options ==========
1282
2002
  {
1283
2003
  displayName: 'Options',
@@ -1327,9 +2047,21 @@ class Dragos {
1327
2047
  else if (resource === 'vulnerabilityDetection') {
1328
2048
  responseData = await executeVulnerabilityDetectionOperation(this, i, operation, baseUrl);
1329
2049
  }
2050
+ else if (resource === 'vulnerabilityDetectionRule') {
2051
+ responseData = await executeVulnerabilityDetectionRuleOperation(this, i, operation, baseUrl);
2052
+ }
2053
+ else if (resource === 'vulnerabilityAuditLog') {
2054
+ responseData = await executeVulnerabilityAuditLogOperation(this, i, operation, baseUrl);
2055
+ }
1330
2056
  else if (resource === 'job') {
1331
2057
  responseData = await executeJobOperation(this, i, operation, baseUrl);
1332
2058
  }
2059
+ else if (resource === 'jobConfig') {
2060
+ responseData = await executeJobConfigOperation(this, i, operation, baseUrl);
2061
+ }
2062
+ else if (resource === 'parser') {
2063
+ responseData = await executeParserOperation(this, i, operation, baseUrl);
2064
+ }
1333
2065
  else if (resource === 'zone') {
1334
2066
  responseData = await executeZoneOperation(this, i, operation, baseUrl);
1335
2067
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n8n-nodes-dragosplatform",
3
- "version": "0.2.2",
3
+ "version": "0.3.0",
4
4
  "description": "n8n nodes for the Dragos OT/ICS cybersecurity platform",
5
5
  "keywords": [
6
6
  "n8n-community-node-package",