Fix for removal of Defender XDR endpoint - #863
Merged
Ian Hellen (ianhelle) merged 7 commits intoOct 31, 2025
Merged
Conversation
- also fixing datetime formatting change for AzureMonitor - removing spurious warning when using Default MicrosoftDefender configuration in msticpyconfig.yaml
Ian Hellen (ianhelle)
requested review from
FlorianBracq,
Copilot and
ryan-detect-dot-dev
October 21, 2025 20:17
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR addresses the deprecation of the Microsoft 365 Defender (M365D) Advanced Hunting API endpoint by consolidating M365D queries to use the MDE Advanced Queries API instead. Users are warned about this change and directed to use the Microsoft Graph Security Hunting API (M365DGraph) going forward.
Key Changes:
- Deprecated M365D Advanced Hunting API usage, with M365D environment now routing to MDE Advanced Queries API
- Updated test fixtures to reflect M365D using MDE endpoints (
securitycenterdomain instead ofsecuritydomain) - Minor code cleanup including removal of unused imports, typo fixes, and configuration key handling improvements
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| msticpy/data/drivers/mdatp_driver.py | Removed M365D-specific API logic, added deprecation warning, consolidated to MDE API path |
| tests/data/drivers/test_mdatp_driver.py | Updated M365D test assertions to expect MDE API endpoints and parameters |
| tests/data/drivers/test_odata_drivers.py | Changed M365D test data from security to securitycenter domain URLs |
| msticpy/data/drivers/odata_driver.py | Fixed configuration key logic to avoid appending "-Default" unnecessarily |
| msticpy/data/drivers/azure_monitor_driver.py | Removed unused datetime import and _format_datetime method |
| msticpy/data/core/query_source.py | Fixed typo in docstring ("emtpy" → "empty") |
| msticpy/_version.py | Bumped version to 2.17.2 |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Fixing aiagents # Conflicts: # conda/conda-reqs-pip.txt # requirements-all.txt # setup.py
FlorianBracq
left a comment
Collaborator
There was a problem hiding this comment.
Minor update suggested for the depreciation warning, the rest looks OK.
(added logging.captureWarnings so that this also goes to logs)
FlorianBracq
approved these changes
Oct 29, 2025
Ian Hellen (ianhelle)
deleted the
ianhelle/defender-sentinel-fixes-2025-10-21
branch
October 31, 2025 17:57
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.
This pull request contains several changes focused on deprecating support for the M365 Defender Advanced Hunting API, consolidating API usage to the MDE Advanced Queries API, and updating related tests and configuration logic. It also includes minor bug fixes and cleanup in other modules. Below are the most significant changes:
M365 Defender API Deprecation and Consolidation
mdatp_driver.py. All queries for theM365Denvironment now revert to the MDE Advanced Queries API, with a warning logged to inform users of the change and guidance to use the Microsoft Graph Security Hunting API (M365DGraph) instead. (msticpy/data/drivers/mdatp_driver.pyL293-R298)M365Dnow uses the same endpoints and parameters asMDE, ensuring consistency across environments and removing references to the deprecated API. ([1], [2], [3], [4], [5]`)Code Cleanup and Bug Fixes
get_m365d_endpointimport frommdatp_driver.pyand updated log messages for clarity. ([1], [2])_value_or_defaultinquery_source.py("emtpy" to "empty"). (msticpy/data/core/query_source.pyL30-R30)_get_driver_settingsinodata_driver.pyto avoid appending "-Default" to configuration keys, which could cause incorrect lookups. (msticpy/data/drivers/odata_driver.pyL561-R565)Azure Monitor Driver Simplification
datetimeimport and the_format_datetimemethod fromazure_monitor_driver.py, and updated the FORMATTERS dictionary accordingly. ([1], [2], [3])Version Bump
2.17.2. (msticpy/_version.pyL3-R3)