Path: blob/master/tutorials-and-examples/feature-tutorials/MDATPQuery.ipynb
3253 views
Querying MDATP Data
MSTICpy versions > 0.3.0
Description
This Notebook provides details and examples of how to connect to and query data from the MDATP Advanced Hunting API.
Installation
Authentication
Authentication for the MDATP Advanced Hunting API is handled via an Azure AD application. Before you can authenticate you will need to register an application and provide it with the required permissions. MSTICpy supports Application Context authentication to the API. Detailed instructions on registering an application can be found here: https://docs.microsoft.com/windows/security/threat-protection/microsoft-defender-atp/exposed-apis-create-app-webapp
Once created you will require the following details:
Application (client) ID
Directory (tenant) ID
Client secret
These details can be found in the Azure Portal under Azure Active Directory > App Registrations.
Once collected the easiest way to manage these details is via msticpyconfig.yaml - simply add them to the file in the following format:
You can then initialize a data provider for MDATP and connect the provider:
Once connected the MDATP data connector functions in a similar manner to other data connectors. You can list queries:
Get details about avaliable queries:
Execute queries with default parameters:
Execute queries with custom parameters:
Print a fully constructed query for debug purposes:
Execute a custom query: