Cybersecurity-Projects/PROJECTS/advanced/ai-threat-detection
CarterPerez-dev 7f35fbd839 feat: complete Phase 1 — rule-based detection pipeline, API, Docker E2E
Phase 1 delivers end-to-end threat detection from nginx log ingestion
through rule-based scoring to REST API and WebSocket alerts.

- API layer: /threats, /stats, /models/status, /ws/alerts, /health, /ready
- Alert dispatcher with Redis pub/sub + PostgreSQL persistence
- Typer CLI: vigil serve, config, health
- Integration tests (tailer -> pipeline -> DB round-trip)
- Docker E2E verified: dev.compose.yml stack with all services healthy
- Linting clean: ruff, mypy strict (0 issues), pylint 10/10
- 75 tests passing across 8 test modules
2026-02-18 13:02:10 -05:00
..
backend feat: complete Phase 1 — rule-based detection pipeline, API, Docker E2E 2026-02-18 13:02:10 -05:00
data/sample-logs feat: complete Phase 1 — rule-based detection pipeline, API, Docker E2E 2026-02-18 13:02:10 -05:00
infra feat: complete Phase 1 — rule-based detection pipeline, API, Docker E2E 2026-02-18 13:02:10 -05:00
.dockerignore feat: complete Phase 1 — rule-based detection pipeline, API, Docker E2E 2026-02-18 13:02:10 -05:00
.env.example checkpoint - phase 13 complete 2026-02-14 02:24:37 -05:00
.gitignore feat: complete Phase 1 — rule-based detection pipeline, API, Docker E2E 2026-02-18 13:02:10 -05:00
LICENSE checkpoint - phase 13 complete 2026-02-14 02:24:37 -05:00
README.md feat: complete Phase 1 — rule-based detection pipeline, API, Docker E2E 2026-02-18 13:02:10 -05:00
compose.yml checkpoint - phase 13 complete 2026-02-14 02:24:37 -05:00
dev.compose.yml feat: complete Phase 1 — rule-based detection pipeline, API, Docker E2E 2026-02-18 13:02:10 -05:00
justfile checkpoint - phase 13 complete 2026-02-14 02:24:37 -05:00

README.md

AngelusVigil

Status: IN PROGRESS — Phase 1 complete, Phase 2 (ML models) next

AI-powered threat detection engine that analyzes web server access logs using machine learning to classify HTTP traffic as benign or malicious in real-time.

Deploys as a Docker sidecar alongside any nginx-based infrastructure. Zero code changes to the monitored application.

Progress

Phase Description Status
Phase 1 Core pipeline, rule-based detection, API, Docker Complete
Phase 2 ML ensemble (autoencoder + RF + IF), ONNX inference Next
Phase 3 Production hardening, monitoring, retraining Planned
Phase 4 Dashboard, active learning, explainability Planned

Tech Stack

Layer Technology
API FastAPI (async)
ML PyTorch autoencoder + scikit-learn (RF + IF)
Inference ONNX Runtime (CPU)
Database PostgreSQL 18
Cache Redis 7.4
GeoIP MaxMind GeoLite2

Quick Start

docker compose -f dev.compose.yml up -d
curl http://localhost:36969/health

Architecture

3-model ensemble (autoencoder + Random Forest + Isolation Forest) scores each request through a weighted fusion producing a unified threat score [0.0, 1.0]:

  • HIGH (0.7+): Store + alert + block recommendation
  • MEDIUM (0.5-0.7): Store + monitor
  • LOW (<0.5): Log only

Currently running rule-based detection (ModSecurity CRS patterns) as cold-start fallback until ML models are trained in Phase 2.

See learn/ for detailed documentation.

License

AGPLv3 - See LICENSE