A Security Information and Event Management (SIEM) platform for Central Reserve Police Force (CRPF) units — submitted for Smart India Hackathon (SIH). The system ingests Windows Event Logs from endpoint agents, normalizes them, runs correlation + MITRE ATT&CK–mapped detection rules, and surfaces alerts in a live React dashboard with role-based access control.
Demo / synthetic data only. All bundled log data and scenarios are generated locally. No real CRPF systems are touched.
┌────────────┐ HTTPS (x-agent-token) ┌────────────────────────────┐
│ agent/ │ ──── POST /api/logs/ │ backend/ │
│ Windows │ /ingest + heartbeat │ FastAPI · SQLAlchemy │
│ collector │ ◄──── 200 {accepted, │ │
│ (pywin32 │ parsed, alerts…} │ parse → normalize → detect │
│ /sim) │ │ (correlation, MITRE) │
└────────────┘ │ SSE /api/stream/live │
▲ local JSONL spool └─────────────┬──────────────┘
│ (survives outages) │
┌────────────┐ ┌─────────────▼──────────────┐
│ agent │ │ frontend/ │
│ spool │ │ Next.js 15 · TanStack Query│
└────────────┘ │ Recharts · live event feed │
└────────────────────────────┘
- Collect —
agent/collector/windows.pyreads Security/System/Application channels via the native Event Log API (win32evtlog). On non-Windows dev boxes a simulated reader emits realistic synthetic events. - Normalize —
agent/parser/windows.pymaps raw records (XML/dict) into a compactIngestItem(event_id, provider, host, user, data, raw_xml). - Buffer —
agent/spool/spool.pypersists normalized events as JSONL so nothing is lost while the server is unreachable. - Ship —
agent/transport/api.pydrains the spool inmax_batchchunks toPOST /api/logs/ingest(auth:x-agent-token), retrying with exponential backoff; periodic heartbeats keep the agentonline. - Parse & Normalize —
backend/app/parsers/→backend/app/normalization/extract host, user, source IP, process, command line, etc. - Detect —
backend/app/detection/runs enabled rules (event filters, conditions, correlation windows) and IOC matches (detection/ioc.py) against the IOC library, raising alerts with risk scores and MITRE mapping. - Notify — alerts and events stream over Server-Sent Events to the
frontend (
/api/stream/live) and become dashboard notifications. - Investigate — open alerts can be grouped into incidents
(
/incidents) with a triage → investigate → escalate → resolve → close workflow, linked alert/event timelines and investigation notes.
Requires Python 3.10+ and Node 18+.
# 1) Backend (SQLite by default)
cd backend
cp .env.example .env
pip install -r requirements.txt
python -m app.seed.seed_all # tables + roles + admin + demo data + rules
uvicorn app.main:app --reload --port 8000
# 2) Frontend
cd frontend
npm install
npm run dev # http://localhost:3000
# 3) Agent (simulated events; works on any OS)
cd agent
pip install -r requirements.txt
# register an agent in the web UI (Agents → Register) and copy its token:
SENTINEL_API_TOKEN=<token> python -m main --simulateOr with the Makefile:
make backend # uvicorn on :8000
make frontend # Next.js on :3000
make seed # seed demo data + rules
make agent # simulated agent (needs AGENT_API_TOKEN=...)| Role | Username | Password |
|---|---|---|
| Super admin | admin |
Sentinel@123 |
| Security expert | analyst |
Analyst@123 |
make seed, then openhttp://localhost:3000/dashboard.- Register a demo agent (Agents → Register) and run
make agent AGENT_API_TOKEN=<token>. - Watch the Live Events feed populate as the simulated agent ships events.
- Open Demo Lab (
/demo) and run an attack scenario (e.g. Brute Force, Privilege Escalation, Credential Dumping, Lateral Movement, Ransomware) — synthetic events stream in and alerts fire. - Triage alerts in Alerts, correlate with Logs, and export Reports.
- Open Incidents (
/incidents) — seeded demo incidents group related alerts with notes and event timelines; drive the workflow to closed. - Open IOC Library (
/ioc-library) — indicators are matched against inbound events during detection (try203.0.113.14from the brute-force scenario); MITRE ATT&CK (/mitre) shows technique coverage. - Use Search (
/search) for a global lookup across events, alerts, incidents, rules, IOCs, agents and units.
Backend (.env, see backend/.env.example):
| Variable | Default | Notes |
|---|---|---|
DATABASE_URL |
Postgres (docker) | use sqlite:///./sentinel.db |
JWT_SECRET |
change-me… | long random secret |
SEED_DEMO_DATA |
true |
seed demo units/agents/logs |
SEED_ADMIN_USERNAME |
admin |
seeded super-admin |
SEED_ADMIN_PASSWORD |
Sentinel@123 |
seeded password |
Agent (SENTINEL_* env vars override agent/config/agent.yaml):
| Variable | Default | Notes |
|---|---|---|
SENTINEL_SERVER_URL |
http://localhost:8000 |
backend base URL |
SENTINEL_API_TOKEN |
(empty) | from agent registration (x-agent-token) |
SENTINEL_AGENT_ID |
WIN-AGT-0001 |
must match the registered agent |
SENTINEL_SIMULATE |
true |
fake events for dev/demo |
SENTINEL_CHANNELS |
Security,System,App | Windows channels to read |
SENTINEL_POLL_INTERVAL_SECONDS |
5 |
collect/flush cadence |
SENTINEL_MAX_BATCH |
200 |
events per ingest request (≤2000) |
SENTINEL_SPOOL_DIR |
spool |
offline JSONL buffer |
Permissions are enforced server-side in backend/app/core/deps.py.
| Role | Can do |
|---|---|
super_admin |
everything incl. users, units, settings, audit, IOCs |
security_expert |
logs, alerts (manage), rules (manage), incidents, IOC view, agents view, reports, demo |
unit_admin |
dashboard, logs, alerts, agents/units view, reports (unit-scoped) |
- Stateless backend — multiple uvicorn workers behind a load balancer; detection correlation uses the DB with bounded time windows.
- Agent spooling — the on-disk JSONL spool absorbs disconnects; ingests
are batched (≤2000 events) and rate-limited (
RATE_LIMIT_INGEST_PER_MINUTE). - Live feed — SSE fan-out in
backend/app/websocket/for real-time alerts; swap to Redis pub/sub for multi-worker deploys. - Postgres —
docker compose up -druns Postgres + backend + frontend; swapDATABASE_URLfor a managed instance.
agent/ # endpoint collector (Windows Event Log → HTTPS ingest)
collector/ # win32evtlog reader + simulator
parser/ # normalization to IngestItem
spool/ # persistent offline JSONL buffer
transport/ # batched ingest + heartbeat (retry/backoff)
config/ # settings + agent.yaml
backend/ # FastAPI SIEM engine
app/models/ # units, agents, logs, events, rules, alerts,
# incidents, iocs, audit, notifications
app/detection/ # rule engine, correlation, IOC matching, MITRE map
app/api/routes/ # auth, logs, alerts, incidents, ioc, mitre,
# analytics, assets, search, agents, units, users,
# rules, reports, audit, demo, stats, stream
app/seed/ # roles, units, agents, demo data, rules, SOC seed
frontend/ # Next.js 15 dashboard
app/(dashboard) # dashboard, live-events, logs, alerts, incidents,
# rules, threat-intel, ioc-library, mitre, correlations,
# search, threat-analytics, assets, units, agents,
# users, reports, audit-logs, settings, demo