2023-01-27 03:22:44 -08:00
|
|
|
import type { INodeProperties } from 'n8n-workflow';
|
2020-12-02 02:24:25 -08:00
|
|
|
|
2022-08-01 13:47:55 -07:00
|
|
|
import { TLP } from './AnalyzerInterface';
|
2020-12-02 02:24:25 -08:00
|
|
|
|
2021-12-03 00:44:16 -08:00
|
|
|
export const analyzersOperations: INodeProperties[] = [
|
2020-12-02 02:24:25 -08:00
|
|
|
{
|
|
|
|
displayName: 'Operation',
|
|
|
|
name: 'operation',
|
|
|
|
type: 'options',
|
2022-05-20 14:47:24 -07:00
|
|
|
noDataExpression: true,
|
2020-12-02 02:24:25 -08:00
|
|
|
required: true,
|
|
|
|
description: 'Choose an operation',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-01 13:47:55 -07:00
|
|
|
resource: ['analyzer'],
|
2020-12-02 02:24:25 -08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
default: 'execute',
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
name: 'Execute',
|
|
|
|
value: 'execute',
|
|
|
|
description: 'Execute Analyzer',
|
2022-07-10 13:50:51 -07:00
|
|
|
action: 'Execute an analyzer',
|
2020-12-02 02:24:25 -08:00
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
2021-12-03 00:44:16 -08:00
|
|
|
];
|
2020-12-02 02:24:25 -08:00
|
|
|
|
2020-12-02 02:54:10 -08:00
|
|
|
export const analyzerFields: INodeProperties[] = [
|
2020-12-02 02:24:25 -08:00
|
|
|
{
|
2022-06-03 10:23:49 -07:00
|
|
|
displayName: 'Analyzer Type Name or ID',
|
2020-12-02 02:24:25 -08:00
|
|
|
name: 'analyzer',
|
|
|
|
type: 'options',
|
|
|
|
required: true,
|
|
|
|
typeOptions: {
|
|
|
|
loadOptionsMethod: 'loadActiveAnalyzers',
|
|
|
|
},
|
2020-12-02 02:54:10 -08:00
|
|
|
displayOptions: {
|
2020-12-02 02:24:25 -08:00
|
|
|
show: {
|
2022-08-01 13:47:55 -07:00
|
|
|
resource: ['analyzer'],
|
|
|
|
operation: ['execute'],
|
2020-12-02 02:24:25 -08:00
|
|
|
},
|
|
|
|
},
|
2022-08-01 13:47:55 -07:00
|
|
|
description:
|
2024-09-12 07:53:36 -07:00
|
|
|
'Choose the analyzer. 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
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
{
|
2022-06-03 10:23:49 -07:00
|
|
|
displayName: 'Observable Type Name or ID',
|
2020-12-02 02:24:25 -08:00
|
|
|
name: 'observableType',
|
|
|
|
type: 'options',
|
|
|
|
required: true,
|
2020-12-02 02:54:10 -08:00
|
|
|
displayOptions: {
|
2020-12-02 02:24:25 -08:00
|
|
|
show: {
|
2022-08-01 13:47:55 -07:00
|
|
|
resource: ['analyzer'],
|
|
|
|
operation: ['execute'],
|
2020-12-02 02:24:25 -08:00
|
|
|
},
|
2020-12-02 02:54:10 -08:00
|
|
|
hide: {
|
2022-08-01 13:47:55 -07:00
|
|
|
analyzer: [''],
|
2020-12-02 02:24:25 -08:00
|
|
|
},
|
|
|
|
},
|
2020-12-02 02:54:10 -08:00
|
|
|
typeOptions: {
|
2020-12-02 02:24:25 -08:00
|
|
|
loadOptionsMethod: 'loadObservableOptions',
|
2022-08-01 13:47:55 -07:00
|
|
|
loadOptionsDependsOn: ['analyzer'],
|
2020-12-02 02:24:25 -08:00
|
|
|
},
|
|
|
|
default: '',
|
2022-08-01 13:47:55 -07:00
|
|
|
description:
|
2024-09-12 07:53:36 -07:00
|
|
|
'Choose the observable type. 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
|
|
|
},
|
|
|
|
|
|
|
|
// Observable type != file
|
|
|
|
{
|
|
|
|
displayName: 'Observable Value',
|
|
|
|
name: 'observableValue',
|
|
|
|
type: 'string',
|
|
|
|
required: true,
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-01 13:47:55 -07:00
|
|
|
resource: ['analyzer'],
|
|
|
|
operation: ['execute'],
|
2020-12-02 02:24:25 -08:00
|
|
|
},
|
2020-12-02 02:54:10 -08:00
|
|
|
hide: {
|
2022-08-01 13:47:55 -07:00
|
|
|
observableType: ['file'],
|
|
|
|
analyzer: [''],
|
2020-12-02 02:24:25 -08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
default: '',
|
|
|
|
description: 'Enter the observable value',
|
|
|
|
},
|
|
|
|
{
|
2024-01-03 03:08:16 -08:00
|
|
|
displayName: 'Put Output File in Field',
|
2020-12-02 02:24:25 -08:00
|
|
|
name: 'binaryPropertyName',
|
|
|
|
type: 'string',
|
|
|
|
default: 'data',
|
|
|
|
required: true,
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-01 13:47:55 -07:00
|
|
|
observableType: ['file'],
|
|
|
|
resource: ['analyzer'],
|
|
|
|
operation: ['execute'],
|
2020-12-02 02:24:25 -08:00
|
|
|
},
|
|
|
|
},
|
2024-01-03 03:08:16 -08:00
|
|
|
hint: 'The name of the output binary field to put the file in',
|
2020-12-02 02:24:25 -08:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'TLP',
|
|
|
|
name: 'tlp',
|
|
|
|
type: 'options',
|
2020-12-02 02:54:10 -08:00
|
|
|
displayOptions: {
|
2020-12-02 02:24:25 -08:00
|
|
|
show: {
|
2022-08-01 13:47:55 -07:00
|
|
|
resource: ['analyzer'],
|
|
|
|
operation: ['execute'],
|
2020-12-02 02:24:25 -08:00
|
|
|
},
|
2020-12-02 02:54:10 -08:00
|
|
|
hide: {
|
2022-08-01 13:47:55 -07:00
|
|
|
observableType: [''],
|
|
|
|
analyzer: [''],
|
2020-12-02 02:24:25 -08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
name: 'White',
|
|
|
|
value: TLP.white,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Green',
|
|
|
|
value: TLP.green,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Amber',
|
|
|
|
value: TLP.amber,
|
2022-08-01 13:47:55 -07:00
|
|
|
},
|
|
|
|
{
|
2020-12-02 02:24:25 -08:00
|
|
|
name: 'Red',
|
|
|
|
value: TLP.red,
|
2020-12-02 02:54:10 -08:00
|
|
|
},
|
2020-12-02 02:24:25 -08:00
|
|
|
],
|
|
|
|
default: 2,
|
|
|
|
description: 'The TLP of the analyzed observable',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Additional Fields',
|
|
|
|
name: 'additionalFields',
|
|
|
|
type: 'collection',
|
|
|
|
placeholder: 'Add Field',
|
|
|
|
default: {},
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
2022-08-01 13:47:55 -07:00
|
|
|
resource: ['analyzer'],
|
|
|
|
operation: ['execute'],
|
2020-12-02 02:24:25 -08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
displayName: 'Force',
|
|
|
|
name: 'force',
|
|
|
|
type: 'boolean',
|
|
|
|
default: false,
|
2022-06-20 07:54:01 -07:00
|
|
|
description: 'Whether to force bypassing the cache',
|
2020-12-02 02:24:25 -08:00
|
|
|
},
|
|
|
|
{
|
2022-06-03 10:23:49 -07:00
|
|
|
displayName: 'Timeout (Seconds)',
|
2020-12-02 02:24:25 -08:00
|
|
|
name: 'timeout',
|
|
|
|
type: 'number',
|
|
|
|
default: 3,
|
2022-08-01 13:47:55 -07:00
|
|
|
description:
|
|
|
|
'Timeout to wait for the report in case it is not available at the time the query was made',
|
2020-12-02 02:24:25 -08:00
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
];
|