{
  "name": "SecOps — CISA KEV Vulnerability Triage & Risk Routing",
  "nodes": [
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "hours",
              "hoursInterval": 24,
              "triggerAtHour": 8
            }
          ]
        }
      },
      "id": "1a2b3c4d-0001-4000-8000-000000000001",
      "name": "Daily SecOps Schedule (08:00 CET)",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.2,
      "position": [
        180,
        300
      ]
    },
    {
      "parameters": {
        "url": "https://www.cisa.gov/sites/default/files/feeds/known_exploited_vulnerabilities.json",
        "options": {
          "response": {
            "response": {
              "responseFormat": "json"
            }
          }
        }
      },
      "id": "1a2b3c4d-0002-4000-8000-000000000002",
      "name": "Fetch CISA KEV Feed",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        420,
        300
      ]
    },
    {
      "parameters": {
        "jsCode": "// Filter CISA Known Exploited Vulnerabilities (last 14 days)\n// against core infrastructure & corporate security stack\nconst STACK_RE = /(linux|ubuntu|debian|red hat|kernel|kubernetes|docker|fortinet|fortios|cisco|microsoft|azure|entra|okta|nginx|haproxy|postfix|openssl|openssh|proxmox|vmware|keycloak)/i;\n\nconst data = $input.first().json;\nconst vulns = Array.isArray(data.vulnerabilities) ? data.vulnerabilities : [];\nconst cutoff = new Date(Date.now() - 14 * 24 * 60 * 60 * 1000);\n\nconst matches = vulns\n  .filter((v) => {\n    const added = new Date(v.dateAdded || 0);\n    const text = `${v.vendorProject || ''} ${v.product || ''} ${v.vulnerabilityName || ''}`;\n    return added >= cutoff && STACK_RE.test(text);\n  })\n  .map((v) => {\n    const ransomware = String(v.knownRansomwareCampaignUse || '').toLowerCase() === 'known';\n    const perimeterOrIam = /(fortinet|cisco|okta|entra|openssh|openssl|nginx|kubernetes)/i.test(\n      `${v.vendorProject || ''} ${v.product || ''}`\n    );\n    const priority = ransomware || perimeterOrIam ? 'P1-CRITICAL' : 'P2-HIGH';\n    return {\n      json: {\n        cveID: v.cveID,\n        vendor: v.vendorProject,\n        product: v.product,\n        title: v.vulnerabilityName,\n        dateAdded: v.dateAdded,\n        dueDate: v.dueDate,\n        ransomwareUse: v.knownRansomwareCampaignUse,\n        priority,\n        requiredAction: v.requiredAction,\n        summary: `[${priority}] ${v.cveID} — ${v.vendorProject} ${v.product} (due ${v.dueDate})`\n      }\n    };\n  });\n\nif (matches.length === 0) {\n  return [{\n    json: {\n      cveID: 'NONE',\n      priority: 'INFO',\n      summary: 'No new CISA KEV matches for tracked stack in the last 14 days.'\n    }\n  }];\n}\n\nreturn matches;"
      },
      "id": "1a2b3c4d-0003-4000-8000-000000000003",
      "name": "Filter Stack & Score Risk",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        680,
        300
      ]
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict"
          },
          "conditions": [
            {
              "id": "cond-p1",
              "leftValue": "={{ $json.priority }}",
              "rightValue": "P1-CRITICAL",
              "operator": {
                "type": "string",
                "operation": "equals"
              }
            }
          ],
          "combinator": "and"
        }
      },
      "id": "1a2b3c4d-0004-4000-8000-000000000004",
      "name": "Is P1 Critical?",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.2,
      "position": [
        940,
        300
      ]
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "a1",
              "name": "channel",
              "value": "#secops-incidents",
              "type": "string"
            },
            {
              "id": "a2",
              "name": "sla",
              "value": "24h containment & emergency patch",
              "type": "string"
            },
            {
              "id": "a3",
              "name": "alertMessage",
              "value": "={{ '🚨 P1 SecOps Alert: ' + $json.cveID + ' (' + $json.vendor + ' ' + $json.product + ') | Action: ' + $json.requiredAction }}",
              "type": "string"
            }
          ]
        },
        "includeOtherFields": true
      },
      "id": "1a2b3c4d-0005-4000-8000-000000000005",
      "name": "Route to P1 Incident Alert",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        1220,
        180
      ]
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "b1",
              "name": "queue",
              "value": "Vulnerability Backlog / Patch Window",
              "type": "string"
            },
            {
              "id": "b2",
              "name": "sla",
              "value": "Scheduled 7-day remediation sprint",
              "type": "string"
            },
            {
              "id": "b3",
              "name": "digestLine",
              "value": "={{ '📋 ' + $json.summary }}",
              "type": "string"
            }
          ]
        },
        "includeOtherFields": true
      },
      "id": "1a2b3c4d-0006-4000-8000-000000000006",
      "name": "Log to Scheduled Patch Queue",
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        1220,
        420
      ]
    },
    {
      "parameters": {
        "content": "## SecOps CVE Triage Workflow\n\n1. Polls **CISA Known Exploited Vulnerabilities (KEV)** daily at 08:00 CET (zero credentials).\n2. Filters findings against core production & corporate stack (**Linux, K8s, Fortinet, Cisco, Okta, Entra ID, Nginx**).\n3. Classifies **P1-CRITICAL** (ransomware-linked or perimeter/IAM exposure) vs **P2-HIGH**.\n4. Routes P1 to immediate **SecOps Incident Alert** (24h SLA) and P2 to the **Scheduled Patch Queue**.",
        "height": 230,
        "width": 420
      },
      "id": "1a2b3c4d-0007-4000-8000-000000000007",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        180,
        20
      ]
    }
  ],
  "connections": {
    "Daily SecOps Schedule (08:00 CET)": {
      "main": [
        [
          {
            "node": "Fetch CISA KEV Feed",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch CISA KEV Feed": {
      "main": [
        [
          {
            "node": "Filter Stack & Score Risk",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter Stack & Score Risk": {
      "main": [
        [
          {
            "node": "Is P1 Critical?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Is P1 Critical?": {
      "main": [
        [
          {
            "node": "Route to P1 Incident Alert",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Log to Scheduled Patch Queue",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "secops-cve-triage-v1",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "tags": []
}
