TheHive: Add Mark as Read operation to alerts (#1541)

*  Add Mark as Read operation to TheHive 4 Alerts

* Remove version check from Mark as Read operation

* Add Mark as Unread operation

* Show Alert ID for markAsUnread operation

*  Add Ignore SSL Issues parameter to credentials

*  Add TheHive and Cortex SVG logos

Co-authored-by: Mika Luhta <12100880+mluhta@users.noreply.github.com>
This commit is contained in:
Ricardo Espinoza
2021-03-18 08:06:51 -04:00
committed by GitHub
parent c39504719a
commit d56c3da3dd
10 changed files with 36 additions and 3 deletions

View File

@@ -67,7 +67,7 @@ export class TheHive implements INodeType {
description: INodeTypeDescription = {
displayName: 'TheHive',
name: 'theHive',
icon: 'file:thehive.png',
icon: 'file:thehive.svg',
group: ['transform'],
subtitle: '={{$parameter["operation"]}} : {{$parameter["resource"]}}',
version: 1,
@@ -216,6 +216,8 @@ export class TheHive implements INodeType {
{ name: 'Execute Responder', value: 'executeResponder', description: 'Execute a responder on the specified alert' },
{ name: 'Get', value: 'get', description: 'Get an alert' },
{ name: 'Get All', value: 'getAll', description: 'Get all alerts' },
{ name: 'Mark as Read', value: 'markAsRead', description: 'Mark the alert as read' },
{ name: 'Mark as Unread', value: 'markAsUnread', description: 'Mark the alert as unread' },
{ name: 'Merge', value: 'merge', description: 'Merge alert into an existing case' },
{ name: 'Promote', value: 'promote', description: 'Promote an alert into a case' },
{ name: 'Update', value: 'update', description: 'Update alert' },
@@ -535,6 +537,26 @@ export class TheHive implements INodeType {
);
}
if (operation === 'markAsRead') {
const alertId = this.getNodeParameter('id', i) as string;
responseData = await theHiveApiRequest.call(
this,
'POST',
`/alert/${alertId}/markAsRead`,
);
}
if (operation === 'markAsUnread') {
const alertId = this.getNodeParameter('id', i) as string;
responseData = await theHiveApiRequest.call(
this,
'POST',
`/alert/${alertId}/markAsUnread`,
);
}
if (operation === 'merge') {
const alertId = this.getNodeParameter('id', i) as string;