Skip to content

jmanhype/SecuStreamAI

Repository files navigation

SecuStreamAI

Security event processing pipeline built on Kafka, Redis, PostgreSQL, and FastAPI.

What It Does

Ingests security events from Kafka, classifies them using a 3-tier analysis approach, and stores results in PostgreSQL. A React frontend provides a dashboard.

Analysis Pipeline

Tier Method Purpose
1 Rule-based Fast deterministic matching for known patterns
2 PyTorch classifier Neural network for risk scoring and classification
3 DSPy-configured LLM Detailed analysis of complex or ambiguous events

The system picks the appropriate tier based on event characteristics. Nightly fine-tuning updates both the PyTorch model and DSPy configuration.

Stack

Component Technology
API FastAPI
Queue Kafka
Cache Redis
Database PostgreSQL + Alembic migrations
ML PyTorch, DSPy, LiteLLM
Monitoring Prometheus + Grafana
Auth JWT (python-jose)
Frontend React
Deployment Docker Compose

Project Structure

src/
  api/           # FastAPI routes and middleware
  models/        # SQLAlchemy + Pydantic models
  services/      # Kafka, Redis, Prometheus, analytics
  tasks/         # Nightly fine-tuning jobs
  utils/         # Caching, error handling, IP utils
frontend/        # React dashboard
docker/          # Dockerfiles and Compose config
alembic/         # Database migrations
tests/           # 17 test modules

Requirements

  • Docker 20.10+
  • Docker Compose 1.29+

Setup

git clone https://github.com/jmanhype/SecuStreamAI.git
cd SecuStreamAI
cp .env.example .env
# Edit .env with your OPENAI_API_KEY and other secrets
docker-compose -f docker/docker-compose.yaml up --build

Configuration

All configuration is via environment variables in .env. Key settings:

  • OPENAI_API_KEY -- required for tier-3 LLM analysis
  • KAFKA_SERVER, REDIS_HOST, POSTGRES_HOST -- infrastructure endpoints
  • SECRET_KEY -- JWT signing key

Status

Prototype. The CI/CD workflows exist but reference placeholder Docker Hub paths (yourusername/secustreamai). The React frontend is a default Create React App scaffold with minimal customization. Test coverage exists across 17 modules but actual pass rates are unknown.

License

See LICENSE file.

About

SecuStreamAI is a comprehensive security event processing system designed to generate, process, and analyze security events in real-time using Kafka, Redis, PostgreSQL, Prometheus, Grafana, and FastAPI.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors