Overview
WinLogGuard is a log-based IDS/IPS for Windows. It reads Windows Event Viewer (Security, RDP, OpenSSH, SQL, PowerShell, WinRM, Defender) and text log files (nginx, Apache, IIS, OpenVPN, hMailServer, custom regex), counts failed access attempts per source IP and, when a rule threshold is exceeded within the time window, bans the attacker with the Windows Firewall — the way fail2ban does on Linux, natively and without drivers.
Everything runs as a single self-contained Windows service: no .NET runtime to install, no external database, no kernel driver. Bans are persisted in SQLite and re-applied at boot, the configuration is one YAML file with hot reload, and the built-in WebUI gives you a live dashboard, event history and full management without editing files.
System requirements
WinLogGuard is designed for Windows servers and desktops with zero external dependencies.
- Windows 10/11 or Windows Server 2016 or later (x64)
- Administrator privileges for the service (firewall rules + Security event log)
- TCP port 8443 for the WebUI/REST API (optional: open it in Windows Firewall for remote access)
- About 60 MB of disk for the executable plus logs and database
Installation
The recommended path is the graphical installer: run WinLogGuard-Setup-.exe, follow the wizard, and the service is created and started. On first install the configuration is generated with a random 64-hex API token, an inbound firewall rule for the WebUI/API port can be opened, and a desktop shortcut to the WebUI is optional.
Your data in C:\ProgramData\WinLogGuard (config, database, logs) are preserved across upgrades and uninstalls; the purge is offered only as an explicit confirmation in the interactive uninstaller. For automated deployments the installer supports silent mode, and a PowerShell script is available as an alternative.
- Graphical installer: WinLogGuard-Setup-.exe (wizard, task options for service/API rule/shortcut)
- Silent install: WinLogGuard-Setup-.exe /SILENT /NORESTART /LOG=setup.log
- PowerShell alternative: scripts\install.ps1 (as Administrator, creates service with recovery actions)
- Validate a configuration file before deploying: WinLogGuard.Service.exe --validate --config
Quick start
Right after the install, the service is running with the rdp-bruteforce preset: it watches the Security event log (failed logons 4625) and RDP-specific channels, and bans an IP after 5 failed attempts within 5 minutes for 24 hours.
Open the WebUI at http://localhost:8443, authenticate with the admin user you create at first login and you will see the live dashboard: bans, events, source status and configuration. The API token is in the YAML config if you prefer scripting.
- WebUI: http://localhost:8443 (login + live dashboard)
- CLI status check: wlg status (alias installed with the service)
- Manual ban/unban: wlg ban --bantime 1h --reason test, then wlg unban
- Config hot-reload after manual edits: wlg reload
Log sources
Sources are declared in the YAML config and are of two kinds: Event Viewer channels (eventlog) and text log files (file). Event-log sources use built-in presets that know channel, XPath filter and how to extract the attacker IP (and the targeted account).
- eventlog presets: rdp-bruteforce, openssh, sqlserver, defender, winrm, powershell
- file presets: nginx, apache, iis, iis-ftp, openvpn, hmailserver and custom formats via named-group regex
- Each source has a live status in the WebUI (Sources page) and persisted cursors: on restart, reading resumes where it stopped
Rules and bans
A rule binds a source to a threshold: N events within a time window (findtime) per source IP, with a ban duration (bantime) and an action (ban or dry-run for observation-only mode). Defaults can be set once and overridden per rule.
Repeat offenders can be escalated: bantime_factor multiplies the ban at each recurrence (e.g. 1h, 2h, 4h...), bantime_max caps it, bantime_permanent_after makes the Nth ban permanent and bantime_reset_after resets the counter after a quiet period. A whitelist of IPs/CIDRs is always protected from banning.
- threshold / findtime / bantime per rule, with defaults
- bantime_factor, bantime_max, bantime_permanent_after, bantime_reset_after (recidiva escalation)
- ban_countries: ['CN','RU'] — ban entire countries via GeoIP (Pro-style country filter)
- whitelist: never-banned IPs/CIDRs (e.g. 127.0.0.1, 10.0.0.0/8, your management IPs)
WebUI
The bundled WebUI (no separate install) covers the whole product: live dashboard with KPIs and country bars, event and ban history with filters and CSV/JSON export, rules, sources with samples and parser preview, whitelist, notifications, GeoIP, Cloudflare, SIEM integrations, users with admin/viewer roles, and the license page.
Authentication is token-based for scripts and username/password for humans; sessions expire and failed attempts trigger lockout. Multi-user roles are available in the Pro edition.
REST API
The service exposes a REST API on port 8443 (Bearer token from the config) plus a live feed (SSE). Everything you can do in the WebUI is scriptable.
- GET /api/health — status, version, active bans, backend, GeoIP state, metrics
- GET/POST/DELETE /api/bans — list, manual ban, manual unban
- GET /api/events, /api/events/summary, /api/events/export — history, aggregates, CSV/JSON
- GET /api/events/stream — live SSE feed
- GET/PUT /api/config, POST /api/config/reload — read, edit and hot-reload configuration
- GET/PUT /api/notifications, /api/geoip, /api/cloudflare, /api/integrations, /api/license
- GET /api/metrics — Prometheus metrics (wlg_*)
Notifications and reports
Every ban can trigger notifications on multiple sinks: email (SMTP), generic webhook (Teams, Slack, Discord, n8n...) and Telegram, with configurable templates (IP, rule, source, country, targeted account) and rate-limit to avoid spamming. Daily or weekly email reports summarize activity: bans, top offenders and targeted accounts.
- Sink types: email, webhook, telegram (WebUI or PUT /api/notifications/{name})
- POST /api/notifications/{name}/test — send a test notification
- Report periodico: daily/weekly digest per email (GET/PUT /api/report)
GeoIP
With a MaxMind GeoLite2-Country database (.mmdb), every event is enriched with the country and you can ban whole countries with ban_countries. The database path is configurable and the WebUI shows its status with a live lookup test.
- Free database: register on MaxMind and download GeoLite2-Country.mmdb
- Set geoip.database in the config or via the WebUI (Settings, GeoIP card)
Editions and licensing
The Community edition is free: one server with the full engine, all presets, GeoIP and the WebUI. The Pro edition (annual per-server subscription) unlocks multiple servers, email reports, multi-user roles, SIEM integrations (Prometheus, syslog) and webhook/Telegram sinks. Licensing is a signed offline-verifiable license file you upload from the WebUI (Settings, License card).
- Community: 1 server, full engine, GeoIP, WebUI, admin user — free forever
- Pro: unlimited servers, email reports, multi-user admin/viewer, SIEM, webhook + Telegram
- License: Ed25519-signed JSON file, verified offline with the embedded public key
Central console (Hub)
For MSPs and multi-server fleets, the WinLogGuard Hub is a central web console (Python/FastAPI on Linux): agents poll outbound HTTPS — no inbound ports on your servers. The console offers fleet status per tenant, centralized events/bans, configuration push with templates and diff, signed auto-updates of the agents, central GeoIP distribution, per-tenant reports and GDPR-compliant exports with pseudonymization.
- Multi-tenancy: tenants, per-tenant RBAC (admin/viewer/tenant_admin), audit log
- Config push: templates, semantic diff per section, fleet push with snapshot
- Auto-update: signed releases (Ed25519 + SHA-256) distributed from the Hub
- Licensing: Community/Pro editions shared with the standalone agent
Uninstall and data
Uninstalling removes the service and its firewall rules; your data in C:\ProgramData\WinLogGuard are kept by default. The interactive uninstaller asks for explicit confirmation before deleting them; in silent mode data are always preserved. To reinstall, the existing configuration (including the API token) is picked up unchanged.
- Apps & Features, or unins000.exe (in the install folder) /SILENT for scripted removal
- PowerShell alternative: scripts\uninstall.ps1 (optional -PurgeData switch)
- ProgramData\WinLogGuard: config, SQLite database, logs — kept unless you confirm the purge
Troubleshooting
If the service does not start or does not ban, check the application log (C:\ProgramData\WinLogGuard\logs) and the WebUI Sources page: audit policy diagnostics point to the exact commands when the Security log is not readable or 4625 auditing is disabled.
- Service not starting: run the config validation (WinLogGuard.Service.exe --validate --config ) and read logs\app..log
- No events from Security: the preset rdp-bruteforce requires logon-failure auditing (auditpol diagnostics in the WebUI show the fix)
- Access from another host: open TCP 8443 (installer task or New-NetFirewallRule), use https://:8443 with your token
- CLI exit codes: 0 ok, 1 API/connection error, 2 config or usage error — for scripts and runbooks
Ready to protect your Windows servers? Community is free, forever.