Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

14 Commits
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ›ก๏ธ ThreatCopilot โ€“ AI-Powered SOC Investigation Assistant

๐Ÿš€ ThreatCopilot is an AI-powered Security Operations Center (SOC) investigation platform that helps security analysts detect, investigate, and understand security threats through automated detection, MITRE ATT&CK mapping, evidence collection, and AI-assisted analysis.

Built using FastAPI, Elasticsearch, PostgreSQL, and React, ThreatCopilot provides an end-to-end workflow for threat detection and incident investigation.


โœจ Features

๐ŸŒ Network Monitoring

  • Capture live network connections
  • Collect endpoint network telemetry
  • Store events in Elasticsearch
  • Monitor network activity in real time

๐Ÿšจ Threat Detection Engine

  • Behavioral detection rules
  • High Connection Volume detection
  • Automated alert generation
  • Severity-based classification

๐Ÿ” Investigation Engine

  • Alert investigation workflow
  • MITRE ATT&CK mapping
  • Evidence collection
  • Automated threat summaries
  • Analyst recommendations

๐Ÿค– AI-Assisted Analysis

  • Threat explanation generation
  • Context-aware investigation summaries
  • Analyst-friendly incident insights
  • Investigation recommendations

๐Ÿ“Š Alert Management

  • PostgreSQL-backed alert storage
  • Investigation history tracking
  • Alert retrieval APIs
  • Investigation session management

๐Ÿ’ป SOC Dashboard

  • Interactive analyst terminal
  • Investigation history panel
  • Incident report generation
  • Modern cybersecurity-inspired UI

๐Ÿ—๏ธ Architecture

                     ๐ŸŒ Network Traffic
                              โ”‚
                              โ–ผ
                    ๐Ÿ“ก Network Monitor
                              โ”‚
                              โ–ผ
                    ๐Ÿ”Ž Elasticsearch
                              โ”‚
                              โ–ผ
                   ๐Ÿšจ Detection Engine
                              โ”‚
                              โ–ผ
                   ๐Ÿ—„๏ธ PostgreSQL Alerts
                              โ”‚
                              โ–ผ
                 ๐Ÿ•ต๏ธ Investigation Engine
                              โ”‚
            โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
            โ–ผ                 โ–ผ                 โ–ผ
     ๐Ÿ—บ๏ธ MITRE Mapper    ๐Ÿ“‘ Evidence      ๐Ÿค– AI Analysis
                           Collector
            โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                              โ–ผ
                  ๐Ÿ’ป ThreatCopilot Dashboard
                              โ”‚
                              โ–ผ
                    ๐Ÿ“„ SOC Incident Reports

๐Ÿ› ๏ธ Tech Stack

Backend โš™๏ธ

  • FastAPI
  • Python
  • Uvicorn

Databases ๐Ÿ—„๏ธ

  • PostgreSQL
  • Elasticsearch

Frontend ๐ŸŽจ

  • React
  • Vite
  • Tailwind CSS

Security ๐Ÿ”

  • MITRE ATT&CK Framework
  • Detection Engineering
  • Threat Investigation
  • Network Monitoring

๐Ÿ“‚ Project Structure

backend/
โ”‚
โ”œโ”€โ”€ app/
โ”‚   โ”œโ”€โ”€ auth/
โ”‚   โ”œโ”€โ”€ routes/
โ”‚   โ”‚   โ”œโ”€โ”€ auth.py
โ”‚   โ”‚   โ”œโ”€โ”€ history.py
โ”‚   โ”‚   โ”œโ”€โ”€ network.py
โ”‚   โ”‚   โ””โ”€โ”€ logs.py
โ”‚   โ”‚
โ”‚   โ”œโ”€โ”€ services/
โ”‚   โ”‚   โ”œโ”€โ”€ network_monitor.py
โ”‚   โ”‚   โ”œโ”€โ”€ detection_engine.py
โ”‚   โ”‚   โ”œโ”€โ”€ alert_service.py
โ”‚   โ”‚   โ”œโ”€โ”€ alert_analyzer.py
โ”‚   โ”‚   โ”œโ”€โ”€ evidence_collector.py
โ”‚   โ”‚   โ”œโ”€โ”€ mitre_mapper.py
โ”‚   โ”‚   โ”œโ”€โ”€ ai_investigator.py
โ”‚   โ”‚   โ””โ”€โ”€ report_generator.py
โ”‚   โ”‚
โ”‚   โ”œโ”€โ”€ schemas/
โ”‚   โ”œโ”€โ”€ db/
โ”‚   โ””โ”€โ”€ core/
โ”‚
โ””โ”€โ”€ frontend/
    โ”œโ”€โ”€ src/
    โ”‚   โ”œโ”€โ”€ components/
    โ”‚   โ”œโ”€โ”€ App.jsx
    โ”‚   โ””โ”€โ”€ main.jsx
    โ””โ”€โ”€ public/

๐Ÿ”„ Investigation Workflow

1๏ธโƒฃ Capture Network Activity

POST /network/capture

Collects live network connections and stores them in Elasticsearch.


2๏ธโƒฃ Analyze Network Activity

POST /network/analyze

Applies detection rules and generates security alerts.


3๏ธโƒฃ Retrieve Alerts

GET /network/alerts

Fetches alerts stored in PostgreSQL.


4๏ธโƒฃ Investigate an Alert

GET /network/investigate/{alert_id}

Performs:

โœ… Alert Retrieval โœ… MITRE ATT&CK Mapping โœ… Evidence Collection โœ… Threat Analysis โœ… Recommendation Generation

Example Response

{
  "alert_type": "High Connection Volume",
  "severity": "MEDIUM",
  "mitre_id": "T1046",
  "mitre_name": "Network Service Discovery",
  "tactic": "Discovery",
  "connection_count": 18,
  "summary": "Source IP 8.8.8.8 generated 18 network connections. This activity maps to MITRE ATT&CK T1046.",
  "recommendation": [
    "Review the owning process",
    "Check destination reputation",
    "Investigate related network activity"
  ]
}

๐Ÿ—บ๏ธ MITRE ATT&CK Integration

ThreatCopilot maps detected behaviors to MITRE ATT&CK techniques to provide investigation context.

Alert Type Technique Tactic
High Connection Volume T1046 โ€“ Network Service Discovery Discovery

๐Ÿš€ Getting Started

๐Ÿ“ฅ Clone Repository

git clone https://github.com/Mp771/siem-threat-copilot.git
cd siem-threat-copilot

โš™๏ธ Backend Setup

cd backend

python -m venv venv

# Windows
venv\Scripts\activate

pip install -r requirements.txt

uvicorn app.main:app --reload

Backend:

http://127.0.0.1:8000

Swagger API Docs:

http://127.0.0.1:8000/docs

๐ŸŽจ Frontend Setup

cd frontend

npm install

npm run dev

Frontend:

http://localhost:5173

๐Ÿ“ˆ Current Capabilities

โœ… Network Connection Monitoring โœ… Elasticsearch Integration โœ… Detection Engine โœ… Alert Generation โœ… PostgreSQL Alert Storage โœ… MITRE ATT&CK Mapping โœ… Evidence Collection โœ… Investigation Workflows โœ… Analyst Recommendations โœ… React Dashboard


๐Ÿ”ฎ Future Enhancements

  • ๐Ÿšจ Port Scan Detection
  • ๐Ÿ”‘ Brute Force Detection
  • ๐Ÿ“ก Beaconing Detection
  • ๐ŸŒ Threat Intelligence Enrichment
  • ๐Ÿฆ  VirusTotal Integration
  • ๐Ÿ›‘ AbuseIPDB Integration
  • โฑ๏ธ Timeline Reconstruction
  • ๐Ÿ“„ PDF Incident Reports
  • ๐Ÿ‘ฅ Role-Based Access Control (RBAC)
  • ๐Ÿง  LLM-Powered Threat Analysis

๐Ÿ‘จโ€๐Ÿ’ป Author

Mannat Pal

๐ŸŽฏ Cybersecurity Enthusiast ๐Ÿ›ก๏ธ SOC Analyst & Detection Engineering ๐Ÿ”ฌ Malware Analysis & Threat Hunting

๐Ÿ”— GitHub: https://github.com/Mp771


โญ If you found this project useful, consider giving it a star!

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages