Skip to content

Fix for removal of Defender XDR endpoint - #863

Merged
Ian Hellen (ianhelle) merged 7 commits into
mainfrom
ianhelle/defender-sentinel-fixes-2025-10-21
Oct 31, 2025
Merged

Fix for removal of Defender XDR endpoint#863
Ian Hellen (ianhelle) merged 7 commits into
mainfrom
ianhelle/defender-sentinel-fixes-2025-10-21

Conversation

@ianhelle

@ianhelle Ian Hellen (ianhelle) commented Oct 21, 2025

Copy link
Copy Markdown
Contributor

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

  • Deprecated the use of the M365 Defender/Defender XDR Advanced Hunting API in mdatp_driver.py. All queries for the M365D environment 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)
  • Updated test cases and mock data to reflect that M365D now uses the same endpoints and parameters as MDE, ensuring consistency across environments and removing references to the deprecated API. ([1], [2], [3], [4], [5]`)

Code Cleanup and Bug Fixes

Azure Monitor Driver Simplification

  • Removed the unused datetime import and the _format_datetime method from azure_monitor_driver.py, and updated the FORMATTERS dictionary accordingly. ([1], [2], [3])

Version Bump

- also fixing datetime formatting change for AzureMonitor
- removing spurious warning when using Default MicrosoftDefender configuration in msticpyconfig.yaml

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 (securitycenter domain instead of security domain)
  • 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.

Comment thread msticpy/data/drivers/mdatp_driver.py Outdated

@FlorianBracq FlorianBracq left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor update suggested for the depreciation warning, the rest looks OK.

Comment thread msticpy/data/drivers/mdatp_driver.py Outdated
(added logging.captureWarnings so that this also goes to logs)
@ianhelle
Ian Hellen (ianhelle) merged commit 4c39c8a into main Oct 31, 2025
10 checks passed
@ianhelle
Ian Hellen (ianhelle) deleted the ianhelle/defender-sentinel-fixes-2025-10-21 branch October 31, 2025 17:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants