Commit Graph

815 Commits

Author SHA1 Message Date
Claude 0130609a2d fix: add thread-safe synchronization to EnrollmentTracker shared state
All mutable state fields accessed from multiple threads (timer callbacks,
ImeLogTracker events, EspAndHelloTracker events, desktop detection,
background Task.Run) are now protected by a single _stateLock.

Key fixes:
- TryEmitEnrollmentComplete: atomic guard-check-and-claim prevents double
  enrollment_complete emission (the most critical race condition)
- RecordSignal: List<string> mutations are now thread-safe
- NotifyDesktopArrived: atomic check-and-set prevents duplicate processing
- CollectDeviceInfo: _enrollmentType/_skipUserStatusPage writes are visible
  to concurrent readers immediately after lock release
- OnHelloCompleted/OnWaitingForHelloSafetyTimeout: consistent multi-field
  reads prevent wrong branch selection
- SummaryTimerCallback: _stateDirty flag and _stateData serialization are
  synchronized to prevent corrupted state persistence
- EmitAppTrackingSummaryIfChanged: hash comparison is atomic to prevent
  duplicate summary events

Lock discipline: all lock sections contain ONLY field reads/writes — no
_emitEvent, _logger, timer operations, or external callbacks. This
guarantees no deadlocks and microsecond-level contention.

https://claude.ai/code/session_01EWzmYXFmXUaPpeksi6WGKZ
2026-03-30 10:52:45 +00:00
Claude 2ced2e18bb fix: improve reliability across agent, backend, and web layers
- BackendApiClient: dispose HttpRequestMessage/HttpResponseMessage, cap Retry-After delay
- EmergencyReporter: add lock for thread-safe anti-flood state access
- GeoLocationService: use static HttpClient to prevent socket exhaustion
- EnrollmentTracker: wrap fire-and-forget Task.Run in try-catch
- NtpTimeCheckService: validate NTP response length and leap indicator
- GraphTokenService: cap Retry-After delay at 120s
- NdjsonParser: gracefully skip malformed JSON event lines
- authenticatedFetch: add 30s default timeout via AbortSignal
- SignalRContext: clear retry timeout on unmount to prevent memory leak
- MCP client: add 30s request timeout

https://claude.ai/code/session_01EWzmYXFmXUaPpeksi6WGKZ
2026-03-30 10:23:13 +00:00
Oliver Kieselbach 0af770599f updated changelog 2026-03-30 02:02:11 +02:00
Oliver Kieselbach 73d5a62a88 fixes, timezone pasing, load session details, session load, ntp waning (clock skew) 2026-03-30 01:31:07 +02:00
Oliver Kieselbach b77bcd5a18 route change 2026-03-29 23:21:34 +02:00
Oliver Kieselbach 2286ccfac3 more logging 2026-03-29 23:05:45 +02:00
Oliver Kieselbach e7e23f8243 fix merge call 2026-03-29 22:59:20 +02:00
Oliver Kieselbach d1ffac14bc hardened integrity check of agent via SHA256 from version.json and agent config (download and runtime check) 2026-03-29 22:56:11 +02:00
Oliver Kieselbach 8654cbbf42 added agent crash detection, added platform metrics 2026-03-29 21:15:01 +02:00
Oliver Kieselbach 815dc47886 mcp usage fix, backend datetime fix, agent fix orphaned session handling 2026-03-29 17:13:28 +02:00
Oliver Kieselbach 66cc6af20f added user requests rate limiter, mcp tools bugfix, optimized request pipeline, mcp usage data retention, mcp plantier management 2026-03-29 16:12:15 +02:00
Oliver Kieselbach e88749e794 tracking only for mcp 2026-03-29 14:57:13 +02:00
Oliver Kieselbach 085f1f0f0f fixed normalizer 2026-03-29 14:37:53 +02:00
Oliver Kieselbach 762bcfde34 better debug logging 2026-03-29 14:33:52 +02:00
Oliver Kieselbach 9e278db162 added logging for debug 2026-03-29 14:24:18 +02:00
Oliver Kieselbach b1434a6d6d change mcp server name 2026-03-29 14:11:22 +02:00
Oliver Kieselbach f6d685392a request telemetry, fixed usage logging bug 2026-03-29 14:06:43 +02:00
Oliver Kieselbach f20670db66 changed hosts logging 2026-03-29 13:45:22 +02:00
Oliver Kieselbach dbb8c20a45 fixed usage log, fixed mcp tools, fixed version comparer vul report 2026-03-29 13:28:00 +02:00
Oliver Kieselbach ceea328fae vul report rescan bugfix 2026-03-29 13:09:12 +02:00
Oliver Kieselbach cdba7f2cb4 mcp user mgmt, vul report re-scan logging 2026-03-29 12:57:36 +02:00
Oliver Kieselbach dd2ee928b0 mcp tool extented and meta, mcp usage data UI, better logging for backend 2026-03-29 12:41:09 +02:00
Oliver Kieselbach 0d1fc98e4a Merge branch 'main' of https://github.com/okieselbach/Autopilot-Monitor 2026-03-29 01:19:09 +01:00
Oliver Kieselbach fc53787d97 mcp tools update 2026-03-29 01:18:51 +01:00
Oliver Kieselbach 3b3d14c50b Merge pull request #36 from okieselbach/claude/fix-rescan-persistence
Fix rescan not persisting results when no vulnerabilities found
2026-03-29 00:39:17 +01:00
Oliver Kieselbach 45f30ed944 Merge branch 'main' of https://github.com/okieselbach/Autopilot-Monitor 2026-03-29 00:18:38 +01:00
Oliver Kieselbach 193cdf6714 fix oauth flow 2026-03-29 00:18:13 +01:00
Claude 53afa30068 Fix rescan not persisting results when no vulnerabilities found
When CorrelateAsync returned null (zero findings after correct version
filtering), the rescan code path fell through to returning the OLD
stored report instead of persisting the new result. Now properly
handles the null case by deleting the stale report and returning
a clean response.

Added DeleteVulnerabilityReportAsync to the repository interface
and implementations.

https://claude.ai/code/session_01Kv2aAEVqbeFSsyPv7gU7pF
2026-03-28 22:55:09 +00:00
Oliver Kieselbach 9a7c2aa4b6 Merge pull request #35 from okieselbach/claude/dynamic-client-registration-QaeKu 2026-03-28 23:04:31 +01:00
Claude a3d319acd1 Fix session never stored: move transports.set() after handleRequest
The session ID is generated inside StreamableHTTPServerTransport during
handleRequest() when it processes the initialize method. The previous
code called transports.set() BEFORE handleRequest(), at which point
transport.sessionId was still undefined — so the session was never
stored in the map. Every subsequent request got "No valid session."

https://claude.ai/code/session_01S8iM5fK53kYa54tydpgsNq
2026-03-28 22:02:48 +00:00
Claude dc9b1cb3e1 Add Protected Resource Metadata (RFC 9728) and WWW-Authenticate headers
The missing piece for dynamic client registration: Claude Code needs
/.well-known/oauth-protected-resource to discover the authorization
server after receiving a 401. Without this, the OAuth discovery chain
never starts and sessions can't be established.

Changes:
- Add GET /.well-known/oauth-protected-resource endpoint (RFC 9728)
- Add WWW-Authenticate header with resource_metadata URL to all 401s
- Update flow documentation in oauth.ts header comment

https://claude.ai/code/session_01S8iM5fK53kYa54tydpgsNq
2026-03-28 22:02:48 +00:00
Oliver Kieselbach 36f7276275 Merge pull request #34 from okieselbach/claude/dynamic-client-registration-QaeKu 2026-03-28 19:35:12 +01:00
Claude 1a20477c14 Add RFC 7591 dynamic client registration to MCP OAuth proxy
Remove hardcoded clientId from .mcp.json so clients (Claude Code) can
dynamically register via POST /oauth/register instead of requiring a
pre-configured client ID.  The MCP server generates a UUID per client
and stores it in-memory; the real Entra ID credentials stay server-side.

https://claude.ai/code/session_01S8iM5fK53kYa54tydpgsNq
2026-03-28 18:33:55 +00:00
Oliver Kieselbach 8aca182b35 Merge pull request #33 from okieselbach/claude/fix-cve-filtering-HsxF4 2026-03-28 19:07:48 +01:00
Claude e3a99e519a Fix CVE version filtering to exclude already-fixed vulnerabilities
The FilterByVersion wildcard logic was treating CVEs with specific
versions in their CPE URI as affecting ALL versions. Now extracts the
version from the CPE 2.3 URI and compares it against the installed
version, so only truly relevant CVEs are shown.

Also adds missing CPE seed mappings for common Intune/Autopilot
managed software: Intune Management Extension, Company Portal,
ODBC/OLE DB drivers, Remote Desktop, Azure CLI.

https://claude.ai/code/session_01Kv2aAEVqbeFSsyPv7gU7pF
2026-03-28 18:03:29 +00:00
Oliver Kieselbach 68857ebabb vul report fix 3 2026-03-28 17:00:24 +01:00
Oliver Kieselbach 9db2678315 vul report fix 2 2026-03-28 16:51:42 +01:00
Oliver Kieselbach 908640a47d fix vul report 2026-03-28 16:09:03 +01:00
Oliver Kieselbach 91cba0e093 session handling 2026-03-28 11:36:49 +01:00
Oliver Kieselbach be549a0b6d fix session hanling 2026-03-28 11:28:20 +01:00
Oliver Kieselbach 19e5283676 force re-initialize 2026-03-28 11:22:38 +01:00
Oliver Kieselbach 8d49a798a4 fix internal error 2026-03-28 11:16:40 +01:00
Oliver Kieselbach 825e062d92 fixed auth function 2026-03-28 10:56:50 +01:00
Oliver Kieselbach e6c5f0fca2 oauth fix 2026-03-28 10:38:52 +01:00
Oliver Kieselbach fff0db014f added logging 2026-03-28 10:29:06 +01:00
Oliver Kieselbach 29acaabb4a fix mcp schema 2026-03-28 10:09:02 +01:00
Oliver Kieselbach de21d2c7b1 final mcp work 2026-03-28 09:51:57 +01:00
Oliver Kieselbach fbea8b5ca4 final CORS fix by using different route 2026-03-28 09:42:28 +01:00
Oliver Kieselbach 30ecdac684 moved CORS to env vars 2026-03-28 09:33:29 +01:00
Oliver Kieselbach 49a14c0a00 added CORS middleware 2026-03-28 09:26:44 +01:00