Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

57 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Platform Python Flask License

πŸ›‘οΈ tinySIEM

A lightweight, real-time Sysmon event monitor and web dashboard for Windows.

tinySIEM reads from the Windows Event Log (Microsoft-Windows-Sysmon/Operational), streams events via Server-Sent Events to a modern browser-based dashboard, and lets you filter, search, and analyze system activity in real time.


✨ Features

Feature Description
Real-time Streaming Events are pushed to the browser via SSE β€” no polling, no refresh needed.
Interactive Event Table Sortable, paginated table with per-column filters for Event ID, Process, User, and Event Info.
Event Volume Chart Live Chart.js visualization of event frequency over time.
Global Search Full-text filter across all event fields.
Dark / Light Mode Toggle between themes with system preference detection.
Quick Start Modal Configure how much history to load β€” by event count or timeframe.
Restart Monitor Reconfigure and restart the monitor without reloading the page.
One-Click Launch run.ps1 handles admin elevation, venv creation, dependency install, and browser launch.

πŸ“‹ Prerequisites

  • Windows 10 / 11 / Server β€” relies on the Windows Event Log API.
  • Sysmon installed and running.
  • Python 3.8+ β€” installed and available in your PATH.
  • Administrator Privileges β€” required to read the Sysmon event channel.

πŸš€ Quick Start

# Clone the repository
git clone https://github.com/yourusername/tinysiem.git
cd tinysiem

# Run the app (handles everything automatically)
.\run.ps1

That's it. The script will:

  1. ⬆️ Request Administrator privileges (UAC prompt)
  2. πŸ“¦ Create a Python virtual environment if one doesn't exist
  3. πŸ“₯ Install dependencies from requirements.txt
  4. 🌐 Launch the Flask server on http://localhost:5000
  5. πŸ–₯️ Open your default browser after 5 seconds

Tip

On subsequent runs, the venv is reused β€” startup is near-instant.


πŸ–₯️ Usage

  1. Start Monitoring β€” when the app launches, a Quick Start modal lets you choose:

    • Event Count β€” load the last N events (default: 500)
    • Timeframe β€” load events from the last N minutes/hours/days (e.g. 30m, 2h, 1d)
  2. Filter Events β€” click the ⏷ filter icon on any column header to filter by specific values, or use the Global Filter search box in the top bar.

  3. Toggle Live Mode β€” use the Live toggle in the nav bar to pause/resume the real-time event stream.

  4. Chart β€” toggle the event volume chart on/off with the Chart switch.

  5. Restart β€” click Restart to reconfigure the monitor (change count/timeframe) without a full page reload.


πŸ—οΈ Architecture

tinySIEM
β”œβ”€β”€ server/                # Python backend package
β”‚   β”œβ”€β”€ __init__.py        # Flask app factory
β”‚   β”œβ”€β”€ __main__.py        # Entry point (python -m server)
β”‚   β”œβ”€β”€ config.py          # App configuration constants
β”‚   β”œβ”€β”€ monitor.py         # Sysmon event reader & subscriber (win32evtlog)
β”‚   β”œβ”€β”€ event_parser.py    # XML β†’ dict event parser
β”‚   β”œβ”€β”€ client_manager.py  # SSE client manager with broadcast & history buffer
β”‚   β”œβ”€β”€ routes.py          # Flask routes (Blueprint)
β”‚   └── utils.py           # Admin privilege check utilities
β”œβ”€β”€ run.ps1                # One-click launcher (elevation + venv + deps)
β”œβ”€β”€ requirements.txt       # Runtime dependencies (Flask, pywin32)
β”œβ”€β”€ requirements-dev.txt   # Build tool dependencies
β”œβ”€β”€ templates/
β”‚   └── index.html         # Dashboard SPA (Tailwind CSS + Chart.js)
└── static/
    β”œβ”€β”€ css/style.css      # Custom styles
    β”œβ”€β”€ js/                # Modular frontend (app, chart, constants, events, filters, table, tooltip, startup, stats, processtree, utils)
    └── lib/               # Vendored libraries (Tailwind, Chart.js, D3.js, Font Awesome, Google Fonts)

Data Flow

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Windows Event Log                                                         β”‚
β”‚  Microsoft-Windows-Sysmon/Operational                                      β”‚
└──────────────┬───────────────────────────────────┬───────────────────────── β”˜
               β”‚ Historical events                 β”‚ New events (subscription)
               β”‚ (EvtQuery + EvtNext)              β”‚ (EvtSubscribe callback)
               β–Ό                                   β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  SysmonMonitor  (monitor.py)                                               β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                   β”‚
β”‚  β”‚  read_past_events() β”‚    β”‚  _on_event() callback    β”‚                   β”‚
β”‚  β”‚  (count / timeframe)β”‚    β”‚  (real-time push)        β”‚                   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                   β”‚
β”‚            β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                                 β”‚
β”‚                           β–Ό                                                β”‚
β”‚              β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                                    β”‚
β”‚              β”‚  EventParser.parse()   β”‚                                    β”‚
β”‚              β”‚  XML ──► Python dict   β”‚                                    β”‚
β”‚              β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                                    β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                            β–Ό
               β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
               β”‚  Thread-Safe Queue     β”‚
               β”‚  (maxsize=5000)        β”‚
               β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                            β”‚
                            β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Distributor Thread  (app.py)                                              β”‚
β”‚  Moves events from queue ──► ClientManager                                 β”‚
└───────────────────────────┬──────────────────────────────────────────────── β”˜
                            β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  ClientManager  (socket_service.py)                                        β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”       β”‚
β”‚  β”‚  History Buffer   β”‚    β”‚  Broadcast to connected clients        β”‚       β”‚
β”‚  β”‚  (deque, last 500)β”‚    β”‚                                        β”‚       β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β”‚  Client 1 Queue ──► SSE /stream ──► 🌐 β”‚       β”‚
β”‚                          β”‚  Client 2 Queue ──► SSE /stream ──► 🌐 β”‚       β”‚
β”‚                          β”‚  Client N Queue ──► SSE /stream ──► 🌐 β”‚       β”‚
β”‚                          β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜       β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                            β”‚
                            β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Browser Dashboard  (index.html + JS modules)                              β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  β”‚ EventSrc β”‚  β”‚ Event Table  β”‚  β”‚ Chart.js β”‚  β”‚ Filters / Search      β”‚  β”‚
β”‚  β”‚ listener │─►│ (paginated)  β”‚  β”‚ (volume) β”‚  β”‚ (ID, Process, User…)  β”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
  1. SysmonMonitor reads historical events and subscribes to new ones via win32evtlog.
  2. Parsed events are placed into a thread-safe queue.
  3. A distributor thread moves events from the queue to ClientManager.
  4. ClientManager broadcasts to all connected SSE clients and maintains a history ring buffer so new clients receive recent events immediately.

βš™οΈ Configuration

Edit config.py to adjust defaults:

class Config:
    LOG_TYPE = 'Microsoft-Windows-Sysmon/Operational'  # Event channel
    HISTORY_SIZE = 500          # Events kept in memory for new clients
    MONITOR_QUEUE_SIZE = 5000   # Internal queue capacity
    DEBUG = True                # Flask debug mode
    HOST = '0.0.0.0'           # Listen on all interfaces
    PORT = 5000                 # Web server port

πŸ› οΈ Development

# Manual setup (if not using run.ps1)
python -m venv venv
.\venv\Scripts\Activate
pip install -r requirements.txt

# Run with auto-reload disabled (required for threading)
python -m server

Note

The Flask reloader is intentionally disabled (use_reloader=False) because the app uses background threads for event monitoring. Hot-reload would restart those threads unexpectedly.


πŸ“¦ Building a Standalone Executable

The project includes build scripts for packaging as a standalone .exe:

Script Tool
build_pyinstaller.ps1 PyInstaller
build_nuitka.ps1 Nuitka
build_cx.ps1 cx_Freeze

πŸ› Troubleshooting

Problem Solution
UAC prompt denied Right-click run.ps1 β†’ Run with PowerShell, then accept the elevation prompt.
"Python is not installed or not in PATH" Install Python 3.8+ and ensure Add to PATH is checked.
"App script not found" Make sure you're running run.ps1 from the project root directory.
No events appear Verify Sysmon is installed and running: sc query Sysmon or sc query Sysmon64.
Port 5000 already in use Change PORT in config.py or stop the other process using port 5000.
pip install fails with connection error Check your internet connection. A firewall or proxy may be blocking PyPI.

πŸ“„ License

This project is licensed under the MIT License.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages