How sachinkumar-a/edith-vulnerability-triage works
Purpose and entry points
Offline personalized vulnerability triage: it filters bundled CVE-product records against an organization profile, assigns action bands, orders results, and explains five recommended decisions. Primary entry points are CLI (cli.py), Streamlit UI (app.py), and an HTTP API (api/main.py); all should converge on the core engine.
Core domain normalization
Internal domain models normalize both the shipped compact schema and the Appendix-A-style schema, preserving missing fields rather than inventing defaults. Data loading reads vulnerability rows, profiles, aliases, and optional richer version metadata.
• src/models.py
• src/loader.py
• vulnerabilities.csv
Matching and inclusion boundary
Matching is the principal relevance gate. Product names are normalized and aliases resolve genuinely different names; undeclared products remain visible as excluded records. For declared products, version evaluation yields included/high-confidence, included/needs-verification, or excluded/not-affected. This boundary prevents non-profile records from entering prioritization.
• src/matcher.py
• aliases.json
• profiles.json
Triage decision and ordering
The scorer first assigns an SSVC-inspired action band—ACT, ATTEND, or TRACK—from exploitation, declared criticality, exposure where supplied, and severity. A separate weighted score orders records only within their band, using CVSS, KEV, EPSS, profile weights, and a critical-product multiplier. Risk appetite changes EPSS and CVSS thresholds.
• src/scorer.py
• src/engine.py
• gold_set.csv
Orchestration and report assembly
The engine coordinates loading-compatible records, deduplicates by CVE/product, evaluates match status, partitions included versus excluded items, ranks included decisions, and limits the visible recommendation set. It produces structured result data consumed by each presentation layer rather than embedding UI logic.
• src/engine.py
• src/models.py
• src/explainer.py
Explainability and traceability
Explanation generation turns structured decisions into plain-language titles, contributing factors, impacts, permitted safe next steps, confidence reasons, and source-row traceability. Since the shipped pack lacks descriptions and full provenance/version columns, explanations must explicitly preserve those limitations.
• src/explainer.py
• vulnerabilities.csv
• profile_d_sample.json
Presentation and service surfaces
The CLI is the baseline operational interface for profile listing, triage, comparison, negative tests, and rules display. Streamlit is a rendering-only demo over the same engine. A separate backend API and Vite/React frontend provide a web-oriented integration surface, with request code isolated in the frontend API module.
• cli.py
• app.py
• api/main.py
• web/src/api.js
• web/src/App.jsx
Runtime and infrastructure
Python runs fully offline with standard-library core execution; Streamlit is the only declared runtime dependency for the visual demo. The React/Vite frontend uses Node tooling. There is no database, network feed, API key, or external service dependency; all authoritative inputs are bundled files.
• requirements.txt
• web/package.json
• run.py
Main entry points: engine.py Triage engine · loader.py Data loader · scorer.py Decision scorer · explainer.py Decision explainer
Components 19
Bundled inputs
Offline authoritative data pack.
- Vulnerability records
vulnerabilities.csv - Organization profiles
profiles.json - Product aliases
aliases.json - Sample profile · Illustrates source-data limitations used in explanations.
profile_d_sample.json - Gold set
gold_set.csv
Core triage engine
Shared decision pipeline.
- Domain models · Normalizes compact and Appendix-A-style records while preserving missing fields.
src/models.py - Data loader · Loads records, profiles, aliases, and optional version metadata.
src/loader.py - Profile matcher · Resolves names and versions into included, verification, or excluded status.
src/matcher.py - Decision scorer · Assigns action bands and ranks only within each band.
src/scorer.py - Decision explainer · Builds recommendations, confidence reasons, limitations, and source-row traceability.
src/explainer.py - Triage engine · Deduplicates, gates, ranks, and limits structured recommendations.
src/engine.py
Presentation surfaces
All interfaces converge on the engine.
- CLI · Baseline interface for triage, comparisons, negative tests, and rules.
cli.py - Streamlit demo · Rendering-only view over the shared engine.
app.py - Offline Python runtime · Standard-library core; Streamlit is the visual-demo dependency.
requirements.txt - Runtime launcher
run.py
Web integration
Separate API and React client.
- HTTP API
api/main.py - Frontend API client · Isolates browser request code.
web/src/api.js - React/Vite frontend
web/src/App.jsx - Node frontend tooling
web/package.json
Connections 22
- Vulnerability records → Data loader: loads
- Organization profiles → Data loader: loads
- Product aliases → Data loader: loads
- Domain models → Data loader: normalizes
- Data loader → Triage engine: compatible records
- Domain models → Triage engine: structured records
- Triage engine → Profile matcher: evaluates profile relevance
- Profile matcher → Triage engine: inclusion status
- Triage engine → Decision scorer: included records
- Decision scorer → Triage engine: band and within-band rank
- Triage engine → Decision explainer: structured decisions
- Decision explainer → Triage engine: explanations and traceability
- Sample profile → Decision explainer: data limitations
- Gold set → Decision scorer: decision reference
- CLI → Triage engine: triage commands
- Streamlit demo → Triage engine: renders results
- HTTP API → Triage engine: triage requests
- React/Vite frontend → Frontend API client: uses
- Frontend API client → HTTP API: HTTP requests
- Runtime launcher → CLI: launches
- Offline Python runtime → Streamlit demo: supports
- Node frontend tooling → React/Vite frontend: builds and runs