Commit Graph

356 Commits

Author SHA1 Message Date
Oliver Kieselbach 39793948c0 added paging for session reports list 2026-03-03 12:43:53 +01:00
Oliver Kieselbach 46582be1d9 replace static 4h max collector duration with activity-aware idle timeout
Periodic collectors (Performance, AgentSelfMetrics) now stop after 15 min
(configurable) of no real enrollment activity instead of a fixed 4h window.
They restart automatically when new activity is detected, preventing session
bloat for stuck/unfinished enrollments while keeping data flowing during
legitimately long ones.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 12:32:37 +01:00
Oliver Kieselbach cba1171aa3 add status filter badges to session list on dashboard
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 12:25:46 +01:00
Oliver Kieselbach bdfc58146c added min max values on agent settings with descriptions 2026-03-03 12:13:46 +01:00
Oliver Kieselbach 8ac21dace3 added skipped filter for install and download progress, fixed agen version string on platform metrics 2026-03-03 10:56:12 +01:00
Oliver Kieselbach 20e93aa892 add Corporate Identifier Validation with preview-gated UI
Adds a second device validation method alongside existing Autopilot Device
Validation. Corporate Identifier Validation checks devices against Intune
Corporate Device Identifiers (manufacturer + model + serial number) via the
Graph beta searchExistingIdentities endpoint.

Backend: Extract GraphTokenService from AutopilotDeviceValidator for shared
token/consent logic. Add CorporateIdentifierValidator with caching. Update
SecurityValidator with cascading validation (Autopilot first, Corporate
Identifier fallback). Wire new validator through all agent endpoints.

Frontend: Add second toggle in settings gated behind preview mode. Shared
consent flow skips redirect when consent already exists from other toggle.
Section renamed to "Enrollment Device Validation" in preview mode.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 10:19:06 +01:00
Oliver Kieselbach 1d2874514e add copy-to-clipboard button to event detail blocks
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 10:16:01 +01:00
Oliver Kieselbach 475739109a enhanced Autopilot profile interpretation with Hybrid Join detection and AutopilotMode labels
- CollectAutopilotProfile now interprets AutopilotMode (User Driven/Self Deploying/White Glove)
  and CloudAssignedDomainJoinMethod (Entra Join/Hybrid Azure AD Join) with human-readable labels
- Added IsHybridJoin as first-class session field (SessionRegistration, SessionSummary, Table Storage)
- DetectHybridJoinStatic reads DomainJoinMethod from registry at registration time
- UI session detail shows Autopilot Mode, improved Domain Join Method labels, HybridJoinSkipDCConnectivityCheck
- Dashboard shows purple "Hybrid" badge for Hybrid Azure AD Join sessions
- Note: IsUserDriven/IsPreProvisioned unchanged — profile fields are capabilities, not live state

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 10:14:56 +01:00
Oliver Kieselbach 443decc4d9 fix WhiteGlove Part 2 event timeline disruption on mid-enrollment reboot
Prevent phase regression in the event timeline when a reboot during User
Enrollment (Part 2) emits a new agent_started with Phase=Start. The
groupEventsByPhase function now accepts a preventPhaseRegression option
that tracks the highest phase index seen and suppresses regressions to
earlier phases. Reboot events stay in the active enrollment phase instead
of resetting the timeline to Start. Also adds timestamp as fallback sort
key to handle potential duplicate sequences from agent persistence gaps.
Applied to both UI rendering and text/CSV export for Part 2 only.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 10:13:37 +01:00
Oliver Kieselbach c11018f7ce enhanced Report Session dialog 2026-03-03 02:02:31 +01:00
Oliver Kieselbach 5ce22696ab fixed Session list duration in case of WhiteGlove and fixed events incrementing for sessions table 2026-03-03 01:41:17 +01:00
Oliver Kieselbach f57e8224ce fix enrollment progress showing current instead of completed for Pending sessions
When WhiteGlove pre-provisioning completes (status=Pending), all reached
phases should show as completed (green) since pre-provisioning is done.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 01:06:03 +01:00
Oliver Kieselbach 1fa30b542d WhiteGlove session display improvements and per-phase notification durations
Frontend: Add per-block durations to WhiteGlove event timeline headers,
pause-excluded combined duration in Session Info, visual dashed separator
between Pre-Provisioning and User Enrollment blocks, and group labels with
vertical separator in the Enrollment Progress tracker.

Backend: Store ResumedAt timestamp when WhiteGlove Part 2 starts, use it
to compute Duration 2 (user enrollment only) for Teams enrollment notifications.
Rename "WhiteGlove Pre-Provisioning" to "Pre-Provisioning" in notification text.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 00:44:36 +01:00
Oliver Kieselbach 2c09ac1b36 fix total duration calculation for downloads and installs 2026-03-02 23:48:45 +01:00
Oliver Kieselbach 209f080b43 enhanced device block management 2026-03-02 22:54:41 +01:00
Oliver Kieselbach c06205e5c7 added Agent Analyzer config to Configuration page 2026-03-02 22:46:38 +01:00
Oliver Kieselbach 95a2ea7bfc agent fix race condition for parallel uploads 2026-03-02 21:53:27 +01:00
Oliver Kieselbach 798a28c5f2 fix install tracker, kill layout and blocked badge timing 2026-03-02 21:25:06 +01:00
Oliver Kieselbach c97c3677c0 minor adjustments for the block management 2026-03-02 21:10:53 +01:00
Oliver Kieselbach d6dcbe0681 added tenant search, block management, and kill device 2026-03-02 20:56:13 +01:00
Oliver Kieselbach da2ea3fb3a enhanced download tracker and added block device for admin 2026-03-02 20:17:38 +01:00
Oliver Kieselbach eae2898ce2 add Galactic Admin audit logs, audit pagination, and platform metrics backend cache
- Galactic Admin Mode for Audit Logs: banner + cross-tenant endpoint (galactic/audit/logs)
- Audit page pagination (12 entries per page) with Previous/Next controls
- Platform Metrics: moved computation to backend PlatformMetricsService with 5-min cache
- New endpoint GET /api/galactic/metrics/platform replaces N+1 client-side fetches
- IME log tracker enhancements, DO telemetry pattern, and download progress improvements

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 19:40:37 +01:00
Oliver Kieselbach 75d74a8519 added better audit hadling 2026-03-02 18:22:41 +01:00
Oliver Kieselbach 119af503af replace app_tracking_summary apps array with state-breakdown counters and add InstallProgress tracker
Fixes Azure Table Storage 64KB truncation by removing the full apps array
from app_tracking_summary (could be 150+ apps) and replacing it with
lightweight state-breakdown counters (downloading, installing, installed,
skipped, failed, pending). Summary emission is now event-driven with
30s timer as backstop. New InstallProgress UI component shows per-app
install state with duration tracking. ConfigVersion 10 -> 11.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 17:56:56 +01:00
Oliver Kieselbach 17b3c4cdac fine tuned DownloadTracker to recognize Skipped apps and better progressbar behavior on finisched (100 percent) downloads 2026-03-02 17:47:09 +01:00
Oliver Kieselbach 0c739e96ca HelloWaitTimeoutSeconds is now configurable in Configuration 2026-03-02 16:35:58 +01:00
Oliver Kieselbach 53bea70adb gracefully display truncated event data in UI
Backend: DeserializeEventData now returns raw string in _rawDataJson key
when JSON parsing fails (truncated data), instead of empty dict.
UI: EventTimeline detects _rawDataJson and shows an amber warning with
the raw text, so truncated events remain inspectable.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 16:15:00 +01:00
Oliver Kieselbach 3371a11641 truncate event properties to prevent Azure Table Storage 64KB limit errors
DataJson and Message are now capped at 30K chars before writing to Table Storage,
preventing PropertyValueTooLarge failures that silently dropped events.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 15:43:27 +01:00
Oliver Kieselbach 1f835c20ac added UserDriven vs WhiteGlove stats 2026-03-02 15:17:38 +01:00
Oliver Kieselbach 57e4b512f6 fixed whiteglove lifcycle flow storage table states and status 2026-03-02 15:05:51 +01:00
Oliver Kieselbach 4a3caaaa86 add WhiteGlove Part 2 signal for clean Pending→InProgress transition
Agent persists a whiteglove.complete marker when Part 1 finishes. On Part 2
boot, the agent detects the marker, emits a whiteglove_resumed event, and
clears it. The backend handles whiteglove_resumed by transitioning the session
from Pending to InProgress — only if actually Pending (guards against
overwriting Succeeded/Failed). Registration also retries with exponential
backoff (5 attempts) to handle delayed network during OOBE boot.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 14:50:25 +01:00
Oliver Kieselbach 2de8022c7b agent resilliency 2026-03-02 13:50:46 +01:00
Oliver Kieselbach 5d058bf84c fix DateTime Kind=Local causing NotSupportedException on Azure Table Storage writes
Windows EventLog record.TimeCreated returns DateTime with Kind=Local. The Azure
Data Tables SDK rejects Local DateTimes with NotSupportedException, causing
UpdateSessionStatusAsync to fail deterministically for every WhiteGlove session
(Shell-Core EventID 62407 = whiteglove_complete). This was the root cause of the
systematic 6/6 WhiteGlove failures, not ETag conflicts or transient Azure errors.

Agent fix: convert record.TimeCreated to UTC at all 3 EventLog timestamp sources.
Backend fix: EnsureUtc() safety net on all 11 DateTime writes to the sessions table.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 13:20:11 +01:00
Oliver Kieselbach 8a8002491d fix WhiteGlove fallback to also set Status=Pending and retry transient errors
The initial fix (43c2674) resolved the 500 loop but the fallback only set
IsPreProvisioned, leaving Status=InProgress instead of Pending. This extends
the fallback to set both fields and adds retry logic for transient Azure
errors (429/503/408) in UpdateSessionStatusAsync.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 12:33:53 +01:00
Oliver Kieselbach 7e5a7b622d fixed wrong PhaseName set for multipe events from the agent -> UI timeline confusion otherwise 2026-03-02 12:20:13 +01:00
Oliver Kieselbach e63e48da1a added agent emergency reporter 2026-03-02 11:51:25 +01:00
Oliver Kieselbach 43c2674a17 fix WhiteGlove spool drain 500 loop that blocks event upload and causes data loss
The IngestEventsFunction verification check returned HTTP 500 when the
WhiteGlove IsPreProvisioned session update failed, causing the agent to
retry the same batch in a tight loop (same whiteglove_complete event,
same failing update, same 500). After 20 retries the agent gave up with
events stuck in the local spool and the session metadata broken.

- Add unconditional fallback (ETag.All merge) via SetSessionPreProvisionedAsync
  when UpdateSessionStatusAsync fails despite internal ETag retries
- Replace the 500 verification response with a warning log + continue
  with 200 so the agent can drain its spool
- Simplify SetSessionPreProvisionedAsync to use ETag.All unconditional
  merge, removing the unnecessary read-then-write pattern

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 10:55:12 +01:00
Oliver Kieselbach f1961f0b9e changed default info log message for better tracability during default logging bahaviour 2026-03-02 10:18:42 +01:00
Oliver Kieselbach a991b9f94f more accurate session generatUi export function 2026-03-02 09:50:07 +01:00
Oliver Kieselbach 2087ac33f7 agent performance optimized 2026-03-01 20:30:33 +01:00
Oliver Kieselbach 93fcc71162 changed default for localadminanalyzer definition 2026-03-01 20:10:53 +01:00
Oliver Kieselbach 10250161ab added agent Analyzer system incl. first analyzer - LocalAdminAnalyzer
Trigger Options: AtStartup, AtShutdown
2026-03-01 19:41:39 +01:00
Oliver Kieselbach e1c6617b53 feat: replace broken JSON blobs in session report ZIP with proper CSV exports
- Remove session.json/events.json/analysis-results.json (serialized as
  {"ValueKind":1} due to System.Text.Json.JsonElement + Newtonsoft mismatch)
- Add session.csv, events.csv, ruleresults.csv — each mirroring the exact
  Azure Table Storage schema (PartitionKey, RowKey, all columns)
- Add timeline.txt (UI timeline view) is retained
- SessionSummary API response now includes OsBuild, OsEdition, OsLanguage,
  IsUserDriven, AgentVersion so session.csv is fully populated
- events.csv: Severity as "Name (int)", PhaseName derived column appended
- ruleresults.csv: JSON columns (RemediationJson etc.) kept as JSON strings

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-01 18:13:17 +01:00
Oliver Kieselbach 6a5b059ed3 added Report Session notification channel 2026-03-01 17:42:37 +01:00
Oliver Kieselbach 14a3ce5b9c feat: fix session report download + add admin note feature
- Fix 500 error on download URL: replace GenerateSasUri() with
  blobClient.Uri (SAS already embedded in service-level connection string)
- Add AdminNote field to SessionReportMetadata shared model
- Read AdminNote from Table Storage in GetAllReportsAsync
- Add UpdateAdminNoteAsync to SessionReportService
- New PATCH /api/galactic/session-reports/{reportId}/note endpoint
- Frontend: editable Admin Note textarea in report detail modal with
  inline save feedback; Admin Note column in reports table with icon
- Add copy-to-clipboard buttons for Session ID, Tenant ID,
  Submitted By, and Email fields in report detail modal

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-01 17:37:52 +01:00
Oliver Kieselbach 3f7261f200 feat: show inline success/error feedback in ReportSessionModal
After submitting a report, the modal now displays a green success block
(with checkmark) or a red error block (with message) directly inside the
dialog instead of only relying on the auto-dismissing notification banner.
On success the form is hidden and the button becomes a green Close button;
on error the form stays visible for retry. The modal resets cleanly on
re-open. Report Session button is now always visible (not gated on
adminMode).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-01 17:16:15 +01:00
Oliver Kieselbach 01c76b3ce7 feat: add session report download — backend SAS URL endpoint + frontend Download ZIP button
- New Azure Function GET /api/galactic/session-reports/download-url generates a 15-minute SAS URL for a session report blob (Galactic Admin only)
- SessionReportsSection modal now shows a Download ZIP button that fetches the SAS URL and triggers a browser download

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-01 17:14:24 +01:00
Oliver Kieselbach 76f56c3b56 show Report Session to Tenant Admins on SessionDetailPage 2026-03-01 16:59:02 +01:00
Oliver Kieselbach 0d2f2ae38c refactor: rename /api/preview-whitelist to /api/preview/whitelist
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 16:50:18 +01:00
Oliver Kieselbach a2de05fe33 refactor: reorganize metrics/stats API routes and fix session-reports 404 handling
- Rename app-metrics → metrics/app (tenant + galactic)
- Rename usage-metrics → metrics/usage (tenant)
- Rename platform/usage-metrics → galactic/metrics/usage
- Rename platform-stats → stats/platform (anon whitelist updated)
- SessionReportService: gracefully handle missing table (404) with empty list
- SessionReportsSection: treat 404 as no reports yet (suppress error)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 16:47:55 +01:00