2020-12-02 02:24:25 -08:00
|
|
|
import {
|
|
|
|
INodeProperties,
|
|
|
|
} from 'n8n-workflow';
|
|
|
|
|
|
|
|
import {
|
|
|
|
TLP,
|
2020-12-02 02:54:10 -08:00
|
|
|
} 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',
|
|
|
|
required: true,
|
|
|
|
description: 'Choose an operation',
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
resource: [
|
|
|
|
'analyzer',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
default: 'execute',
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
name: 'Execute',
|
|
|
|
value: 'execute',
|
|
|
|
description: 'Execute Analyzer',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
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
|
|
|
{
|
|
|
|
displayName: 'Analyzer Type',
|
|
|
|
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: {
|
|
|
|
resource: [
|
|
|
|
'analyzer',
|
|
|
|
],
|
2020-12-02 02:54:10 -08:00
|
|
|
operation: [
|
2020-12-02 02:24:25 -08:00
|
|
|
'execute',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
description: 'Choose the analyzer',
|
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Observable Type',
|
|
|
|
name: 'observableType',
|
|
|
|
type: 'options',
|
|
|
|
required: true,
|
2020-12-02 02:54:10 -08:00
|
|
|
displayOptions: {
|
2020-12-02 02:24:25 -08:00
|
|
|
show: {
|
|
|
|
resource: [
|
|
|
|
'analyzer',
|
|
|
|
],
|
2020-12-02 02:54:10 -08:00
|
|
|
operation: [
|
2020-12-02 02:24:25 -08:00
|
|
|
'execute',
|
|
|
|
],
|
|
|
|
},
|
2020-12-02 02:54:10 -08:00
|
|
|
hide: {
|
|
|
|
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',
|
|
|
|
loadOptionsDependsOn: [
|
|
|
|
'analyzer',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
default: '',
|
|
|
|
description: 'Choose the observable type',
|
|
|
|
},
|
|
|
|
|
|
|
|
// Observable type != file
|
|
|
|
{
|
|
|
|
displayName: 'Observable Value',
|
|
|
|
name: 'observableValue',
|
|
|
|
type: 'string',
|
|
|
|
required: true,
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
resource: [
|
|
|
|
'analyzer',
|
|
|
|
],
|
2020-12-02 02:54:10 -08:00
|
|
|
operation: [
|
2020-12-02 02:24:25 -08:00
|
|
|
'execute',
|
|
|
|
],
|
|
|
|
},
|
2020-12-02 02:54:10 -08:00
|
|
|
hide: {
|
2020-12-02 02:24:25 -08:00
|
|
|
observableType: [
|
|
|
|
'file',
|
|
|
|
],
|
2020-12-02 02:54:10 -08:00
|
|
|
analyzer: [
|
2020-12-02 02:24:25 -08:00
|
|
|
'',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
default: '',
|
|
|
|
description: 'Enter the observable value',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Binary Property',
|
|
|
|
name: 'binaryPropertyName',
|
|
|
|
type: 'string',
|
|
|
|
default: 'data',
|
|
|
|
required: true,
|
|
|
|
displayOptions: {
|
|
|
|
show: {
|
|
|
|
observableType: [
|
|
|
|
'file',
|
|
|
|
],
|
|
|
|
resource: [
|
|
|
|
'analyzer',
|
|
|
|
],
|
|
|
|
operation: [
|
|
|
|
'execute',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
2022-05-06 14:01:25 -07:00
|
|
|
description: 'Name of the binary property to which to write the data of the read file',
|
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: {
|
|
|
|
resource: [
|
|
|
|
'analyzer',
|
|
|
|
],
|
|
|
|
operation: [
|
|
|
|
'execute',
|
|
|
|
],
|
|
|
|
},
|
2020-12-02 02:54:10 -08:00
|
|
|
hide: {
|
2020-12-02 02:24:25 -08:00
|
|
|
observableType: [
|
|
|
|
'',
|
|
|
|
],
|
|
|
|
analyzer: [
|
|
|
|
'',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
name: 'White',
|
|
|
|
value: TLP.white,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Green',
|
|
|
|
value: TLP.green,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Amber',
|
|
|
|
value: TLP.amber,
|
2020-12-02 02:54:10 -08: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: {
|
|
|
|
resource: [
|
|
|
|
'analyzer',
|
|
|
|
],
|
|
|
|
operation: [
|
|
|
|
'execute',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
displayName: 'Force',
|
|
|
|
name: 'force',
|
|
|
|
type: 'boolean',
|
|
|
|
default: false,
|
|
|
|
description: 'To force bypassing the cache, set this parameter to true',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Timeout (seconds)',
|
|
|
|
name: 'timeout',
|
|
|
|
type: 'number',
|
|
|
|
default: 3,
|
|
|
|
description: 'Timeout to wait for the report in case it is not available at the time the query was made',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
];
|