Commit Graph

34 Commits

Author SHA1 Message Date
Oliver Kieselbach bbf815f739 remove dead UploadBundle code and fix Lenovo model detection
- Remove UploadBundleRequest, UploadBundleResponse classes (ApiModels.cs)
- Remove UploadBundle API endpoint constant (Constants.cs)
- Remove GetBundleUploadUrlAsync method (BackendApiClient.cs) — no callers anywhere
- Fix HardwareInfo: Lenovo devices report the marketing model name in
  Win32_ComputerSystemProduct.Version, not Win32_ComputerSystem.Model;
  add Lenovo-specific WMI fallback for correct model string

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-24 23:28:53 +01:00
Oliver Kieselbach 6aafaa5ff8 fetch diagnostics SAS URL on-demand to reduce device exposure window
Instead of delivering the long-lived SAS URL in the agent config response
(where it was cached on disk for the full enrollment period), the agent now
requests a short-lived URL via POST /api/diagnostics/upload-url just before
uploading — the URL is held in memory only and never written to config.

Backend: new GetDiagnosticsUploadUrlFunction with same cert/hardware
security validation as all other agent endpoints; GetAgentConfigFunction
now sends DiagnosticsUploadEnabled (bool) instead of the SAS URL;
ConfigVersion bumped to 6.

Agent: BackendApiClient.GetDiagnosticsUploadUrlAsync added;
DiagnosticsPackageService fetches URL on-demand via the API client;
AgentConfiguration.DiagnosticsBlobSasUrl replaced by DiagnosticsUploadEnabled.

UI: settings page parses SAS URL expiry (se= param) and shows expiry date
inline with colour coding; expired or near-expiry URLs trigger
error/warning notifications at the top of the page on load.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-24 21:15:50 +01:00
Oliver Kieselbach 79a4407831 enhanced platform stats and better tenant management 2026-02-24 17:54:39 +01:00
Oliver Kieselbach 2235170a57 add generic event_correlation source for flexible cross-event rule correlation
Replaces the hardcoded app_state_regression source with a generic
event_correlation source that allows correlating any two event types
by a shared field (e.g. appId), with optional time windows and filters
on both events — all configurable via JSON without backend code changes.

RuleCondition gains 5 new nullable properties:
- CorrelateEventType: second event type (Event B)
- JoinField: field to match across both events (e.g. "appId")
- TimeWindowSeconds: max time between Event A and B
- EventAFilterField/Operator/Value: optional filter on Event A

ANALYZE-APP-010 migrated to use event_correlation source.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-24 13:38:46 +01:00
Oliver Kieselbach 6deb2f9845 fix ANALYZE-APP-010: correlate app regression by appId using new source type
The previous rule incorrectly matched any app_install_completed event
against any app_install_failed event without correlating by appId.

Changes:
- RuleEngine: add app_state_regression source that finds apps where
  app_install_completed is followed by app_install_failed for the same
  appId, with optional DataField filter on the failed event; returns
  appId, appName, both event details and errorDetail as evidence
- AnalyzeRule: document new app_state_regression source in comment
- ANALYZE-APP-010: rewrite to use single app_state_regression condition
  (IME-ERROR-REPORT filter) + enrollment_complete check; evidence now
  contains the exact app name and id that regressed

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-24 13:19:05 +01:00
Oliver Kieselbach ca39032ed4 Add Telegram notification for new Private Preview tenant signups
Sends a Telegram message to @AutopilotMonitor-PrivatePreview whenever
a new tenant signs up. The bot webhook URL is stored in the new
PreviewConfig table (PartitionKey=TelegramBot, RowKey=config,
WebhookUrl=<url>) — same lifecycle as PreviewWhitelist, easy to remove
after GA. Notification is fire-and-forget and non-fatal.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-23 23:13:22 +01:00
Oliver Kieselbach f1cff9b89e new agent defaults for new tenants 2026-02-18 15:15:26 +01:00
Oliver Kieselbach 19e9713a31 added platform stats 2026-02-18 12:19:52 +01:00
Oliver Kieselbach 31f4cddc13 Large rename job SerialNumberValidation to AutopilotDeviceValidation 2026-02-17 22:49:26 +01:00
Oliver Kieselbach ddc083581b added diagnostics package download link to portal 2026-02-16 20:14:35 +01:00
Oliver Kieselbach 897fd02fe8 Upload Diagnostics package implementation 2026-02-16 19:59:57 +01:00
Oliver Kieselbach 5b835fd7f0 reboot and keep logfiles configurable in UI now 2026-02-16 17:49:49 +01:00
Oliver Kieselbach 25cb01e315 rework agent cleanup
teams notifications on success or failure
2026-02-16 17:18:27 +01:00
Oliver Kieselbach 2354d0a8cd added more agent remote config params + verbose level 2026-02-16 13:26:18 +01:00
Oliver Kieselbach e14675c847 fixed constants
fix for analyze rule reboot loop
added completed timestamp to progress portal
longer os age default in bootstrapper
removed legacy filed name in events
2026-02-16 12:29:03 +01:00
Oliver Kieselbach f0465e76a1 added CORS logging and Agent max auth retry logic via config 2026-02-16 10:09:10 +01:00
Oliver Kieselbach 8227c909a5 added private preview support 2026-02-15 20:07:45 +01:00
Oliver Kieselbach 4802668e38 Re-architecture, removal of dead code, security hardening, Rules re-work, same caching strategy everywhere used 2026-02-15 17:00:18 +01:00
Oliver Kieselbach 8858b588a2 SerialNumber Validaion implementation against Intune Auopilot 2026-02-13 22:14:02 +01:00
Oliver Kieselbach 731894bc04 Agent: use remote-config exclusivly
Function: deliver new default config
2026-02-13 17:03:14 +01:00
Oliver Kieselbach 925993b7e0 agent: version in log and event
bnackend: new slow app rule
UI: fix autopilot profile display
2026-02-13 14:04:15 +01:00
Oliver Kieselbach a6d40450dd added Agent state persistance to survive reboots 2026-02-12 15:16:25 +01:00
Oliver Kieselbach dadb897e8e fixed app install summaries 2026-02-10 16:14:19 +01:00
Oliver Kieselbach c33ac56c82 Autopilot v2 support and GatherRule Registry fix 2026-02-10 12:47:50 +01:00
Oliver Kieselbach 1939b52402 Updated rules to new events etc. 2026-02-10 12:01:44 +01:00
Oliver Kieselbach 3e3cc904f7 Agent re-architectured
- new IME log parser
- IME log replay option
- revised timeline and enrollment tracker
UI
- removed flight tracker
- fixed download tracker
- nice progress portal page
2026-02-10 02:37:31 +01:00
Oliver Kieselbach 2001dbaa29 prevent PII detail leaks 2026-02-07 22:25:06 +01:00
Oliver Kieselbach f358d8ebd9 Central table creation logic
app install metrics
platform stats
global gather and analyze rule editng
Dark mode (needs improvement)
UI enhancments
2026-02-07 19:23:20 +01:00
Oliver Kieselbach 339cfda9ef changed analyze rule execution logic 2026-02-06 19:21:15 +01:00
Oliver Kieselbach 6c72adb391 Add advanced monitoring, rule engine, and interactive session visualizations
Key Changes:
Web Portal:

Interactive performance metrics with 4-column responsive grid (CPU, Memory, Disk Queue, Disk Free)
Sparklines with hover tooltips using ResizeObserver for pixel-perfect rendering
Collapsible download progress tracking with ETA calculations
Event timeline severity filters (Debug, Info, Warning, Error, Critical)
Backend - Rule Engine:

Gather Rules: Remote-configurable data collection (Command/Registry/WMI)
Analyze Rules: Pattern-based event analysis for common failure scenarios
Built-in rules for Network, Identity, MDM, Apps, ESP diagnostics
Fix: Seed logic now updates existing rules when code definitions change
Agent - New Collectors:

Performance, Download Progress, Cert Validation, ESP UI State collectors
Gather Rule Executor with command allowlist enforcement
Remote Config Service for dynamic agent configuration
Session persistence across agent restarts
2026-02-06 18:46:58 +01:00
Oliver Kieselbach 665c9288fa Add mass rollout simulator and tenant suspension features
- Agent: Add --simulator-mass-rollout mode for parallel device enrollment testing (5 devices across 3 tenants)
- Backend: Add tenant suspension/disable functionality with optional time-based auto-reactivation
- Backend: Add TenantAdminsService and new API endpoints for tenant configuration management
- Frontend: Extend admin configuration UI with tenant management features
2026-02-06 02:36:13 +01:00
Oliver Kieselbach 557dd22c53 Authentication & Galactic Admin: Implement JWT-based multi-tenant access control with cross-tenant support
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
2026-02-05 20:49:36 +01:00
Oliver Kieselbach a20ff48ae6 Backend:
- Add JWT-based authentication to all API endpoints
- Implement tenant isolation and access control validation
- Add Galactic Admin role validation for cross-tenant endpoints
- Enhance certificate validation with full X.509 chain checking
- Add certificate validation cache (5-min TTL) and self-signed cert protection
- Implement NDJSON payload size limit protection (configurable per tenant)
- Replace placeholder audit user identifiers with actual JWT user principals
- Add TenantHelper utility for consistent tenant/user extraction from tokens
- Disable PII logging in production (ShowPII = false)

Agent:
- Add automatic tenant ID detection from Windows Registry (AAD Join enrollment)
- Implement tenant ID precedence: CLI argument > Registry > Fallback

SignalR:
- Add authentication checks to all SignalR functions
- Implement tenant-based group access control
- Add user identifier logging for SignalR operations

Frontend:
- Change MSAL cache from localStorage to sessionStorage (XSS protection)
- Add warning status support to health check page
- Add Admin Configuration link in navbar (Galactic Admin only)
- Move maintenance trigger from Settings to Admin Configuration page
- Update tenant context logging for clarity

Configuration:
- Add MaxNdjsonPayloadSizeMB setting to TenantConfiguration model
- Update configuration service to persist new retention/timeout settings
2026-02-05 16:38:16 +01:00
Oliver Kieselbach 5690620058 Initial commit 2026-02-05 06:14:41 +01:00