Draft
Implement AutoScheduler engine, MDE alert detection, job timeout, MDE onboarding, and domain credentials#26
Conversation
…d fix worker status flow
Copilot
AI
changed the title
Implement core missing services: AutoScheduler, MDE Alert Detection, Job Timeout, MDE Onboarding, and Domain Credentials
Implement AutoScheduler engine, MDE alert detection, job timeout, MDE onboarding, and domain credentials
Jul 17, 2026
Copilot created this pull request from a session on behalf of
ThomasKur
July 17, 2026 13:08
View session
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The E2E analysis identified six gaps preventing ShieldChecker from completing its core mission: scheduled jobs never fire, MDE never onboards on worker VMs, alert detection is skipped entirely (jobs go straight to
Completed), domain credentials are always null, and stuck jobs never time out.AutoScheduler Execution Engine
AutoSchedulerService— 60s pollingBackgroundServicethat evaluates dueAutoScheduleentries, appliesFilterOperatingSystem/FilterExecution/FilterRandomCount, createsQueuedjobs, and advancesNextExecutionSchedulerMutexwith stale-lock reclamation to prevent concurrent evaluation across replicasMDE Alert Detection
MdeAlertDetectionService— queries Graph Security API (/security/alerts_v2) for jobs inWaitingForDetection, correlates byDefenderMachineId+ time window + expected alert titleDetectedAlertsJSON and setsResultSettings.JobReview→ routes toReviewPendingorCompletedWorker Status Flow Fix
Status = 2(WaitingForDetection) instead ofCompletedJobUpdaterControllerdefaults toWaitingForDetection; final completion is handled by the MDE detection serviceMDE Onboarding on Worker VMs
HostEngine.ExecuteJobInVm()runs the MDE onboarding script between VM boot and prerequisite executionVmSettingsandHostServiceApi.SettingsControllernow exposeMdeWindowsOnboardingScript/MdeLinuxOnboardingScriptDomain Credentials
JobController.GetJob()populatesUsername/Domainbased onExecutorUserType:domain_admin→Administrator@{DomainFQDN}domain_user→testuser@{DomainFQDN}local_admin/System→ handled by HostService config or not neededJob Timeout Enforcement
JobTimeoutService— 2-min polling service marks jobs inQueued/WaitingForMDE/WaitingForDetectionasErrorwhen they exceedSettings.JobTimeoutTests
16 new unit tests covering AutoSchedulerService (schedule evaluation, OS/execution/random filters, next-execution calculation, disabled schedule/test handling) and JobTimeoutService (timeout enforcement, boundary conditions, status filtering). All 39 tests pass.