MDATP Long Term Retention with Azure Storage Account
Microsoft Defender ATP is a great tool for enhancing your Detection capabilities and once you find incidents you can work with the Hunting capabilities we have blogged about earlier. The challenge we often face is that the Hunting Data is only available for 30 days so if you need to go back further that data is not available.
Microsoft is now introducing two new built-in methods of storing that data for longer than 30 days, currently in preview
- Azure Storage Account
- Azure Event Hub
And from these you can then access the data and do what you like with it.
In this blog we will walk you through how you can set these up the Storage Account integration.
Storage Account Integration
Azure Portal
So first off let’s start with setting up a Storage Account in the Azure Portal
1. Create a storage account

2. Select your Subscription and Resource Group if you have one or create it.

3. Give your storage account a name and select your desired storage settings.
4. Configure Advanced settings as you need. In my case I used the defaults.

5. Add Tags if you are using it and review the settings and complete the creation, Let the creation complete and go to the newly created storage account.
6. To configure the integration we need to get our resource ID so open properties of the Storage Account and copy the resource ID information.

Resource Provider and onboarding consent
We also need to make sure we have microsoft.insights registered as a resource provider you can configure that this way.
1. In the Azure Portal, go to – Subscriptions > Your subscription > Resource Provider
2. On the microsoft.insights recourse provider click register if its not already registered.

3. A Tenant Admin has also to give concent to the onboarding application. you can do this by clicking on the follwoing link and logging on with the desired Tenant rights. https://login.microsoftonline.com/common/oauth2/authorize?prompt=consent&client_id=88cfeabb-510d-4c0d-8358-3d1929c8d828&response_type=code&sso_reload=true
Now we can move to the security center portal and continue configuring the integration.
MDATP Portal
In the MDATP Console go to
1. Interoperability > Data Export Settings
2. Click on Add data export settings
The wizard to export data will show up and here we have a few options.
1. Give it a Name
2. We need to have the Storage Account Resource ID from our Storage account which we stood up in the earlier steps. It can be found under properties on the storage account in the Azure Portal.
3. Check the Event Types you want to Store in your Storage Account
4. Click Save

Once you have saved Events will start being sent to your Storage Account and if you browse the blob in the Azure Portal you will see the different events categories.

If you click through one of them you will see that they are stored in an order of “tenantid\year\month\date\hour\minute\”

The schema of the JSON files is build in the following structure
{
{
“time”: ” <The time WDATP received the event> “
“tenantId”: ” <Your tenant ID> “
“category”: ” <The Advanced Hunting table name with ‘AdvancedHunting-‘ prefix> “
“properties”: { <WDATP Advanced Hunting event as Json> }
}
}