πŸ›‘οΈ

ThreatGraph

AI-powered cybersecurity analyst β€” maps your attack surface using MITRE ATT&CK knowledge graphs, real-time CVE correlation, and agentic reasoning

🧠 LangGraph Agent πŸ“Š SurrealDB KG πŸ”— MITRE ATT&CK ⚑ NVD / CISA KEV πŸ›‘οΈ Real-Time Analysis
Get Started β†’ View on GitHub
1,854
Knowledge Graph Nodes
20,377
Graph Edges
691
ATT&CK Techniques
172
Threat Groups
116
CVEs Correlated
52
Tests Passing
// capabilities

Features

🧠

AI Security Analyst

LangGraph multi-step agent classifies your question, queries the knowledge graph, synthesizes threat assessments, and generates remediation playbooks with Sigma detection rules.

πŸ”—

Attack Path Discovery

Maps complete attack chains: asset β†’ software β†’ CVE β†’ technique β†’ threat group. Identifies which hacker groups can reach your servers through known vulnerabilities.

πŸ“Š

Exposure Scoring

Computes risk scores per asset using CVSS severity, asset criticality multipliers, and CISA KEV bonus for actively exploited vulnerabilities.

βš”οΈ

MITRE ATT&CK Matrix

Full kill chain visualization with 14 tactics, 691+ techniques, top threat groups, and most commonly used attack software β€” mapped to your infrastructure.

πŸ›‘οΈ

Coverage Gap Analysis

Identifies unmitigated ATT&CK techniques by checking which techniques lack corresponding MITRE mitigations in your defense posture.

πŸ’»

Codebase Awareness

Scans your codebase for dependencies (requirements.txt, package.json), maps them to software versions in the KG, and identifies vulnerable code paths.

// system design

3-Layer Knowledge Graph

ThreatGraph connects threat intelligence to your actual infrastructure through a multi-layer SurrealDB knowledge graph.

L1
Threat Intel
691 techniques, 14 tactics, 172 threat groups, 680+ malware/tools, 43 mitigations β€” from MITRE ATT&CK STIX 2.1
L2
Asset Inventory
Your servers, their software versions, CPE identifiers β†’ NVD API β†’ CVEs with CVSS scores + CISA KEV active exploitation flags
L3
Code Awareness
Codebase files, imports, dependencies β†’ cross-referenced with software versions to identify vulnerable code paths

Graph Traversal Example

-- Find every CVE affecting your web server
SELECT hostname,
  ->runs->software_version.name AS software,
  ->runs->software_version->has_cve->cve.cve_id AS cves,
  ->runs->software_version->has_cve->cve.cvss_score AS scores
FROM asset WHERE hostname = 'web-server-01';
// getting started

Quickstart

1

Install SurrealDB

curl -sSf https://install.surrealdb.com | sh
2

Start the Database

surreal start --user root --pass root --bind 0.0.0.0:8000 memory
3

Clone & Install

git clone https://github.com/fcistud/ThreatGraph.git
cd langchain
pip install -r requirements.txt
4

Configure API Keys

# Edit .env with your keys
ANTHROPIC_API_KEY=sk-ant-...
NVD_API_KEY=your-nvd-key
LANGSMITH_API_KEY=lsv2_pt_...
5

Load Knowledge Graph

python3 ingest.py # ~60s β€” loads 1,854 nodes + 20,377 edges
6

Launch Dashboard

streamlit run app.py # β†’ http://localhost:8501
// dashboard

8 Analysis Modules

Tab Module Description
πŸ” Analyst AI Security Analyst Natural language queries β†’ classified β†’ KG traversal β†’ Claude synthesis β†’ remediation playbook
πŸ“Š Exposure Exposure Dashboard Risk scores per asset with CVSS severity bars, KEV indicators, and total org score
πŸ”— Attack Graph Interactive Visualization pyvis/NetworkX graph: 161 nodes, 156 edges with legend, stats overlay, CVSS-scaled nodes
πŸ–₯️ Asset Intel Asset Deep Dive Per-asset profiles with software inventory, CVE tables, CVSS distribution charts
βš”οΈ ATT&CK Matrix Kill Chain Heatmap 14 tactic cards, top threat groups (Kimsuky: 109 techniques), attack software rankings
πŸ›‘οΈ Gaps Coverage Analysis Unmitigated ATT&CK techniques identified via reverse mitigation traversal
πŸ’» Code Codebase Scanner Dependency analysis β†’ cross-reference with KG software β†’ vulnerability mapping
πŸ“š Guide Tutorial & Glossary Architecture overview, step-by-step tutorial, cybersecurity glossary for beginners
// api reference

Core Functions

get_attack_paths()

Traverses asset→runs→software_version→has_cve→cve to discover complete attack chains. Filter by hostname.

compute_exposure_score()

Calculates risk: (Ξ£CVSS Γ— criticality_mult) + (KEV_count Γ— 20). Returns sorted assets with scores.

get_coverage_gaps()

Finds unmitigated techniques via ←mitigates←mitigation reverse traversal. Returns top 50 gaps.

search_kg()

Fuzzy semantic search with keyword expansion. Queries like "privilege escalation" expand to related terms across all tables.

get_cve_blast_radius()

For a given CVE, finds all affected software versions, all assets running that software, and their criticality.

run_query()

Full agent pipeline: classify β†’ query KG β†’ synthesize with Claude β†’ generate playbook with Sigma rules.

// technology

Tech Stack

πŸ“Š

SurrealDB

Multi-model database for graph + document storage

🧠

LangGraph

Stateful multi-step agent orchestration

πŸ€–

Claude / GPT-4o

LLM synthesis and playbook generation

🎨

Streamlit

Dashboard with neon-on-dark cyberpunk HUD

πŸ”—

pyvis / NetworkX

Interactive attack graph visualization

πŸ“‘

NVD + CISA KEV

Real-time vulnerability and exploitation data