mirror of
https://github.com/okieselbach/AutopilotMonitor.git
synced 2026-10-24 04:32:32 +00:00
557dd22c539a5e44031a450d793ba5a08bb894a7
Backend Changes: - Fix user identification to use UPN (User Principal Name) claim as primary identifier instead of display name - Add JWT authentication validation to all API endpoints with Authorization header support - Implement Galactic Admin role with cross-tenant access permissions for sessions, events, and SignalR groups - Add cross-tenant validation in GetSessionEventsFunction, SignalRAddToGroupFunction, and SignalRRemoveFromGroupFunction - Enhance AuthenticationMiddleware to log actual user identifier (UPN) instead of display name Admin Configuration: - Add GetAdminConfigurationFunction and UpdateAdminConfigurationFunction for global settings - Create AdminConfigurationService for managing platform-wide configuration - Add AdminConfiguration model with global rate limiting and maintenance settings - Restrict admin configuration access to Galactic Admins only SignalR Real-time Updates: - Implement "galactic-admins" SignalR group for cross-tenant session visibility - RegisterSessionFunction now sends "newSession" events to both tenant-specific and galactic-admins groups - IngestEventsFunction sends "newevents" only to tenant-specific groups (prevents flooding) - Frontend listens to both "newSession" and "newevents" for real-time updates - Galactic Admins see new sessions from all tenants without being flooded with event updates Frontend Changes: - Add Authorization headers with JWT tokens to all API fetch calls (sessions, events, metrics, configuration) - Implement automatic joining/leaving of "galactic-admins" SignalR group based on Galactic Admin mode - Handle both "newSession" and "newevents" SignalR events for complete session list updates - Add authentication error handling with user notifications for token failures Security Improvements: - Validate tenant access for all cross-tenant operations - Ensure users can only access their own tenant data unless they're Galactic Admins - Log all cross-tenant access attempts with user identifiers for audit trail
Autopilot Monitor
Advanced monitoring and troubleshooting solution for Windows Autopilot deployments.
Overview
Autopilot Monitor provides real-time tracking, intelligent diagnostics, and automated troubleshooting for Windows Autopilot enrollment processes. It consists of:
- Bootstrap Script - PowerShell script deployed via Intune that starts monitoring early in the enrollment process
- Monitoring Agent - Lightweight .NET Windows Service that collects telemetry and evidence
- Backend API - Azure Functions-based ingestion and processing pipeline
- Web Dashboard - Next.js application for real-time monitoring and fleet analytics
Architecture
Device Side Azure Backend Web UI
┌──────────────┐ ┌──────────────┐ ┌──────────┐
│ Bootstrap │──deploys──▶ │ │ │ │
│ Script │ │ Azure │◀───────────▶ │ Next.js │
└──────┬───────┘ │ Functions │ │ Web App │
│ │ │ │ │
▼ │ • Ingest │ └──────────┘
┌──────────────┐ │ • Store │
│ Monitoring │──telemetry──▶ │ • Analyze │
│ Agent │ (mTLS) │ │
└──────────────┘ └──────┬───────┘
│
▼
┌──────────────┐
│ Azure Table │
│ Azure Blob │
│ Azure SQL │
└──────────────┘
Project Structure
Autopilot-Monitor/
├── src/
│ ├── Agent/ # .NET monitoring agent
│ │ ├── AutopilotMonitor.Agent/ # Windows Service host
│ │ └── AutopilotMonitor.Agent.Core/ # Core monitoring logic
│ ├── Backend/ # Azure Functions
│ │ └── AutopilotMonitor.Functions/
│ ├── Shared/ # Shared models/contracts
│ │ └── AutopilotMonitor.Shared/
│ └── Web/ # Frontend
│ └── autopilot-monitor-web/
├── scripts/
│ ├── Bootstrap/ # Intune deployment scripts
│ └── Deployment/ # Azure deployment scripts
├── rules/ # YAML rule definitions
└── docs/ # Documentation
Phase 1 Goals (Current)
- Project structure setup
- Bootstrap PowerShell script
- Basic .NET agent with log tailing
- Azure Functions ingestion API
- Session registration and event storage
- Minimal web UI (session list, timeline)
Getting Started
Prerequisites
- .NET Framework 4.8 SDK (for Agent)
- .NET 8 SDK (for Azure Functions)
- Node.js 18+ (for Web UI)
- Azure subscription
- Visual Studio 2022 or VS Code
Development Setup
-
Clone and restore packages
git clone <your-repo> cd Autopilot-Monitor dotnet restore -
Set up local Azure Functions
cd src/Backend/AutopilotMonitor.Functions cp local.settings.json.template local.settings.json # Edit local.settings.json with your Azure Storage connection string -
Set up web frontend
cd src/Web/autopilot-monitor-web npm install cp .env.local.template .env.local # Edit .env.local with your API endpoint -
Build the agent
cd src/Agent/AutopilotMonitor.Agent dotnet build
Running Locally
-
Start Azure Functions (in one terminal)
cd src/Backend/AutopilotMonitor.Functions func start -
Start Web UI (in another terminal)
cd src/Web/autopilot-monitor-web npm run dev -
Test agent (as Administrator)
cd src/Agent/AutopilotMonitor.Agent/bin/Debug .\AutopilotMonitor.Agent.exe --console
Documentation
Contributing
We welcome community contributions! See CONTRIBUTING.md for guidelines.
License
MIT License - see LICENSE for details
Roadmap
Phase 1: Foundation (Current)
- Bootstrap and basic agent
- Simple ingestion pipeline
- Minimal UI
Phase 2: Intelligence
- Rule engine
- Diagnosis panel
- Troubleshooting bundles
Phase 3: Polish
- Fleet dashboard
- User-facing portal
- Multi-tenant support
Phase 4: Advanced
- Pre-provisioning support
- Custom rule authoring
- Integration APIs
Description
Windows Autopilot & Intune enrollment monitoring: live session timelines, fleet health, diagnostics, and an MCP server for AI-assisted troubleshooting.
autopilotdevice-managementdevice-provisioningendpoint-managementenrollmentintunemcp-servermonitoringmsintuneoobetroubleshootingwindowswindows-autopilot
Readme
AGPL-3.0
60 MiB
Languages
C#
72.7%
TypeScript
25.7%
PowerShell
1%
JavaScript
0.5%