How danish-2323/triage works
Purpose and entry points
Personalised Vulnerability Triage ranks vulnerability records for a specific organisation rather than globally by CVSS. It supports a Streamlit operator UI in app.py and a FastAPI integration endpoint in api.py (POST /triage). Both drive the same matching, scoring, and explanation pipeline.
Data and profile boundary
Bundled operation is offline-first: vulnerability rows come from data/vulnerabilities.csv; organisation profiles and their risk weights come from data/profiles.json. src/loader.py normalizes loading and schema handling. Profiles may provide simple critical-product lists or vendor/product/version technology records, separating organisation context from public vulnerability data.
Matching and applicability
src/matcher.py determines whether each vulnerability applies to a profile: include, needs_verification, or exclude, retaining reasons rather than silently dropping uncertainty. src/aliases.py provides canonical product-name matching. src/version_match.py refines matches when installed versions and vulnerability ranges exist; unparseable or incomplete version evidence becomes verification-required instead of a guessed result.
Risk ranking
src/ranker.py converts applicable records into organisation-specific scores using CVSS, CISA KEV membership, EPSS probability, profile weight modifiers, and optional exposure/importance context. It penalizes uncertain matches and assigns priority bands. src/compare.py supports the “negative test”/comparison behavior that demonstrates why high-severity but irrelevant or lower-priority items were not selected.
Explainability and presentation
src/explainer.py turns ranked records into deterministic, sourced findings: priority, affected context, impact, next action, confidence, score factors, and source-row provenance. app.py renders these results and allows custom profiles, CSV replacement, live-data toggling, and optional AI wording. src/report.py is the report-oriented output boundary used by presentation/integration flows.
Optional external enrichment and AI
src/live_sources.py fetches and merges NVD, CISA KEV, and FIRST EPSS public feeds, with rate-limit pacing and a six-hour disk cache; failure falls back to cached or bundled data. src/llm_phraser.py is strictly cosmetic: it can restyle already-grounded explanations through Featherless or Groq, selected via API-key environment variables, and falls back to templates on failure.
Service, evaluation, and deployment
api.py exposes the pipeline as JSON for schedulers, ticketing, or chat integrations; app.py is the interactive runtime. src/evaluate.py evaluates profile scoring against practitioner rankings in data/gold_set.csv. Runtime dependencies are Python, Streamlit, and Uvicorn/FastAPI (requirements.txt); container deployment runs UI and API via Dockerfile and docker-compose.yml, including persisted live-data cache and health checks.
Main entry points: ranker.py Organisation Ranker · loader.py Data Loader · matcher.py Applicability Matcher · report.py Report Boundary
Components 18
Bundled Data
Offline-first vulnerability and organisation inputs.
- Vulnerability CSV
data/vulnerabilities.csv - Organisation Profiles · Risk weights plus product or vendor/product/version context.
data/profiles.json - Practitioner Gold Set
data/gold_set.csv
Triage Pipeline
Shared matching, ranking, comparison, and explanation flow.
- Data Loader · Loads and normalizes data schemas.
src/loader.py - Product Aliases
src/aliases.py - Version Matcher · Incomplete or unparseable evidence requires verification.
src/version_match.py - Applicability Matcher · Classifies records as include, needs verification, or exclude with reasons.
src/matcher.py - Organisation Ranker · Scores applicable records using CVSS, KEV, EPSS, profile weights, and context.
src/ranker.py - Selection Comparison · Explains why relevant alternatives were not selected.
src/compare.py - Grounded Explainer · Produces deterministic sourced findings and provenance.
src/explainer.py - Report Boundary
src/report.py - Scoring Evaluation · Compares profile scoring with practitioner rankings.
src/evaluate.py
Runtimes
Interactive and integration entry points.
- Operator UI · Supports custom profiles, CSV replacement, live data, and optional AI wording.
app.py - Triage API · POST /triage for scheduler, ticketing, and chat integrations.
api.py - Container Deployment · Runs UI and API with persisted cache and health checks.
Dockerfile - Service Composition
docker-compose.yml
Optional Enrichment
Network and cosmetic AI enhancements with safe fallbacks.
- Live Public Feeds · Merges NVD, CISA KEV, and FIRST EPSS with six-hour disk caching.
src/live_sources.py - AI Phraser · Restyles only grounded explanations; templates remain the fallback.
src/llm_phraser.py
Connections 19
- Vulnerability CSV → Data Loader: load
- Organisation Profiles → Data Loader: load
- Live Public Feeds → Data Loader: merge or fallback
- Data Loader → Applicability Matcher: normalized records and profiles
- Product Aliases → Applicability Matcher: canonical names
- Version Matcher → Applicability Matcher: version evidence
- Applicability Matcher → Organisation Ranker: applicable records and confidence
- Organisation Ranker → Selection Comparison: ranked candidates
- Organisation Ranker → Grounded Explainer: scores and priority bands
- Selection Comparison → Grounded Explainer: non-selection rationale
- Grounded Explainer → Report Boundary: grounded findings
- Report Boundary → Operator UI: render
- Report Boundary → Triage API: JSON response
- AI Phraser → Operator UI: optional restyling
- Practitioner Gold Set → Scoring Evaluation: practitioner rankings
- Organisation Ranker → Scoring Evaluation: scored results
- Container Deployment → Operator UI: runs
- Container Deployment → Triage API: runs
- Service Composition → Container Deployment: orchestrates