feat(MISP Node): Rest search operations (#9196)

This commit is contained in:
Michael Kret
2024-04-26 11:12:22 +03:00
committed by GitHub
parent 9b3ac1648f
commit b694e7743e
7 changed files with 270 additions and 1 deletions

View File

@@ -10,6 +10,7 @@ import type {
import {
mispApiRequest,
mispApiRequestAllItems,
mispApiRestSearch,
throwOnEmptyUpdate,
throwOnInvalidUrl,
throwOnMissingSharingGroup,
@@ -28,6 +29,8 @@ import {
galaxyOperations,
noticelistFields,
noticelistOperations,
objectOperations,
objectFields,
organisationFields,
organisationOperations,
tagFields,
@@ -91,6 +94,10 @@ export class Misp implements INodeType {
name: 'Noticelist',
value: 'noticelist',
},
{
name: 'Object',
value: 'object',
},
{
name: 'Organisation',
value: 'organisation',
@@ -122,6 +129,8 @@ export class Misp implements INodeType {
...galaxyFields,
...noticelistOperations,
...noticelistFields,
...objectOperations,
...objectFields,
...organisationOperations,
...organisationFields,
...tagOperations,
@@ -233,6 +242,12 @@ export class Misp implements INodeType {
// ----------------------------------------
responseData = await mispApiRequestAllItems.call(this, '/attributes');
} else if (operation === 'search') {
// ----------------------------------------
// attribute: search
// ----------------------------------------
responseData = await mispApiRestSearch.call(this, 'attributes', i);
} else if (operation === 'update') {
// ----------------------------------------
// attribute: update
@@ -300,6 +315,12 @@ export class Misp implements INodeType {
// ----------------------------------------
responseData = await mispApiRequestAllItems.call(this, '/events');
} else if (operation === 'search') {
// ----------------------------------------
// event: search
// ----------------------------------------
responseData = await mispApiRestSearch.call(this, 'events', i);
} else if (operation === 'publish') {
// ----------------------------------------
// event: publish
@@ -500,6 +521,17 @@ export class Misp implements INodeType {
}>;
responseData = responseData.map((entry) => entry.Noticelist);
}
} else if (resource === 'object') {
// **********************************************************************
// object
// **********************************************************************
if (operation === 'search') {
// ----------------------------------------
// attribute: search
// ----------------------------------------
responseData = await mispApiRestSearch.call(this, 'objects', i);
}
} else if (resource === 'organisation') {
// **********************************************************************
// organisation