2023-01-27 03:22:44 -08:00
|
|
|
import type { INodeProperties } from 'n8n-workflow';
|
2020-12-02 02:24:25 -08:00
|
|
|
|
2022-08-17 08:50:24 -07:00
|
|
|
import { TLP } from '../interfaces/AlertInterface';
|
2020-12-02 02:24:25 -08:00
|
|
|
|
2021-12-03 00:44:16 -08:00
|
|
|
export const alertOperations: INodeProperties[] = [
|
2020-12-02 02:24:25 -08:00
|
|
|
{
|
2022-06-03 10:23:49 -07:00
|
|
|
displayName: 'Operation Name or ID',
|
2020-12-02 02:24:25 -08:00
|
|
|
name: 'operation',
|
|
|
|
type: 'options',
|
2022-08-17 08:50:24 -07:00
|
|
|
description:
|
2024-09-12 07:53:36 -07:00
|
|
|
'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>',
|
2022-05-20 14:47:24 -07:00
|
|
|
noDataExpression: true,
|
2020-12-02 02:24:25 -08:00
|
|
|
required: true,
|
|
|
|
typeOptions: {
|
|
|
|
loadOptionsMethod: 'loadAlertOptions',
|
|
|
|
},
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['alert'],
|
2020-12-02 02:24:25 -08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
default: 'create',
|
|
|
|
},
|
2021-12-03 00:44:16 -08:00
|
|
|
];
|
2020-12-02 02:24:25 -08:00
|
|
|
|
2021-12-03 00:44:16 -08:00
|
|
|
export const alertFields: INodeProperties[] = [
|
2020-12-02 02:24:25 -08:00
|
|
|
{
|
|
|
|
displayName: 'Return All',
|
|
|
|
name: 'returnAll',
|
|
|
|
type: 'boolean',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
operation: ['getAll'],
|
|
|
|
resource: ['alert'],
|
2020-12-02 02:24:25 -08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
default: false,
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'Whether to return all results or only up to a given limit',
|
2020-12-02 02:24:25 -08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Limit',
|
|
|
|
name: 'limit',
|
|
|
|
type: 'number',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
operation: ['getAll'],
|
|
|
|
resource: ['alert'],
|
|
|
|
returnAll: [false],
|
2020-12-02 02:24:25 -08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
typeOptions: {
|
|
|
|
minValue: 1,
|
|
|
|
maxValue: 500,
|
|
|
|
},
|
|
|
|
default: 100,
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'Max number of results to return',
|
2020-12-02 02:24:25 -08:00
|
|
|
},
|
|
|
|
// required attributs
|
|
|
|
{
|
|
|
|
displayName: 'Alert ID',
|
|
|
|
name: 'id',
|
|
|
|
type: 'string',
|
|
|
|
required: true,
|
|
|
|
default: '',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['alert'],
|
2020-12-02 02:24:25 -08:00
|
|
|
operation: [
|
|
|
|
'promote',
|
2021-03-18 05:06:51 -07:00
|
|
|
'markAsRead',
|
|
|
|
'markAsUnread',
|
2020-12-02 02:24:25 -08:00
|
|
|
'merge',
|
|
|
|
'update',
|
|
|
|
'executeResponder',
|
|
|
|
'get',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
2020-12-02 02:54:10 -08:00
|
|
|
description: 'Title of the alert',
|
2020-12-02 02:24:25 -08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Case ID',
|
|
|
|
name: 'caseId',
|
|
|
|
type: 'string',
|
|
|
|
required: true,
|
|
|
|
default: '',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['alert'],
|
|
|
|
operation: ['merge'],
|
2020-12-02 02:24:25 -08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Title',
|
|
|
|
name: 'title',
|
|
|
|
type: 'string',
|
|
|
|
required: true,
|
|
|
|
default: '',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['alert'],
|
|
|
|
operation: ['create'],
|
2020-12-02 02:24:25 -08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
description: 'Title of the alert',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Description',
|
|
|
|
name: 'description',
|
|
|
|
type: 'string',
|
|
|
|
required: true,
|
|
|
|
default: '',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['alert'],
|
|
|
|
operation: ['create'],
|
2020-12-02 02:24:25 -08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
description: 'Description of the alert',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Severity',
|
|
|
|
name: 'severity',
|
|
|
|
type: 'options',
|
2020-12-02 02:54:10 -08:00
|
|
|
options: [
|
2020-12-02 02:24:25 -08:00
|
|
|
{
|
|
|
|
name: 'Low',
|
2020-12-02 02:54:10 -08:00
|
|
|
value: 1,
|
2020-12-02 02:24:25 -08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Medium',
|
2020-12-02 02:54:10 -08:00
|
|
|
value: 2,
|
2020-12-02 02:24:25 -08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'High',
|
|
|
|
value: 3,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
required: true,
|
|
|
|
default: 2,
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['alert'],
|
|
|
|
operation: ['create'],
|
2020-12-02 02:24:25 -08:00
|
|
|
},
|
|
|
|
},
|
2022-04-22 09:29:51 -07:00
|
|
|
description: 'Severity of the alert. Default=Medium.',
|
2020-12-02 02:24:25 -08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Date',
|
|
|
|
name: 'date',
|
|
|
|
type: 'dateTime',
|
|
|
|
required: true,
|
|
|
|
default: '',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['alert'],
|
|
|
|
operation: ['create'],
|
2020-12-02 02:24:25 -08:00
|
|
|
},
|
|
|
|
},
|
2020-12-02 02:54:10 -08:00
|
|
|
description: 'Date and time when the alert was raised default=now',
|
2020-12-02 02:24:25 -08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Tags',
|
|
|
|
name: 'tags',
|
|
|
|
type: 'string',
|
|
|
|
required: true,
|
|
|
|
default: '',
|
2020-12-02 02:54:10 -08:00
|
|
|
placeholder: 'tag,tag2,tag3...',
|
2020-12-02 02:24:25 -08:00
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['alert'],
|
|
|
|
operation: ['create'],
|
2020-12-02 02:24:25 -08:00
|
|
|
},
|
|
|
|
},
|
2020-12-02 02:54:10 -08:00
|
|
|
description: 'Case Tags',
|
2020-12-02 02:24:25 -08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'TLP',
|
|
|
|
name: 'tlp',
|
|
|
|
type: 'options',
|
|
|
|
required: true,
|
|
|
|
default: 2,
|
|
|
|
options: [
|
|
|
|
{
|
2020-12-02 02:54:10 -08:00
|
|
|
name: 'White',
|
|
|
|
value: TLP.white,
|
2020-12-02 02:24:25 -08:00
|
|
|
},
|
|
|
|
{
|
2020-12-02 02:54:10 -08:00
|
|
|
name: 'Green',
|
|
|
|
value: TLP.green,
|
2020-12-02 02:24:25 -08:00
|
|
|
},
|
|
|
|
{
|
2020-12-02 02:54:10 -08:00
|
|
|
name: 'Amber',
|
|
|
|
value: TLP.amber,
|
2022-08-17 08:50:24 -07:00
|
|
|
},
|
|
|
|
{
|
2020-12-02 02:54:10 -08:00
|
|
|
name: 'Red',
|
|
|
|
value: TLP.red,
|
|
|
|
},
|
2020-12-02 02:24:25 -08:00
|
|
|
],
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['alert'],
|
|
|
|
operation: ['create'],
|
2020-12-02 02:24:25 -08:00
|
|
|
},
|
|
|
|
},
|
2022-04-22 09:29:51 -07:00
|
|
|
description: 'Traffict Light Protocol (TLP). Default=Amber.',
|
2020-12-02 02:24:25 -08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Status',
|
|
|
|
name: 'status',
|
|
|
|
type: 'options',
|
|
|
|
required: true,
|
2020-12-02 02:54:10 -08:00
|
|
|
options: [
|
2020-12-02 02:24:25 -08:00
|
|
|
{
|
|
|
|
name: 'New',
|
|
|
|
value: 'New',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Updated',
|
|
|
|
value: 'Updated',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Ignored',
|
2020-12-02 02:54:10 -08:00
|
|
|
value: 'Ignored',
|
2020-12-02 02:24:25 -08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Imported',
|
|
|
|
value: 'Imported',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
default: 'New',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['alert'],
|
|
|
|
operation: ['create'],
|
2020-12-02 02:24:25 -08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
description: 'Status of the alert',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Type',
|
|
|
|
name: 'type',
|
|
|
|
type: 'string',
|
|
|
|
required: true,
|
|
|
|
default: '',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['alert'],
|
|
|
|
operation: ['create'],
|
2020-12-02 02:24:25 -08:00
|
|
|
},
|
|
|
|
},
|
2020-12-02 02:54:10 -08:00
|
|
|
description: 'Type of the alert',
|
2020-12-02 02:24:25 -08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Source',
|
|
|
|
name: 'source',
|
|
|
|
type: 'string',
|
|
|
|
required: true,
|
|
|
|
default: '',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['alert'],
|
|
|
|
operation: ['create'],
|
2020-12-02 02:24:25 -08:00
|
|
|
},
|
|
|
|
},
|
2020-12-02 02:54:10 -08:00
|
|
|
description: 'Source of the alert',
|
2020-12-02 02:24:25 -08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'SourceRef',
|
|
|
|
name: 'sourceRef',
|
|
|
|
type: 'string',
|
|
|
|
required: true,
|
|
|
|
default: '',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['alert'],
|
|
|
|
operation: ['create'],
|
2020-12-02 02:24:25 -08:00
|
|
|
},
|
|
|
|
},
|
2020-12-02 02:54:10 -08:00
|
|
|
description: 'Source reference of the alert',
|
2020-12-02 02:24:25 -08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Follow',
|
|
|
|
name: 'follow',
|
|
|
|
type: 'boolean',
|
|
|
|
required: true,
|
|
|
|
default: true,
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['alert'],
|
|
|
|
operation: ['create'],
|
2020-12-02 02:24:25 -08:00
|
|
|
},
|
|
|
|
},
|
2022-06-20 07:54:01 -07:00
|
|
|
description: 'Whether the alert becomes active when updated default=true',
|
2020-12-02 02:24:25 -08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Artifacts',
|
|
|
|
name: 'artifactUi',
|
|
|
|
type: 'fixedCollection',
|
|
|
|
placeholder: 'Add Artifact',
|
2022-04-22 09:29:51 -07:00
|
|
|
default: {},
|
2020-12-02 02:24:25 -08:00
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['alert'],
|
|
|
|
operation: ['create'],
|
2020-12-02 02:24:25 -08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
typeOptions: {
|
|
|
|
multipleValues: true,
|
|
|
|
},
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
displayName: 'Artifact',
|
|
|
|
name: 'artifactValues',
|
|
|
|
values: [
|
|
|
|
{
|
2022-06-03 10:23:49 -07:00
|
|
|
displayName: 'Data Type Name or ID',
|
2020-12-02 02:24:25 -08:00
|
|
|
name: 'dataType',
|
|
|
|
type: 'options',
|
|
|
|
default: '',
|
2021-04-05 01:52:56 -07:00
|
|
|
typeOptions: {
|
|
|
|
loadOptionsMethod: 'loadObservableTypes',
|
|
|
|
},
|
2022-08-17 08:50:24 -07:00
|
|
|
description:
|
2024-09-12 07:53:36 -07:00
|
|
|
'Type of the observable. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
|
2020-12-02 02:24:25 -08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Data',
|
|
|
|
name: 'data',
|
|
|
|
type: 'string',
|
|
|
|
displayOptions: {
|
|
|
|
hide: {
|
2022-08-17 08:50:24 -07:00
|
|
|
dataType: ['file'],
|
2020-12-02 02:24:25 -08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
{
|
2024-01-03 03:08:16 -08:00
|
|
|
displayName: 'Input Binary Field',
|
2020-12-02 02:24:25 -08:00
|
|
|
name: 'binaryProperty',
|
|
|
|
type: 'string',
|
2024-01-03 03:08:16 -08:00
|
|
|
hint: 'The name of the input binary field containing the file to be written',
|
2020-12-02 02:24:25 -08:00
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
dataType: ['file'],
|
2020-12-02 02:24:25 -08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
default: 'data',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Message',
|
|
|
|
name: 'message',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Case Tags',
|
|
|
|
name: 'tags',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
],
|
2020-12-02 02:54:10 -08:00
|
|
|
description: 'Artifact attributes',
|
2020-12-02 02:24:25 -08:00
|
|
|
},
|
|
|
|
// required for responder execution
|
|
|
|
{
|
2022-06-03 10:23:49 -07:00
|
|
|
displayName: 'Responder Name or ID',
|
2020-12-02 02:24:25 -08:00
|
|
|
name: 'responder',
|
|
|
|
type: 'options',
|
2022-08-17 08:50:24 -07:00
|
|
|
description:
|
2024-09-12 07:53:36 -07:00
|
|
|
'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>',
|
2020-12-02 02:24:25 -08:00
|
|
|
required: true,
|
|
|
|
default: '',
|
|
|
|
typeOptions: {
|
2022-08-17 08:50:24 -07:00
|
|
|
loadOptionsDependsOn: ['id'],
|
2020-12-02 02:24:25 -08:00
|
|
|
loadOptionsMethod: 'loadResponders',
|
|
|
|
},
|
2020-12-02 02:54:10 -08:00
|
|
|
displayOptions: {
|
2020-12-02 02:24:25 -08:00
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['alert'],
|
|
|
|
operation: ['executeResponder'],
|
2020-12-02 02:24:25 -08:00
|
|
|
},
|
|
|
|
hide: {
|
2022-08-17 08:50:24 -07:00
|
|
|
id: [''],
|
2020-12-02 02:24:25 -08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
2021-07-14 10:18:46 -07:00
|
|
|
{
|
|
|
|
displayName: 'JSON Parameters',
|
|
|
|
name: 'jsonParameters',
|
|
|
|
type: 'boolean',
|
|
|
|
default: true,
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['alert'],
|
|
|
|
operation: ['create', 'update'],
|
2021-07-14 10:18:46 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
2020-12-02 02:24:25 -08:00
|
|
|
// optional attributs (Create, Promote operations)
|
|
|
|
{
|
|
|
|
displayName: 'Additional Fields',
|
|
|
|
name: 'additionalFields',
|
|
|
|
placeholder: 'Add Field',
|
|
|
|
type: 'collection',
|
2022-04-22 09:29:51 -07:00
|
|
|
default: {},
|
2020-12-02 02:24:25 -08:00
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['alert'],
|
|
|
|
operation: ['create'],
|
2021-07-14 10:18:46 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
displayName: 'Case Template',
|
|
|
|
name: 'caseTemplate',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'Case template to use when a case is created from this alert',
|
2021-07-14 10:18:46 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Custom Fields',
|
|
|
|
name: 'customFieldsUi',
|
|
|
|
type: 'fixedCollection',
|
|
|
|
default: {},
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
'/jsonParameters': [false],
|
2021-07-14 10:18:46 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
typeOptions: {
|
|
|
|
multipleValues: true,
|
|
|
|
},
|
|
|
|
placeholder: 'Add Custom Field',
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
name: 'customFields',
|
|
|
|
displayName: 'Custom Field',
|
|
|
|
values: [
|
|
|
|
{
|
2022-06-03 10:23:49 -07:00
|
|
|
displayName: 'Field Name or ID',
|
2021-07-14 10:18:46 -07:00
|
|
|
name: 'field',
|
|
|
|
type: 'options',
|
2022-08-17 08:50:24 -07:00
|
|
|
description:
|
2024-09-12 07:53:36 -07:00
|
|
|
'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>',
|
2021-07-14 10:18:46 -07:00
|
|
|
typeOptions: {
|
|
|
|
loadOptionsMethod: 'loadCustomFields',
|
|
|
|
},
|
|
|
|
default: 'Custom Field',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Value',
|
|
|
|
name: 'value',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
|
|
|
description: 'Custom Field value. Use an expression if the type is not a string.',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Custom Fields (JSON)',
|
|
|
|
name: 'customFieldsJson',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
'/jsonParameters': [true],
|
2021-07-14 10:18:46 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
description: 'Custom fields in JSON format. Overrides Custom Fields UI if set.',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
// optional attributs (Promote operation)
|
|
|
|
|
|
|
|
{
|
|
|
|
displayName: 'Additional Fields',
|
|
|
|
name: 'additionalFields',
|
|
|
|
placeholder: 'Add Field',
|
|
|
|
type: 'collection',
|
2022-04-22 09:29:51 -07:00
|
|
|
default: {},
|
2021-07-14 10:18:46 -07:00
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['alert'],
|
|
|
|
operation: ['promote'],
|
2020-12-02 02:24:25 -08:00
|
|
|
},
|
|
|
|
},
|
2020-12-02 02:54:10 -08:00
|
|
|
options: [
|
2020-12-02 02:24:25 -08:00
|
|
|
{
|
|
|
|
displayName: 'Case Template',
|
|
|
|
name: 'caseTemplate',
|
2020-12-02 02:54:10 -08:00
|
|
|
type: 'string',
|
2020-12-02 02:24:25 -08:00
|
|
|
default: '',
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'Case template to use when a case is created from this alert',
|
2020-12-02 02:24:25 -08:00
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
// optional attributs (Update operation)
|
|
|
|
{
|
|
|
|
displayName: 'Update Fields',
|
|
|
|
name: 'updateFields',
|
|
|
|
type: 'collection',
|
|
|
|
placeholder: 'Add Field',
|
2022-04-22 09:29:51 -07:00
|
|
|
default: {},
|
2020-12-02 02:24:25 -08:00
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['alert'],
|
|
|
|
operation: ['update'],
|
2020-12-02 02:24:25 -08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
displayName: 'Artifacts',
|
|
|
|
name: 'artifactUi',
|
|
|
|
type: 'fixedCollection',
|
|
|
|
placeholder: 'Add Artifact',
|
2022-04-22 09:29:51 -07:00
|
|
|
default: {},
|
2020-12-02 02:24:25 -08:00
|
|
|
typeOptions: {
|
|
|
|
multipleValues: true,
|
|
|
|
},
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
displayName: 'Artifact',
|
|
|
|
name: 'artifactValues',
|
|
|
|
values: [
|
|
|
|
{
|
2022-06-03 10:23:49 -07:00
|
|
|
displayName: 'Data Type Name or ID',
|
2020-12-02 02:24:25 -08:00
|
|
|
name: 'dataType',
|
|
|
|
type: 'options',
|
|
|
|
default: '',
|
2021-04-05 01:52:56 -07:00
|
|
|
typeOptions: {
|
|
|
|
loadOptionsMethod: 'loadObservableTypes',
|
|
|
|
},
|
2022-08-17 08:50:24 -07:00
|
|
|
description:
|
2024-09-12 07:53:36 -07:00
|
|
|
'Type of the observable. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>.',
|
2020-12-02 02:24:25 -08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Data',
|
|
|
|
name: 'data',
|
|
|
|
type: 'string',
|
|
|
|
displayOptions: {
|
|
|
|
hide: {
|
2022-08-17 08:50:24 -07:00
|
|
|
dataType: ['file'],
|
2020-12-02 02:24:25 -08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
{
|
2024-01-03 03:08:16 -08:00
|
|
|
displayName: 'Input Binary Field',
|
2020-12-02 02:24:25 -08:00
|
|
|
name: 'binaryProperty',
|
|
|
|
type: 'string',
|
2024-01-03 03:08:16 -08:00
|
|
|
hint: 'The name of the input binary field containing the file to be written',
|
2020-12-02 02:24:25 -08:00
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
dataType: ['file'],
|
2020-12-02 02:24:25 -08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
default: 'data',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Message',
|
|
|
|
name: 'message',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Case Tags',
|
|
|
|
name: 'tags',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
2021-07-14 10:18:46 -07:00
|
|
|
{
|
|
|
|
displayName: 'Custom Fields',
|
|
|
|
name: 'customFieldsUi',
|
|
|
|
type: 'fixedCollection',
|
|
|
|
default: {},
|
|
|
|
typeOptions: {
|
|
|
|
multipleValues: true,
|
|
|
|
},
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
'/jsonParameters': [false],
|
2021-07-14 10:18:46 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
placeholder: 'Add Custom Field',
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
name: 'customFields',
|
|
|
|
displayName: 'Custom Field',
|
|
|
|
values: [
|
|
|
|
{
|
2022-06-03 10:23:49 -07:00
|
|
|
displayName: 'Field Name or ID',
|
2021-07-14 10:18:46 -07:00
|
|
|
name: 'field',
|
|
|
|
type: 'options',
|
2022-08-17 08:50:24 -07:00
|
|
|
description:
|
2024-09-12 07:53:36 -07:00
|
|
|
'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>',
|
2021-07-14 10:18:46 -07:00
|
|
|
typeOptions: {
|
|
|
|
loadOptionsMethod: 'loadCustomFields',
|
|
|
|
},
|
|
|
|
default: 'Custom Field',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Value',
|
|
|
|
name: 'value',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
|
|
|
description: 'Custom Field value. Use an expression if the type is not a string.',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Custom Fields (JSON)',
|
|
|
|
name: 'customFieldsJson',
|
|
|
|
type: 'string',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
'/jsonParameters': [true],
|
2021-07-14 10:18:46 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
default: '',
|
|
|
|
description: 'Custom fields in JSON format. Overrides Custom Fields UI if set.',
|
|
|
|
},
|
2020-12-02 02:24:25 -08:00
|
|
|
{
|
|
|
|
displayName: 'Case Template',
|
|
|
|
name: 'caseTemplate',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'Case template to use when a case is created from this alert',
|
2020-12-02 02:24:25 -08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Description',
|
|
|
|
name: 'description',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'Description of the alert',
|
2020-12-02 02:24:25 -08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Follow',
|
|
|
|
name: 'follow',
|
|
|
|
type: 'boolean',
|
|
|
|
default: true,
|
2022-06-20 07:54:01 -07:00
|
|
|
description: 'Whether the alert becomes active when updated default=true',
|
2020-12-02 02:24:25 -08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Severity',
|
2022-10-11 00:49:02 -07:00
|
|
|
name: 'severity',
|
2020-12-02 02:24:25 -08:00
|
|
|
type: 'options',
|
2020-12-02 02:54:10 -08:00
|
|
|
options: [
|
2020-12-02 02:24:25 -08:00
|
|
|
{
|
|
|
|
name: 'Low',
|
|
|
|
value: 1,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Medium',
|
|
|
|
value: 2,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'High',
|
|
|
|
value: 3,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
default: 2,
|
2022-04-22 09:29:51 -07:00
|
|
|
description: 'Severity of the alert. Default=Medium.',
|
2020-12-02 02:24:25 -08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Status',
|
|
|
|
name: 'status',
|
|
|
|
type: 'options',
|
2020-12-02 02:54:10 -08:00
|
|
|
options: [
|
2020-12-02 02:24:25 -08:00
|
|
|
{
|
|
|
|
name: 'New',
|
|
|
|
value: 'New',
|
|
|
|
},
|
|
|
|
{
|
2020-12-02 02:54:10 -08:00
|
|
|
name: 'Updated',
|
|
|
|
value: 'Updated',
|
2020-12-02 02:24:25 -08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Ignored',
|
2020-12-02 02:54:10 -08:00
|
|
|
value: 'Ignored',
|
2020-12-02 02:24:25 -08:00
|
|
|
},
|
|
|
|
{
|
2020-12-02 02:54:10 -08:00
|
|
|
name: 'Imported',
|
|
|
|
value: 'Imported',
|
2020-12-02 02:24:25 -08:00
|
|
|
},
|
|
|
|
],
|
|
|
|
default: 'New',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Case Tags',
|
|
|
|
name: 'tags',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
2020-12-02 02:54:10 -08:00
|
|
|
placeholder: 'tag,tag2,tag3...',
|
2020-12-02 02:24:25 -08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Title',
|
|
|
|
name: 'title',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'Title of the alert',
|
2020-12-02 02:24:25 -08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'TLP',
|
|
|
|
name: 'tlp',
|
|
|
|
type: 'options',
|
|
|
|
default: 2,
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
name: 'White',
|
|
|
|
value: TLP.white,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Green',
|
|
|
|
value: TLP.green,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Amber',
|
|
|
|
value: TLP.amber,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Red',
|
|
|
|
value: TLP.red,
|
|
|
|
},
|
|
|
|
],
|
2022-04-22 09:29:51 -07:00
|
|
|
description: 'Traffict Light Protocol (TLP). Default=Amber.',
|
2020-12-02 02:24:25 -08:00
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
//Query attributs (Search operation)
|
|
|
|
{
|
|
|
|
displayName: 'Options',
|
|
|
|
name: 'options',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
operation: ['getAll'],
|
|
|
|
resource: ['alert'],
|
2020-12-02 02:24:25 -08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
type: 'collection',
|
2024-07-29 05:27:23 -07:00
|
|
|
placeholder: 'Add option',
|
2020-12-02 02:24:25 -08:00
|
|
|
default: {},
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
displayName: 'Sort',
|
|
|
|
name: 'sort',
|
|
|
|
type: 'string',
|
|
|
|
placeholder: '±Attribut, exp +status',
|
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
2022-10-21 09:46:31 -07:00
|
|
|
{
|
|
|
|
displayName: 'Options',
|
|
|
|
name: 'options',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-11-22 04:43:28 -08:00
|
|
|
operation: ['get'],
|
|
|
|
resource: ['alert'],
|
2022-10-21 09:46:31 -07:00
|
|
|
},
|
|
|
|
},
|
|
|
|
type: 'collection',
|
2024-07-29 05:27:23 -07:00
|
|
|
placeholder: 'Add option',
|
2022-10-21 09:46:31 -07:00
|
|
|
default: {},
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
displayName: 'Include Similar Cases',
|
|
|
|
name: 'includeSimilar',
|
|
|
|
type: 'boolean',
|
|
|
|
description: 'Whether to include similar cases',
|
|
|
|
default: false,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
2020-12-02 02:24:25 -08:00
|
|
|
{
|
|
|
|
displayName: 'Filters',
|
|
|
|
name: 'filters',
|
|
|
|
placeholder: 'Add Filter',
|
|
|
|
default: {},
|
|
|
|
type: 'collection',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-17 08:50:24 -07:00
|
|
|
resource: ['alert'],
|
|
|
|
operation: ['getAll', 'count'],
|
2020-12-02 02:24:25 -08:00
|
|
|
},
|
|
|
|
},
|
2020-12-02 02:54:10 -08:00
|
|
|
options: [
|
2021-07-14 10:18:46 -07:00
|
|
|
{
|
|
|
|
displayName: 'Custom Fields',
|
|
|
|
name: 'customFieldsUi',
|
|
|
|
type: 'fixedCollection',
|
|
|
|
default: {},
|
|
|
|
typeOptions: {
|
|
|
|
multipleValues: true,
|
|
|
|
},
|
|
|
|
placeholder: 'Add Custom Field',
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
name: 'customFields',
|
|
|
|
displayName: 'Custom Field',
|
|
|
|
values: [
|
|
|
|
{
|
2022-06-03 10:23:49 -07:00
|
|
|
displayName: 'Field Name or ID',
|
2021-07-14 10:18:46 -07:00
|
|
|
name: 'field',
|
|
|
|
type: 'options',
|
2022-08-17 08:50:24 -07:00
|
|
|
description:
|
2024-09-12 07:53:36 -07:00
|
|
|
'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>',
|
2021-07-14 10:18:46 -07:00
|
|
|
typeOptions: {
|
|
|
|
loadOptionsMethod: 'loadCustomFields',
|
|
|
|
},
|
|
|
|
default: 'Custom Field',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Value',
|
|
|
|
name: 'value',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
|
|
|
description: 'Custom Field value. Use an expression if the type is not a string.',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
2020-12-02 02:24:25 -08:00
|
|
|
{
|
|
|
|
displayName: 'Description',
|
|
|
|
name: 'description',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'Description of the alert',
|
2020-12-02 02:24:25 -08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Follow',
|
|
|
|
name: 'follow',
|
|
|
|
type: 'boolean',
|
|
|
|
default: false,
|
2022-06-20 07:54:01 -07:00
|
|
|
description: 'Whether the alert becomes active when updated default=true',
|
2020-12-02 02:24:25 -08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Severity',
|
|
|
|
name: 'severity',
|
|
|
|
type: 'options',
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
name: 'Low',
|
2020-12-02 02:54:10 -08:00
|
|
|
value: 1,
|
2020-12-02 02:24:25 -08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Medium',
|
2020-12-02 02:54:10 -08:00
|
|
|
value: 2,
|
2020-12-02 02:24:25 -08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'High',
|
2020-12-02 02:54:10 -08:00
|
|
|
value: 3,
|
2020-12-02 02:24:25 -08:00
|
|
|
},
|
|
|
|
],
|
|
|
|
default: 2,
|
2022-04-22 09:29:51 -07:00
|
|
|
description: 'Severity of the alert. Default=Medium.',
|
2020-12-02 02:24:25 -08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Tags',
|
|
|
|
name: 'tags',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
|
|
|
placeholder: 'tag,tag2,tag3...',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Title',
|
|
|
|
name: 'title',
|
|
|
|
type: 'string',
|
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'TLP',
|
|
|
|
name: 'tlp',
|
|
|
|
type: 'options',
|
|
|
|
default: 2,
|
|
|
|
options: [
|
|
|
|
{
|
2020-12-02 02:54:10 -08:00
|
|
|
name: 'White',
|
|
|
|
value: TLP.white,
|
2020-12-02 02:24:25 -08:00
|
|
|
},
|
|
|
|
{
|
2020-12-02 02:54:10 -08:00
|
|
|
name: 'Green',
|
|
|
|
value: TLP.green,
|
2020-12-02 02:24:25 -08:00
|
|
|
},
|
|
|
|
{
|
2020-12-02 02:54:10 -08:00
|
|
|
name: 'Amber',
|
|
|
|
value: TLP.amber,
|
2020-12-02 02:24:25 -08:00
|
|
|
},
|
|
|
|
{
|
2020-12-02 02:54:10 -08:00
|
|
|
name: 'Red',
|
|
|
|
value: TLP.red,
|
|
|
|
},
|
2020-12-02 02:24:25 -08:00
|
|
|
],
|
2022-04-22 09:29:51 -07:00
|
|
|
description: 'Traffict Light Protocol (TLP). Default=Amber.',
|
2020-12-02 02:24:25 -08:00
|
|
|
},
|
|
|
|
],
|
2020-12-02 02:54:10 -08:00
|
|
|
},
|
2021-12-03 00:44:16 -08:00
|
|
|
];
|