Oliver Kieselbach dbef6921ae feat(vuln): queue-driven correlation + WhiteGlove Part-1 inventory trigger
Replaces the fire-and-forget Task.Run inside EventIngestProcessor — which
Azure Functions scale-in could kill mid-flight, leaving sessions with no
vulnerability_report and forcing users to click "Analyze Now" — with a
dedicated queue + BackgroundService worker (vulnerability-correlate),
mirroring the analyze-on-enrollment-end pattern. Adds a V2-agent trigger
that emits a Part-1 software-inventory snapshot the moment Windows Event
62407 fires (WhiteGlove sealing success), so Part-1 vuln correlation
happens BEFORE the admin clicks Reseal — closing the gap that existed
because reboot_kill termination at sealing left no shutdown inventory
for the backend to correlate.

Backend
  * IVulnerabilityCorrelateProducer + AzureQueueVulnerabilityCorrelate
    Producer (fail-soft on agent's hot path).
  * VulnerabilityCorrelateQueueWorker (BackgroundService, 5-attempt
    visibility-timeout retry, poison-queue on exhaustion).
  * VulnerabilityCorrelateHandler ports the full pipeline (correlate +
    store + synth event + re-analyze enqueue + SignalR notify).
  * IVulnerabilityInventoryLoader extracted from
    GetVulnerabilityReportFunction so worker + manual rescan share one
    loader; phase-aware filter via whiteGlovePart parameter +
    includeAllPhases escape-hatch for the rescan UI.
  * EventIngestProcessor cutover: drops three concrete-class deps
    (_vulnerabilityCorrelation, _vulnRepo, _signalRNotification) and
    two now-orphaned private methods. 561 → 388 LOC.

Agent V2
  * WhiteGloveInventoryTrigger subscribes to EspAndHelloHost.WhiteGlove
    Completed and calls AgentAnalyzerManager.RunWhiteGlovePart1Inventory
    Snapshot via injected Action (no concrete-class coupling, trivially
    mockable). Single-fire guarded by Interlocked.Exchange.
  * IWhiteGloveCompletedSource interface keeps EspAndHelloHost internal
    sealed while letting the trigger be unit-tested with a 4-line stub.
  * AgentAnalyzerManager.RunWhiteGlovePart1InventorySnapshot runs ONLY
    SoftwareInventoryAnalyzer (LocalAdmin/IntegrityBypass deliberately
    skipped at WG hand-off — still SYSTEM context).
  * EnrollmentTerminationHandler now also tags Part 2 (WhiteGloveCompleted
    Part2 → wgPart=2); was previously untagged so the new phase filter
    couldn't see it.
  * SoftwareInventoryAnalyzer.AnalyzeAtShutdown gets per-WG-phase atomic
    idempotency via Interlocked.CompareExchange, with reset-on-failure
    so the EnrollmentTerminationHandler stays a working fallback if the
    Trigger crashes.

Cross-phase contamination & out-of-order resilience
  * Inventory loader filters by whiteGlovePart so a Part-2 correlation
    cannot see Part-1 inventory items (and vice versa).
  * Handler checks the existing report on BOTH Part-1 and Part-2 paths:
    Part-2 merges with existing Part-1, Part-1 SKIPS its store when the
    existing report already contains user_enrollment / both findings or
    has scan_summary.phase_contributions.user_enrollment > 0 — protects
    against late-arriving Part-1 retries overwriting the richer Part-2
    or merged report after at-least-once redelivery.
  * VulnerabilityCorrelationService.MergeReports gains NormalizeForMerge
    that recursively unwraps Newtonsoft JObject/JArray/JValue to native
    Dictionary/List/primitive shapes BEFORE the cast-based extract
    helpers run. Without this the normal-order Part-2 merge silently
    dropped Part-1 findings, because GetVulnerabilityReportAsync round-
    trips through JsonConvert and the existing helpers' OfType / "as
    Dictionary" casts produced empty results on JTokens.

Tests (+34 new across Backend & Agent V2.Core)
  * VulnerabilityCorrelateEnvelopeSerializationTests — wire-format pin.
  * VulnerabilityInventoryLoaderTests — phase filtering, includeAllPhases,
    lenient long-parsing.
  * VulnerabilityCorrelateHandlerSkipTests — out-of-order skip helper
    against native, JArray, JObject, both phase tag, phase_contributions
    counter.
  * VulnerabilityCorrelationServiceTests — round-trip safety of
    MergeReports against JsonConvert-deserialized existing reports.
  * WhiteGloveInventoryTriggerTests — fire-once, dedup, dispose-then-late,
    idempotent dispose, action-exception isolation, null-arg validation.
  * SoftwareInventoryAnalyzerIdempotencyTests — Part-1 dedup, Part-2
    dedup, Part-1 ≠ Part-2 independence.

Build green, 0 errors, 0 warnings. Backend 844/844 tests pass, Agent
V2.Core 825/825 tests pass (parallel-flaky tests pass isolated, see
feedback_v2_recoverypath_corrupt_snapshot_flake).

V1 ingest path (/api/agent/ingest) deliberately untouched per
project_v1_vuln_pipeline_gap — V1 is being phased out; fixing it
forward would inflate scope.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-30 15:25:28 +02:00
2026-04-29 08:57:16 +02:00
2026-04-29 09:00:52 +02:00
2026-03-17 18:24:01 +01:00
2026-03-26 07:02:33 +01:00
2026-04-04 19:17:01 +02:00

Autopilot Monitor

Advanced monitoring and troubleshooting solution for Windows Autopilot deployments. Gain full visibility into every enrollment session with a detailed event timeline, fleet health dashboards, and session reporting. Define custom analysis rules to automatically detect issues and gather rules to collect targeted evidence. Retrieve diagnostics packages on demand, configure agent settings like auto-reboot behavior and automatic timezone adjustment — all managed centrally from the web dashboard.

Private Preview

Autopilot Monitor is currently running as a Private Preview. Visit autopilotmonitor.com to request access and learn more.

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 application that collects telemetry and evidence during enrollment
  • Backend API — Azure Functions-based ingestion and processing pipeline
  • Web Dashboard — Next.js application for real-time monitoring and fleet analytics

Architecture

For detailed information about the system architecture, components, and data flow, see Architecture Documentation.

Documentation

Full documentation is available at autopilotmonitor.com/docs

License

This project uses a split licensing model:

  • MIT License — Agent (src/Agent/) and Shared library (src/Shared/) — unrestricted use on end-user devices
  • AGPL-3.0 — Backend (src/Backend/), Web Dashboard (src/Web/), and MCP Server (src/McpServer/) — server-side components remain open source

See LICENSE for full details.

S
Description
Windows Autopilot & Intune enrollment monitoring: live session timelines, fleet health, diagnostics, and an MCP server for AI-assisted troubleshooting.
Readme AGPL-3.0 60 MiB
Languages
C# 72.7%
TypeScript 25.7%
PowerShell 1%
JavaScript 0.5%