A lightweight backend system for ingesting and analyzing security events using an event-driven architecture.
The system simulates a simplified security monitoring pipeline:
- Events are ingested via a REST API
- Stored in a PostgreSQL database
- Processed asynchronously by a worker service
- Detection logic evaluates events
- Alerts are generated for suspicious behavior
The system is designed using an event-driven approach to decouple ingestion from processing.
- API service handles incoming events
- Worker service processes events asynchronously
- Database stores both raw events and generated alerts
This separation allows the system to scale and keeps responsibilities isolated.
FastAPI, Pydantic, SQLAlchemy, PostgreSQL, Docker, pytest, GitHub Actions, Redis Message Broker
- Multiple
login_failureevents from the same IP → triggers brute-force alert login_successfollowing repeated failures → flagged as suspicious
POST /eventsGET /eventsGET /events/{id}
GET /alertsGET /alerts/{id}
docker compose --env-file .env up