The Problem
Vulnerability scanners are noisy by design: the same CVE fires repeatedly across scan cycles, and a raw alert feed with no deduplication or context turns into either alert fatigue (everything gets ignored) or ticket spam (every scan recreates a Jira issue nobody asked for).
Architecture
Webhook (header auth) → Validate Payload (CVE ID + IP format) → Redis Dedup Check → [duplicate: short circuit response] → NVD Enrichment + Supabase Asset Lookup → Gemini Risk Agent (structured score, action, reasoning) → Jira Issue (auto patch vs. manual review) → Webhook Response
What It Does
Deduplication before enrichment, not after: a Redis counter keyed on CVE ID + IP address rejects repeat alerts immediately, before spending an NVD API call or a Gemini invocation on an event already processed: cheap check first, expensive work only when it's new.
Context aware risk scoring: the model isn't asked "is this CVE bad" in isolation; it receives both the NVD vulnerability detail and the specific asset's context from a Supabase CMDB table, so the same CVE can score differently against a production server versus an isolated dev box.
Structured output drives routing, not prose: the Gemini agent returns a fixed JSON shape (score, action, reasoning), and that action field is what decides whether the resulting Jira issue is flagged for emergency auto patch or filed as manual review: the routing logic reads a field, it doesn't parse a paragraph.
Fail fast validation at the edge: malformed CVE IDs or missing IP addresses are rejected with an error response before touching Redis, NVD, or the model at all.
Engineering Focus
The design decision worth calling out is asset aware scoring: bolting a CMDB lookup onto vulnerability triage is what turns a generic CVE feed into something that reflects actual exposure, and it's the piece most quick vulnerability alerting setups skip because it requires a real asset inventory to exist first.
What I'd Harden
Before production I'd want: an explicit TTL on the Redis dedup keys (unbounded dedup keys are a slow memory leak), rate limit handling around the NVD API call (public vulnerability APIs throttle aggressively), and a documented escalation path for the "unclear" risk bucket so it doesn't quietly become the default when the model is uncertain.
Gallery


