566 lines
15 KiB
JSON
566 lines
15 KiB
JSON
{
|
||
"id": "21kEHGQ_E07Uq7irNExUD",
|
||
"name": "Email Review",
|
||
"nodes": [
|
||
{
|
||
"parameters": {
|
||
"pollTimes": {
|
||
"item": [
|
||
{
|
||
"mode": "everyHour"
|
||
}
|
||
]
|
||
},
|
||
"filters": {
|
||
"readStatus": "unread"
|
||
}
|
||
},
|
||
"type": "n8n-nodes-base.gmailTrigger",
|
||
"typeVersion": 1.3,
|
||
"position": [
|
||
-640,
|
||
-208
|
||
],
|
||
"id": "f83c959d-3d77-4a81-983f-e0c960945209",
|
||
"name": "Gmail Trigger",
|
||
"credentials": {
|
||
"gmailOAuth2": {
|
||
"id": "UDrpaip2ru9PZoaJ",
|
||
"name": "rizon-gmail"
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"parameters": {
|
||
"rules": {
|
||
"values": [
|
||
{
|
||
"conditions": {
|
||
"options": {
|
||
"caseSensitive": true,
|
||
"leftValue": "",
|
||
"typeValidation": "strict",
|
||
"version": 3
|
||
},
|
||
"conditions": [
|
||
{
|
||
"leftValue": "={{ $json.To }}",
|
||
"rightValue": "kline@rizon.net",
|
||
"operator": {
|
||
"type": "string",
|
||
"operation": "equals"
|
||
},
|
||
"id": "0ae6c938-bc7e-4d81-a117-7752355ad4a7"
|
||
}
|
||
],
|
||
"combinator": "and"
|
||
},
|
||
"renameOutput": true,
|
||
"outputKey": "kline@rizon.net"
|
||
},
|
||
{
|
||
"conditions": {
|
||
"options": {
|
||
"caseSensitive": true,
|
||
"leftValue": "",
|
||
"typeValidation": "strict",
|
||
"version": 3
|
||
},
|
||
"conditions": [
|
||
{
|
||
"id": "bb4620f5-6d35-4ce0-819e-bae2e04904eb",
|
||
"leftValue": "={{ $json.To }}",
|
||
"rightValue": "rizon@list.shadowserver.org",
|
||
"operator": {
|
||
"type": "string",
|
||
"operation": "equals"
|
||
}
|
||
}
|
||
],
|
||
"combinator": "and"
|
||
},
|
||
"renameOutput": true,
|
||
"outputKey": "shadowserver@rizon.net"
|
||
}
|
||
]
|
||
},
|
||
"options": {
|
||
"allMatchingOutputs": true
|
||
}
|
||
},
|
||
"type": "n8n-nodes-base.switch",
|
||
"typeVersion": 3.4,
|
||
"position": [
|
||
-320,
|
||
-96
|
||
],
|
||
"id": "e0376f85-0771-49a2-83a0-2729157eff30",
|
||
"name": "Route"
|
||
},
|
||
{
|
||
"parameters": {
|
||
"method": "=GET",
|
||
"url": "={{ $json.report_url }}",
|
||
"options": {
|
||
"response": {
|
||
"response": {
|
||
"responseFormat": "file",
|
||
"outputPropertyName": "csv"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"type": "n8n-nodes-base.httpRequest",
|
||
"typeVersion": 4.3,
|
||
"position": [
|
||
96,
|
||
0
|
||
],
|
||
"id": "4e9f294b-5d5f-4fd0-965b-3f30c546de94",
|
||
"name": "Report Download"
|
||
},
|
||
{
|
||
"parameters": {
|
||
"assignments": {
|
||
"assignments": [
|
||
{
|
||
"id": "d9b5b017-4602-4622-9207-bf5063b7f148",
|
||
"name": "=report_url",
|
||
"value": "={{ $json.snippet.match(/https:\\/\\/[^\\s]+/)[0] }}",
|
||
"type": "string"
|
||
}
|
||
]
|
||
},
|
||
"includeOtherFields": true,
|
||
"options": {}
|
||
},
|
||
"type": "n8n-nodes-base.set",
|
||
"typeVersion": 3.4,
|
||
"position": [
|
||
-112,
|
||
0
|
||
],
|
||
"id": "703f00f1-c533-4793-b6b9-59c45982f682",
|
||
"name": "Parse Report URL"
|
||
},
|
||
{
|
||
"parameters": {
|
||
"operation": "html",
|
||
"binaryPropertyName": "csv",
|
||
"options": {
|
||
"headerRow": true
|
||
}
|
||
},
|
||
"type": "n8n-nodes-base.extractFromFile",
|
||
"typeVersion": 1.1,
|
||
"position": [
|
||
304,
|
||
0
|
||
],
|
||
"id": "5a99cb18-40b6-4f5f-bb50-659f4a1c7240",
|
||
"name": "Extract from File"
|
||
},
|
||
{
|
||
"parameters": {
|
||
"operation": "upsert",
|
||
"schema": {
|
||
"__rl": true,
|
||
"mode": "list",
|
||
"value": "public"
|
||
},
|
||
"table": {
|
||
"__rl": true,
|
||
"value": "shadowserver_rizon",
|
||
"mode": "list",
|
||
"cachedResultName": "shadowserver_rizon"
|
||
},
|
||
"columns": {
|
||
"mappingMode": "defineBelow",
|
||
"value": {
|
||
"report_timestamp": "={{ $json.timestamp }}",
|
||
"port": "={{ $json.port }}",
|
||
"asn": "={{ $json.asn }}",
|
||
"naics": "={{ $json.naics }}",
|
||
"tag": "={{ $json.tag }}",
|
||
"ip": "={{ $json.ip }}",
|
||
"last_seen_at": "={{ $now }}",
|
||
"hostname_source": "={{ $json.hostname_source }}",
|
||
"hostname": "={{ $json.hostname }}",
|
||
"device_vendor": "={{ $json.device_vendor }}",
|
||
"device_type": "={{ $json.device_type }}",
|
||
"device_model": "={{ $json.device_model }}",
|
||
"device_version": "={{ $json.device_version }}",
|
||
"sector": "={{ $json.sector }}",
|
||
"city": "={{ $json.city }}",
|
||
"region": "={{ $json.region }}",
|
||
"geo": "={{ $json.geo }}",
|
||
"protocol": "={{ $json.protocol }}",
|
||
"severity": "={{ $json.severity }}",
|
||
"human_timestamp": "={{ DateTime.fromMillis(($json.timestamp - 25569) * 86400 * 1000).toISO() }}"
|
||
},
|
||
"matchingColumns": [
|
||
"port",
|
||
"ip",
|
||
"tag"
|
||
],
|
||
"schema": [
|
||
{
|
||
"id": "id",
|
||
"displayName": "id",
|
||
"required": false,
|
||
"defaultMatch": true,
|
||
"display": true,
|
||
"type": "number",
|
||
"canBeUsedToMatch": true,
|
||
"removed": true
|
||
},
|
||
{
|
||
"id": "report_timestamp",
|
||
"displayName": "report_timestamp",
|
||
"required": false,
|
||
"defaultMatch": false,
|
||
"display": true,
|
||
"type": "number",
|
||
"canBeUsedToMatch": false
|
||
},
|
||
{
|
||
"id": "human_timestamp",
|
||
"displayName": "human_timestamp",
|
||
"required": false,
|
||
"defaultMatch": false,
|
||
"display": true,
|
||
"type": "dateTime",
|
||
"canBeUsedToMatch": false,
|
||
"removed": false
|
||
},
|
||
{
|
||
"id": "severity",
|
||
"displayName": "severity",
|
||
"required": false,
|
||
"defaultMatch": false,
|
||
"display": true,
|
||
"type": "string",
|
||
"canBeUsedToMatch": false
|
||
},
|
||
{
|
||
"id": "ip",
|
||
"displayName": "ip",
|
||
"required": false,
|
||
"defaultMatch": false,
|
||
"display": true,
|
||
"type": "string",
|
||
"canBeUsedToMatch": true,
|
||
"removed": false
|
||
},
|
||
{
|
||
"id": "protocol",
|
||
"displayName": "protocol",
|
||
"required": false,
|
||
"defaultMatch": false,
|
||
"display": true,
|
||
"type": "string",
|
||
"canBeUsedToMatch": false
|
||
},
|
||
{
|
||
"id": "port",
|
||
"displayName": "port",
|
||
"required": false,
|
||
"defaultMatch": false,
|
||
"display": true,
|
||
"type": "number",
|
||
"canBeUsedToMatch": true,
|
||
"removed": false
|
||
},
|
||
{
|
||
"id": "tag",
|
||
"displayName": "tag",
|
||
"required": false,
|
||
"defaultMatch": false,
|
||
"display": true,
|
||
"type": "string",
|
||
"canBeUsedToMatch": true,
|
||
"removed": false
|
||
},
|
||
{
|
||
"id": "asn",
|
||
"displayName": "asn",
|
||
"required": false,
|
||
"defaultMatch": false,
|
||
"display": true,
|
||
"type": "number",
|
||
"canBeUsedToMatch": false
|
||
},
|
||
{
|
||
"id": "geo",
|
||
"displayName": "geo",
|
||
"required": false,
|
||
"defaultMatch": false,
|
||
"display": true,
|
||
"type": "string",
|
||
"canBeUsedToMatch": false
|
||
},
|
||
{
|
||
"id": "region",
|
||
"displayName": "region",
|
||
"required": false,
|
||
"defaultMatch": false,
|
||
"display": true,
|
||
"type": "string",
|
||
"canBeUsedToMatch": false
|
||
},
|
||
{
|
||
"id": "city",
|
||
"displayName": "city",
|
||
"required": false,
|
||
"defaultMatch": false,
|
||
"display": true,
|
||
"type": "string",
|
||
"canBeUsedToMatch": false
|
||
},
|
||
{
|
||
"id": "naics",
|
||
"displayName": "naics",
|
||
"required": false,
|
||
"defaultMatch": false,
|
||
"display": true,
|
||
"type": "number",
|
||
"canBeUsedToMatch": false
|
||
},
|
||
{
|
||
"id": "sector",
|
||
"displayName": "sector",
|
||
"required": false,
|
||
"defaultMatch": false,
|
||
"display": true,
|
||
"type": "string",
|
||
"canBeUsedToMatch": false
|
||
},
|
||
{
|
||
"id": "device_vendor",
|
||
"displayName": "device_vendor",
|
||
"required": false,
|
||
"defaultMatch": false,
|
||
"display": true,
|
||
"type": "string",
|
||
"canBeUsedToMatch": false
|
||
},
|
||
{
|
||
"id": "device_type",
|
||
"displayName": "device_type",
|
||
"required": false,
|
||
"defaultMatch": false,
|
||
"display": true,
|
||
"type": "string",
|
||
"canBeUsedToMatch": false
|
||
},
|
||
{
|
||
"id": "device_model",
|
||
"displayName": "device_model",
|
||
"required": false,
|
||
"defaultMatch": false,
|
||
"display": true,
|
||
"type": "string",
|
||
"canBeUsedToMatch": false
|
||
},
|
||
{
|
||
"id": "device_version",
|
||
"displayName": "device_version",
|
||
"required": false,
|
||
"defaultMatch": false,
|
||
"display": true,
|
||
"type": "string",
|
||
"canBeUsedToMatch": false
|
||
},
|
||
{
|
||
"id": "hostname",
|
||
"displayName": "hostname",
|
||
"required": false,
|
||
"defaultMatch": false,
|
||
"display": true,
|
||
"type": "string",
|
||
"canBeUsedToMatch": false
|
||
},
|
||
{
|
||
"id": "hostname_source",
|
||
"displayName": "hostname_source",
|
||
"required": false,
|
||
"defaultMatch": false,
|
||
"display": true,
|
||
"type": "string",
|
||
"canBeUsedToMatch": false
|
||
},
|
||
{
|
||
"id": "created_at",
|
||
"displayName": "created_at",
|
||
"required": false,
|
||
"defaultMatch": false,
|
||
"display": true,
|
||
"type": "dateTime",
|
||
"canBeUsedToMatch": false,
|
||
"removed": true
|
||
},
|
||
{
|
||
"id": "last_seen_at",
|
||
"displayName": "last_seen_at",
|
||
"required": false,
|
||
"defaultMatch": false,
|
||
"display": true,
|
||
"type": "dateTime",
|
||
"canBeUsedToMatch": false,
|
||
"removed": false
|
||
}
|
||
],
|
||
"attemptToConvertTypes": false,
|
||
"convertFieldsToString": false
|
||
},
|
||
"options": {}
|
||
},
|
||
"type": "n8n-nodes-base.postgres",
|
||
"typeVersion": 2.6,
|
||
"position": [
|
||
528,
|
||
0
|
||
],
|
||
"id": "e56c9aa3-923d-4088-a502-d075e348461c",
|
||
"name": "Insert or update rows in a table",
|
||
"credentials": {
|
||
"postgres": {
|
||
"id": "Ik8CFyap8ic2Md3M",
|
||
"name": "n8n-infra"
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"parameters": {
|
||
"operation": "getAll",
|
||
"limit": 5,
|
||
"filters": {
|
||
"labelIds": [
|
||
"Label_734823692276842075"
|
||
],
|
||
"receivedAfter": "={{ $now.minus({ minutes: 300 }).toFormat('yyyy/MM/dd HH:mm:ss') }}"
|
||
}
|
||
},
|
||
"type": "n8n-nodes-base.gmail",
|
||
"typeVersion": 2.2,
|
||
"position": [
|
||
-640,
|
||
32
|
||
],
|
||
"id": "436506e9-2fca-4dac-9a57-e9cef92193b6",
|
||
"name": "Get many messages",
|
||
"webhookId": "4835dd9b-345a-4ef3-b5e6-524ec0d83e29",
|
||
"credentials": {
|
||
"gmailOAuth2": {
|
||
"id": "UDrpaip2ru9PZoaJ",
|
||
"name": "rizon-gmail"
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"parameters": {},
|
||
"type": "n8n-nodes-base.manualTrigger",
|
||
"typeVersion": 1,
|
||
"position": [
|
||
-848,
|
||
32
|
||
],
|
||
"id": "87718be7-f310-470b-acc2-918f9c146203",
|
||
"name": "When clicking ‘Execute workflow’"
|
||
}
|
||
],
|
||
"connections": {
|
||
"Gmail Trigger": {
|
||
"main": [
|
||
[
|
||
{
|
||
"node": "Route",
|
||
"type": "main",
|
||
"index": 0
|
||
}
|
||
]
|
||
]
|
||
},
|
||
"Route": {
|
||
"main": [
|
||
[],
|
||
[
|
||
{
|
||
"node": "Parse Report URL",
|
||
"type": "main",
|
||
"index": 0
|
||
}
|
||
]
|
||
]
|
||
},
|
||
"Parse Report URL": {
|
||
"main": [
|
||
[
|
||
{
|
||
"node": "Report Download",
|
||
"type": "main",
|
||
"index": 0
|
||
}
|
||
]
|
||
]
|
||
},
|
||
"Report Download": {
|
||
"main": [
|
||
[
|
||
{
|
||
"node": "Extract from File",
|
||
"type": "main",
|
||
"index": 0
|
||
}
|
||
]
|
||
]
|
||
},
|
||
"Extract from File": {
|
||
"main": [
|
||
[
|
||
{
|
||
"node": "Insert or update rows in a table",
|
||
"type": "main",
|
||
"index": 0
|
||
}
|
||
]
|
||
]
|
||
},
|
||
"Get many messages": {
|
||
"main": [
|
||
[
|
||
{
|
||
"node": "Route",
|
||
"type": "main",
|
||
"index": 0
|
||
}
|
||
]
|
||
]
|
||
},
|
||
"When clicking ‘Execute workflow’": {
|
||
"main": [
|
||
[
|
||
{
|
||
"node": "Get many messages",
|
||
"type": "main",
|
||
"index": 0
|
||
}
|
||
]
|
||
]
|
||
}
|
||
},
|
||
"settings": {
|
||
"executionOrder": "v1",
|
||
"availableInMCP": false
|
||
},
|
||
"triggerCount": 1,
|
||
"versionId": "5fb89ea8-06ae-4f75-a759-7d24018e255b",
|
||
"owner": {
|
||
"type": "personal",
|
||
"projectId": "FeLO36wNUAcn61Wj",
|
||
"projectName": "Ben W <admin@ben.io>",
|
||
"personalEmail": "admin@ben.io"
|
||
},
|
||
"parentFolderId": "caxOx4NfY2vHcoNv",
|
||
"isArchived": false
|
||
} |