WinSentinel.Cli 1.16.1

dotnet tool install --global WinSentinel.Cli --version 1.16.1
                    
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest
                    
if you are setting up this repo
dotnet tool install --local WinSentinel.Cli --version 1.16.1
                    
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=WinSentinel.Cli&version=1.16.1
                    
nuke :add-package WinSentinel.Cli --version 1.16.1
                    

<div align="center">

πŸ›‘οΈ WinSentinel

Your Always-On Windows Security Agent

Build & Test CodeQL codecov NuGet Release Docker .NET 8 Windows License: MIT Tests Lines of Code

Not just an auditor - a living agent that monitors, detects, correlates, and responds 24/7.

Real-time threat detection β€’ 13 audit modules β€’ Auto-remediation β€’ Chat control plane β€’ AI-powered correlation β€’ Compliance profiles

πŸš€ Quick Start Β· πŸ“¦ Install Β· πŸ“– Docs Β· πŸ› Issues Β· πŸ“‹ Changelog


</div>

Why WinSentinel?

Most Windows security tools run once and give you a report. WinSentinel is different:

  • Always on - runs as a Windows Service, monitoring your system 24/7
  • Correlates events - doesn't just flag individual events, it detects multi-stage attack patterns
  • Takes action - auto-remediates threats with full undo support
  • Speaks your language - chat-based control plane with 25+ commands plus natural language
  • Compliance-aware - built-in profiles for Home, Enterprise, HIPAA, PCI-DSS, and CIS L1
  • Deeply tested - 4,173 automated tests across 128 test files

πŸ—οΈ Architecture

Two-process design: a background agent (Windows Service) and a WPF dashboard connected via named pipe IPC.

graph TB
    subgraph Agent["πŸ›‘οΈ WinSentinel Agent (Windows Service)"]
        PM[βš™οΈ Process Monitor]
        FM[πŸ“ File System Watcher]
        EL[πŸ“‹ Event Log Listener]
        NM[🌐 Network Monitor]
        SA[πŸ“Š Scheduled Auditor<br/>13 modules]
        AB[🧠 Agent Brain +<br/>Threat Correlator]
        AR[πŸ”§ Auto-Remediator<br/>7 actions + undo]
        IS[πŸ”’ Input Sanitizer]
        IPC_S[πŸ“‘ IPC Server]
    end

    subgraph Dashboard["πŸ’» WinSentinel Dashboard (WPF)"]
        LD[πŸ“Š Live Dashboard +<br/>Score Gauge]
        TF[⚠️ Real-time Threat Feed]
        CC[πŸ’¬ Chat Control Plane]
        SH[πŸ“ˆ Score History & Trends]
        CP[πŸ“‹ Compliance Profiles]
        FR[πŸ”• Finding Rules]
        PC[βš™οΈ Policy Configuration]
        ER[πŸ“€ Export Reports]
    end

    PM & FM & EL & NM -->|events| AB
    SA -->|findings| AB
    AB -->|threats| AR
    AB -->|alerts| IPC_S
    IPC_S <-->|Named Pipe IPC| Dashboard

Threat Detection Flow

flowchart LR
    A[Raw Events] --> B{Monitor<br/>Modules}
    B --> C[Process<br/>Events]
    B --> D[File<br/>Events]
    B --> E[EventLog<br/>Events]
    B --> F[Network<br/>Events]
    C & D & E & F --> G[🧠 Threat<br/>Correlator]
    G -->|Single event| H[Classify &<br/>Score]
    G -->|Multi-event<br/>pattern| I[Attack Chain<br/>Detection]
    H & I --> J{Severity?}
    J -->|Critical/High| K[⚑ Auto-Remediate]
    J -->|Medium| L[⚠️ Alert User]
    J -->|Low/Info| M[πŸ“ Log]
    K --> N[Undo Log]

The agent runs continuously - even with the dashboard closed - watching processes, file changes, event logs, and network activity. When it detects suspicious behavior, it correlates events, classifies threats, and auto-remediates based on configurable policies.


⚑ Features at a Glance

Category What You Get
πŸ” 4 Real-Time Monitors Process creation/termination, file system changes, Windows Event Log, network connections - always watching
🧠 AI-Powered Brain Correlates individual events into attack chains. Detects multi-stage attacks that single-event analysis misses
πŸ”§ 7 Auto-Remediation Actions Kill process, quarantine file, block IP, disable account, restore hosts, re-enable Defender, revert registry - all with undo
πŸ’¬ Chat Control Plane 25+ commands plus natural language. Run audits, query threats, configure policies - from the chat panel
πŸ“Š 13 Audit Modules Firewall, Updates, Defender, Accounts, Network, Processes, Startup, System, Privacy, Browser, App Security, Encryption, Event Log
πŸ“‹ Compliance Profiles Home, Enterprise, HIPAA, PCI-DSS, CIS L1 - context-aware scoring with per-profile severity adjustments
πŸ”• Finding Suppression Ignore/suppress known-acceptable findings with regex rules, expiration dates, and audit trail
πŸ“ˆ Score History SQLite-backed audit tracking with trends. See your security posture change over time
πŸ“€ Export Reports HTML, JSON, Text, Markdown - save and share results
πŸ”” Toast Notifications Critical finding alerts via Windows notification center
πŸ’» CLI Mode Full CLI (winsentinel.exe) for scripting, automation, and CI/CD gate checks
βš™οΈ System Tray Minimize to tray and run silently in the background
πŸ›‘οΈ Input Sanitization Centralized security layer prevents command injection in all user-facing inputs

πŸ“Έ Sample Audit Output

╔══════════════════════════════════════════════════════╗
β•‘           WinSentinel Security Audit Report          β•‘
β•‘              2026-02-21 22:35:00 PST                 β•‘
β•‘           Profile: Enterprise                        β•‘
╠══════════════════════════════════════════════════════╣
β•‘                                                      β•‘
β•‘         Security Score:  92 / 100   Grade: A         β•‘
β•‘         β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘  92%       β•‘
β•‘                                                      β•‘
╠══════════════════════════════════════════════════════╣
β•‘  Module           Score   Status                     β•‘
╠══════════════════════════════════════════════════════╣
β•‘  πŸ”₯ Firewall       100    β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ  PASS           β•‘
β•‘  πŸ”„ Updates          95    β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘  PASS           β•‘
β•‘  πŸ›‘οΈ Defender        100    β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ  PASS           β•‘
β•‘  πŸ‘€ Accounts        100    β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ  PASS           β•‘
β•‘  🌐 Network          90    β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘  PASS           β•‘
β•‘  βš™οΈ Processes        90    β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘  PASS           β•‘
β•‘  πŸš€ Startup          95    β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘  PASS           β•‘
β•‘  πŸ’» System          100    β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ  PASS           β•‘
β•‘  πŸ”’ Privacy          95    β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘  PASS           β•‘
β•‘  🌍 Browser          85    β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘  PASS           β•‘
β•‘  πŸ“¦ App Security     90    β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘  PASS           β•‘
β•‘  πŸ” Encryption       80    β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘  WARN           β•‘
β•‘  πŸ“‹ Event Log        85    β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘  PASS           β•‘
╠══════════════════════════════════════════════════════╣
β•‘  Findings: 65 total | 0 critical | 5 warnings       β•‘
β•‘  Suppressed: 2 (accepted risk)                       β•‘
β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•

πŸš€ Quick Start

Prerequisites

  • Windows 10 or 11 (x64)
  • .NET 8 SDK (for building from source)

Clone, Build & Run

git clone https://github.com/sauravbhattacharya001/WinSentinel.git
cd WinSentinel

# Build
dotnet build WinSentinel.sln -p:Platform=x64

# Run the dashboard
dotnet run --project src/WinSentinel.App -p:Platform=x64

# Run tests (4,173 tests)
dotnet test -p:Platform=x64

Quick Audit (no build needed)

.\RunAudit.ps1

πŸ“¦ Installation

Option 1: MSIX Installer

# Downloads cert, installs MSIX - one command
.\Install-WinSentinel.ps1

Option 2: Windows Service

dotnet build src/WinSentinel.Agent -c Release

# Install (requires Administrator)
.\Install-Agent.ps1 -Install

# Check status
.\Install-Agent.ps1 -Status

Option 3: Build MSIX from Source

cd src\WinSentinel.Installer
.\Build-Msix.ps1
# β†’ dist\WinSentinel.msix

πŸ” Real-Time Monitors

Monitor What It Watches Key Detections
βš™οΈ Process Process creation & termination Suspicious executables, unsigned binaries, temp/download path launches, known-bad names
πŸ“ File System File create/modify/delete/rename System directory changes, hosts file tampering, startup folder modifications, suspicious DLLs
πŸ“‹ Event Log Windows Security & System logs Failed logons, privilege escalation, audit policy changes, service installations, account modifications
🌐 Network Active connections & listening ports New listeners, known-bad IPs, unusual outbound ports, DNS anomalies

πŸ“Š The 13 Audit Modules

# Module What It Scans
1 πŸ”₯ Firewall All profile states, rule analysis, dangerous port exposure (RDP 3389, SMB 445, Telnet 23)
2 πŸ”„ Updates Windows Update service, pending updates, last install date, update source config
3 πŸ›‘οΈ Defender Real-time protection, cloud protection, behavior monitoring, definition age, tamper protection
4 πŸ‘€ Accounts Local users, admin audit, password policies, guest account, empty passwords
5 🌐 Network Open ports, SMB/RDP exposure, LLMNR/NetBIOS poisoning, Wi-Fi security, ARP, IPv6
6 βš™οΈ Processes Unsigned executables, suspicious paths, high-privilege monitoring
7 πŸš€ Startup Startup programs, scheduled tasks, Run/RunOnce keys, service types
8 πŸ’» System OS build, Secure Boot, BitLocker, UAC level, RDP config, DEP/NX
9 πŸ”’ Privacy Telemetry, advertising ID, location tracking, clipboard sync, activity history
10 🌍 Browser Chrome/Edge settings, dangerous extensions, saved passwords, update status
11 πŸ“¦ App Security Outdated software, EOL flagging, installed program analysis
12 πŸ” Encryption BitLocker, EFS, certificate store, TPM status
13 πŸ“‹ Event Log Failed logins, suspicious events, audit policy gaps

πŸ“‹ Compliance Profiles

Built-in profiles adjust severity weights and scoring for different security contexts:

Profile Target Environment Key Adjustments
🏠 Home Personal/home use Relaxed - info-level items don't penalize
🏒 Enterprise Corporate workstations Moderate - emphasizes patching, network, accounts
πŸ₯ HIPAA Healthcare environments Strict - encryption, audit logging, access control weighted heavily
πŸ’³ PCI-DSS Payment card processing Strict - network segmentation, firewall, patching critical
πŸ”’ CIS L1 CIS Benchmarks Level 1 Comprehensive - baseline security for all organizations

Switch profiles via the dashboard or CLI to see how your system scores under different compliance frameworks.


πŸ”§ Auto-Remediation

7 autonomous response actions, each with full undo:

Action What It Does Reversible
Kill Process Terminates suspicious process -
Quarantine File Moves to quarantine directory βœ…
Block IP Creates firewall block rule βœ…
Disable Account Disables compromised account βœ…
Restore Hosts Reverts hosts file to clean state βœ…
Re-enable Defender Turns real-time protection back on -
Revert Registry Undoes malicious registry changes βœ…

πŸ’¬ Chat Control Plane

25+ commands plus natural language understanding:

> status                    # Agent uptime, active monitors
> threats                   # Recent threat events
> audit                     # Run full 13-module audit
> audit firewall            # Run specific module
> score                     # Current score and grade
> history                   # Score trend over time
> monitor status            # All 4 monitor states
> start monitor process     # Start specific monitor
> policy                    # Show current policies
> set risk tolerance high   # Adjust sensitivity
> quarantine                # List quarantined files
> undo <id>                 # Reverse a remediation action
> journal                   # Agent activity log
> export html               # Export report
> fix all                   # Auto-fix all fixable findings

Natural language works too:

> Why is my network score low?
> What's the most dangerous thing on my system?
> Show me failed login attempts from today

πŸ’» CLI Reference

# Full audit
winsentinel --audit

# JSON output for scripting
winsentinel --audit --json

# Specific modules only
winsentinel --audit --modules firewall,network,privacy

# CI/CD gate: fail if score < 90
winsentinel --audit --threshold 90

# Auto-fix everything
winsentinel --fix-all

# Compare last two runs
winsentinel --history --compare

# Show what changed
winsentinel --history --diff
Flag Description
--audit Run full security audit
--score Print score and grade only
--fix-all Auto-fix all fixable findings
--history View past audit runs
--json / --html / --md Output format
--output <file> Save to file
--modules <list> Comma-separated module list
--threshold <n> Fail if score below n
--compare / --diff Compare runs or show deltas
--summary Executive security summary (plain-English brief)
--quiet Score + exit code only

Exit codes: 0 = pass, 1 = warnings, 2 = critical, 3 = error


πŸ“Š Scoring

Starts at 100, deductions by severity:

Severity Deduction Example
πŸ”΄ Critical -15 pts Real-time protection disabled, firewall off
🟑 Warning -5 pts LLMNR enabled, outdated definitions
πŸ”΅ Info -1 pt Telemetry at default level
βœ… Pass 0 pts Secure Boot enabled, UAC on

Grades: A+ (95+) Β· A (90-94) Β· B (80-89) Β· C (70-79) Β· D (60-69) Β· F (<60)

Compliance profiles adjust these weights contextually - a finding that's info-level for Home use might be a warning under HIPAA.


πŸ—οΈ Project Structure

WinSentinel.sln
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ WinSentinel.Core/          # Security audit engine (13 modules)
β”‚   β”‚   β”œβ”€β”€ Audits/                # Firewall, Network, Defender, etc.
β”‚   β”‚   β”œβ”€β”€ Models/                # AuditResult, Finding, SecurityReport
β”‚   β”‚   β”œβ”€β”€ Services/              # AuditEngine, Orchestrator, Scorer
β”‚   β”‚   └── Helpers/               # Shell, PowerShell, Registry, WMI
β”‚   β”‚
β”‚   β”œβ”€β”€ WinSentinel.Agent/         # Always-on agent (Windows Service)
β”‚   β”‚   β”œβ”€β”€ Modules/               # 4 real-time monitors
β”‚   β”‚   β”œβ”€β”€ Services/              # Brain, Correlator, Remediator, Chat
β”‚   β”‚   β”‚                          # Journal, Policy, IPC, Sanitizer
β”‚   β”‚   └── Ipc/                   # Named pipe protocol
β”‚   β”‚
β”‚   β”œβ”€β”€ WinSentinel.App/           # WPF dashboard (MVVM)
β”‚   β”‚   β”œβ”€β”€ Views/                 # Dashboard, Chat, Policy, Compliance
β”‚   β”‚   β”œβ”€β”€ ViewModels/            # CommunityToolkit.Mvvm
β”‚   β”‚   └── Services/              # IPC client, ChatAI
β”‚   β”‚
β”‚   β”œβ”€β”€ WinSentinel.Cli/           # Command-line interface
β”‚   └── WinSentinel.Installer/     # MSIX packaging
β”‚
β”œβ”€β”€ tests/
β”‚   └── WinSentinel.Tests/         # 4,173 xUnit tests (128 files)
β”‚
β”œβ”€β”€ RunAudit.ps1                   # Quick audit script
β”œβ”€β”€ Install-Agent.ps1              # Service installer
β”œβ”€β”€ Install-WinSentinel.ps1        # MSIX installer
└── Fix-Network.ps1                # Network security fix script

By the numbers: 72k+ lines of source code, 50k+ lines of tests, 370+ commits, 128 test files.


βš™οΈ Tech Stack

Component Technology
Runtime .NET 8 (LTS)
UI WPF + MVVM (CommunityToolkit.Mvvm)
Language C# 12
Agent Microsoft.Extensions.Hosting + Windows Services
IPC Named Pipes (System.IO.Pipes)
Database SQLite (Microsoft.Data.Sqlite)
Testing xUnit β€” 4,173 tests
Security CodeQL scanning, input sanitization
Packaging MSIX with code signing
CI/CD GitHub Actions (build, test, release, CodeQL)
AI Ollama (local LLM) + built-in rule engine

πŸ“‹ Releases

Version Date Highlights
v1.4.2 2026-04-16 Test coverage improvements
v1.4.1 2026-04-02 NuGet packaging & CI fixes
v1.4.0 2026-03-29 Major feature release
v1.3.0 2026-03-20 CLI power tools & hardened security
v1.2.0 2026-03-16 Deep system auditing & threat intelligence
v1.1.0 2026-02-20 Compliance profiles, finding suppression, remediation checklists
v1.0.0 2026-02-17 Initial release β€” always-on agent, 4 monitors, AI correlator, 13 audit modules

πŸ” Security Model

WinSentinel follows a defense-in-depth approach:

Layer Protection
Input Sanitization All user inputs (chat, CLI, config) pass through a centralized InputSanitizer that blocks command injection, path traversal, and control characters
Least Privilege The dashboard runs as the current user. Only the agent service and remediation actions require Administrator
Undo Journal Every auto-remediation action is logged with full undo metadata - quarantined files can be restored, blocked IPs unblocked, disabled accounts re-enabled
Named Pipe IPC Dashboard↔Agent communication uses local-only named pipes (no network exposure). The pipe is ACL-restricted to the installing user and SYSTEM
Finding Suppression Audit Trail When you suppress a finding, WinSentinel records who, when, why, and expiration - suppressions don't silently hide real threats
No Outbound Telemetry WinSentinel sends zero data home. All analysis is local. AI features use local Ollama models only

Reporting vulnerabilities: See SECURITY.md for responsible disclosure guidelines.


❓ Troubleshooting

<details> <summary><strong>Agent service won't start</strong></summary>

  1. Ensure you're running PowerShell as Administrator
  2. Check .NET 8 is installed: dotnet --list-runtimes
  3. Review Windows Event Viewer β†’ Application log for WinSentinel.Agent errors
  4. Try running the agent manually first: dotnet run --project src/WinSentinel.Agent

</details>

<details> <summary><strong>Dashboard can't connect to agent</strong></summary>

  1. Verify the agent service is running: .\Install-Agent.ps1 -Status
  2. Named pipe connections require both processes to run under the same user (or SYSTEM)
  3. Some antivirus software blocks named pipe creation - add an exclusion for WinSentinel.Agent.exe

</details>

<details> <summary><strong>False positives in audit results</strong></summary>

  1. Use Finding Rules in the dashboard to suppress known-acceptable findings
  2. Switch to a more appropriate Compliance Profile (e.g., Home vs Enterprise)
  3. Use --modules flag in CLI to skip irrelevant audit modules
  4. Open an issue if a detection rule is genuinely wrong

</details>

<details> <summary><strong>Build fails on x86 or ARM</strong></summary>

WinSentinel targets x64 only. Always pass -p:Platform=x64:

dotnet build WinSentinel.sln -p:Platform=x64
dotnet test -p:Platform=x64

</details>

<details> <summary><strong>Network score seems wrong</strong></summary>

  1. Run .\Fix-Network.ps1 to apply recommended network hardening
  2. Some findings (LLMNR, NetBIOS) require registry changes + reboot
  3. VPN adapters can trigger false "open port" findings - suppress with Finding Rules

</details>


🀝 Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Test your changes (dotnet test -p:Platform=x64)
  4. Push and open a Pull Request

Ideas: plugin system for custom modules, Linux port, UI themes, localization, additional compliance profiles.


πŸ“„ License

MIT License - see LICENSE for details.


<div align="center">

Built with C# on .NET 8 Β· 72k+ LOC Β· 4,173 tests Β· Always watching πŸ›‘οΈ

⭐ Star Β· πŸ› Report Bug Β· πŸ’‘ Request Feature

</div>

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last Updated
1.16.1 85 5/19/2026
1.16.0 93 5/17/2026
1.15.1 102 5/2/2026
1.15.0 92 4/30/2026
1.14.0 96 4/29/2026
1.13.0 89 4/29/2026
1.12.0 105 4/28/2026
1.11.0 102 4/25/2026
1.10.0 93 4/25/2026
1.9.0 95 4/24/2026
1.8.0 93 4/22/2026
1.7.0 92 4/21/2026
1.6.0 100 4/20/2026
1.5.1 97 4/20/2026
1.5.0 90 4/19/2026
1.4.5 99 4/19/2026
1.4.4 95 4/17/2026
1.4.3 85 4/17/2026
1.4.2 91 4/16/2026
1.4.1 110 4/2/2026
Loading failed