Case Study — Spatial-temporal threat intelligence with GNNs & Transformers

ThreatGraph

A real-time cybersecurity threat detection and automated incident response platform on AWS EC2, streaming 10,000+ network flows/sec via Kafka through hybrid Temporal GNN + Transformer models (0.91 F1-score) with interactive 3D Force-Graph attack topologies and RAG-driven MITRE ATT&CK runbooks.

threatgraph.duckdns.org
Screenshot of ThreatGraph
PythonPyTorchGNNsFastAPIKafkaPostgreSQLNetworkXFAISSAWS EC2React
01

Overview

ThreatGraph is an enterprise-scale threat intelligence and automated incident response system deployed on AWS EC2. It combines high-throughput Kafka streaming with hybrid Temporal Graph Neural Networks (GNNs) and Transformers to detect stealthy lateral movement across network hosts with sub-second latency.

02

The Problem

Traditional Security Information and Event Management (SIEM) tools evaluate incoming log entries as isolated tabular events. They frequently miss sophisticated advanced persistent threats (APTs) that execute low-and-slow lateral movement across distributed enterprise subnets.

03

My Contribution

Engineered an end-to-end telemetry pipeline processing 10k+ network flows/sec via Kafka on AWS EC2. Developed a spatial-temporal GNN model achieving a 0.91 F1-score on imbalanced attack datasets and integrated a RAG-powered MITRE ATT&CK SOC analyst agent for automated host containment.

04

Architecture

Spatial-Temporal GNN + Transformer Engine

Constructs dynamic temporal graphs where nodes represent IP addresses/ports and directed edges encode network flows. Combines Graph Convolutional Networks (GCNs) with self-attention to capture multi-hop lateral movement patterns.

High-Throughput Kafka Stream Pipeline

Consumes 10,000+ network flow records per second from distributed sensors on AWS EC2, dispatching batched subgraphs to FastAPI inference workers with sub-second response times.

RAG MITRE ATT&CK Analyst

Embeds MITRE ATT&CK enterprise techniques into FAISS vector storage. When an anomalous graph pattern is detected, the LLM agent retrieves relevant tactics, techniques, and remediation procedures.

3D Force-Graph Topology & Containment

Visualizes enterprise network graphs in real time. Security operators can inspect compromise trajectories and trigger automated Zero-Trust host isolation via firewall API triggers.

05

Engineering Decisions & Tradeoffs

Graph Neural Networks over traditional tabular tree models

Rationale: Tabular classifiers miss relational topology across connected hosts. GNNs aggregate contextual neighbor embeddings across multiple network hops to surface coordinated intrusions.

Tradeoff: Higher computational footprint during dynamic subgraph construction compared to tabular inference.

Zero-Trust automated host micro-isolation

Rationale: Human SOC response times average several hours, during which ransomware spreads laterally. Automated quarantine upon high-confidence detection halts spread in milliseconds.

Tradeoff: Requires stringent precision thresholds (PR-AUC 92%) to avoid accidental disruption of legitimate enterprise operations.

06

Challenges & Solutions

Challenge

Handling severe class imbalance in intrusion datasets (<0.1% attacks)

Solution

Utilized focal loss optimization and dynamic temporal subgraph sampling to ensure the model learned distinct anomaly representations without false-alarm saturation.

Challenge

Sub-second graph update latency under 10k flows/sec

Solution

Maintained incremental sliding-window neighborhood buffers in Redis rather than re-computing global topology matrices on every packet.

07

Evidence & Results

  • ›10,000+ network flows per second sustained throughput on AWS EC2
  • ›0.91 F1-Score and 92% PR-AUC on benchmark intrusion scenarios
  • ›Sub-second alert dispatch with RAG MITRE ATT&CK incident runbooks
  • ›Live deployment running at http://threatgraph.duckdns.org/
All Projects View Repository Live Demo