SecOps - 41002 - Microsoft Defender for Identity sensor is installed and healthy on every domain controller#1351
SecOps - 41002 - Microsoft Defender for Identity sensor is installed and healthy on every domain controller#1351Manoj-Kesana wants to merge 4 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new SecOps assessment (41002) that queries Microsoft Graph for Microsoft Defender for Identity (MDI) sensor inventory and reports whether domain controller–integrated sensors appear healthy, running, and up-to-date, along with a companion markdown description/remediation page.
Changes:
- Introduces
Test-Assessment-41002, callingsecurity/identities/sensorsand generating a summarized markdown table of sensors. - Adds
Test-Assessment.41002.mdto provide the report description and remediation guidance content.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/powershell/tests/Test-Assessment.41002.ps1 | New assessment implementation for evaluating MDI sensor inventory via Graph and producing result markdown. |
| src/powershell/tests/Test-Assessment.41002.md | New markdown content used by reporting to describe/remediate the assessment outcome. |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
alexandair
left a comment
There was a problem hiding this comment.
@Manoj-Kesana Please, address my feedback.
Standalone DC sensors (domainControllerStandalone) are excluded, producing wrong verdicts.
Test-Assessment.41002.ps1 filters only domainControllerIntegrated:
$allDcSensors = @($sensors | Where-Object { $_.sensorType -eq 'domainControllerIntegrated' })The security.sensorType enum contains two DC-monitoring values: domainControllerIntegrated and domainControllerStandalone. Microsoft docs confirm the standalone sensor "monitors domain controller traffic via port mirroring" and the FAQ recommends "a Defender for Identity sensor or standalone sensor for each one of your domain controllers" (commonly used for virtual DCs the integrated sensor can't cover). Consequences:
- False FAIL — a tenant whose DCs are covered by standalone sensors hits
$allDcSensors.Count -eq 0→ "MDI onboarded but no domain controller sensors registered" → Fail, despite full coverage. - False PASS — an unhealthy standalone DC sensor is never evaluated; if integrated sensors are healthy the test reports Pass.
Note this gap originates in the spec (it scopes only to domainControllerIntegrated and its Challenges list adfs/adcs/adConnect but omit domainControllerStandalone). Recommend updating both spec and code to include domainControllerStandalone in the DC sensor set — e.g. $_.sensorType -in @('domainControllerIntegrated','domainControllerStandalone') — or explicitly justifying the exclusion in the spec.
Warning
"Every domain represented in the workspace" is not enforced.
The spec's Pass condition requires at least one DC sensor for every domain represented in the workspace. The code treats all DC sensors as a single pool with no per-domainName grouping, so a domain present only via a non-DC sensor (e.g., an AD FS sensor in domain B while DC sensors exist only in domain A) is never flagged. The spec's Challenges acknowledge the API limitation, but the per-domain check that is feasible (every domain appearing in the inventory should have ≥1 DC sensor) isn't implemented. Consider grouping by domainName, or align the spec wording with what's actually checked.
| 1. Sign in to [Microsoft Defender XDR](https://security.microsoft.com) as a Global Administrator or Security Administrator. | ||
| 2. Navigate to **Settings > Identities > Sensors**. | ||
| 3. Download the sensor installer and follow [Install the Microsoft Defender for Identity sensor](https://learn.microsoft.com/en-us/defender-for-identity/deploy/install-sensor). | ||
| 4. For outdated sensors, see [Update Microsoft Defender for Identity sensors](https://learn.microsoft.com/en-us/defender-for-identity/deploy/sensor-settings#sensor-update-process). |
No description provided.