Continuously export Microsoft Defender for Cloud data
Microsoft Defender for Cloud generates detailed security alerts and recommendations. To analyze the information in these alerts and recommendations, you can export them to Azure Log Analytics, Event Hubs, or to another SIEM, SOAR, or IT classic deployment model solution. You can stream the alerts and recommendations as they're generated or define a schedule to send periodic snapshots of all of the new data.
With continuous export, you can fully customize what information to export and where it goes. For example, you can configure it so that:
- All high severity alerts are sent to an Azure event hub
- All medium or higher severity findings from vulnerability assessment scans of your SQL servers are sent to a specific Log Analytics workspace
- Specific recommendations are delivered to an event hub or Log Analytics workspace whenever they're generated
- The secure score for a subscription is sent to a Log Analytics workspace whenever the score for a control changes by 0.01 or more
This article describes how to configure continuous export to Log Analytics workspaces or Azure event hubs.
Defender for Cloud also offers the option to perform a one-time, manual export to CSV. Learn more in Manual one-time export of alerts and recommendations.
|Release state:||General availability (GA)|
|Required roles and permissions:||
National (Azure Government, Microsoft Azure operated by 21Vianet)
What data types can be exported?
Continuous export can export the following data types whenever they change:
- Security alerts.
- Security recommendations.
- Security findings. Findings can be thought of as 'sub' recommendations and belong to a 'parent' recommendation. For example:
- The recommendations System updates should be installed on your machines (powered by Update Center) and System updates should be installed on your machines each has one 'sub' recommendation per outstanding system update.
- The recommendation Machines should have vulnerability findings resolved has a 'sub' recommendation for every vulnerability identified by the vulnerability scanner.
If you’re configuring a continuous export with the REST API, always include the parent with the findings.
- Secure score per subscription or per control.
- Regulatory compliance data.
Set up a continuous export
You can configure continuous export from the Microsoft Defender for Cloud pages in Azure portal, via the REST API, or at scale using the supplied Azure Policy templates.
Configure continuous export from the Defender for Cloud pages in Azure portal
If you're setting up a continuous export to Log Analytics or Azure Event Hubs:
From Defender for Cloud's menu, open Environment settings.
Select the specific subscription for which you want to configure the data export.
From the sidebar of the settings page for that subscription, select Continuous export.
Here you see the export options. There's a tab for each available export target, either event hub or Log Analytics workspace.
Select the data type you'd like to export and choose from the filters on each type (for example, export only high severity alerts).
Select the export frequency:
- Streaming – assessments are sent when a resource’s health state is updated (if no updates occur, no data is sent).
- Snapshots – a snapshot of the current state of the selected data types that are sent once a week per subscription. To identify snapshot data, look for the field
If your selection includes one of these recommendations, you can include the vulnerability assessment findings together with them:
- SQL databases should have vulnerability findings resolved
- SQL servers on machines should have vulnerability findings resolved
- Container registry images should have vulnerability findings resolved (powered by Qualys)
- Machines should have vulnerability findings resolved
- System updates should be installed on your machines
To include the findings with these recommendations, enable the include security findings option.
From the "Export target" area, choose where you'd like the data saved. Data can be saved in a target of a different subscription (for example, on a Central Event Hubs instance or a central Log Analytics workspace).
You can also send the data to an Event hubs or Log Analytics workspace in a different tenant.
Log analytics supports records that are only up to 32KB in size. When the data limit is reached, you will see an alert telling you that the
Data limit has been exceeded.
Exporting to a Log Analytics workspace
If you want to analyze Microsoft Defender for Cloud data inside a Log Analytics workspace or use Azure alerts together with Defender for Cloud alerts, set up continuous export to your Log Analytics workspace.
Log Analytics tables and schemas
Security alerts and recommendations are stored in the SecurityAlert and SecurityRecommendation tables respectively.
The name of the Log Analytics solution containing these tables depends on whether you've enabled the enhanced security features: Security ('Security and Audit') or SecurityCenterFree.
To see the data on the destination workspace, you must enable one of these solutions Security and Audit or SecurityCenterFree.
To view the event schemas of the exported data types, visit the Log Analytics table schemas.
Export data to an Azure Event Hubs or Log Analytics workspace in another tenant
You cannot configure data to be exported to a log analytics workspace in another tenant when using Azure Policy to assign the configuration. This process only works with the REST API, and the configuration is unsupported in the Azure portal (due to requiring multitenant context). Azure Lighthouse does not resolve this issue with Policy, although you can use Lighthouse as the authentication method.
When collecting data into a tenant, you can analyze the data from one central location.
To export data to an Azure Event Hubs or Log Analytics workspace in a different tenant:
- In the tenant that has the Azure Event Hubs or Log Analytics workspace, invite a user from the tenant that hosts the continuous export configuration, or alternatively configure Azure Lighthouse for the source and destination tenant.
- If using Azure AD B2B Guest access, ensure that the user accepts the invitation to access the tenant as a guest.
- If you're using a Log Analytics Workspace, assign the user in the workspace tenant one of these roles: Owner, Contributor, Log Analytics Contributor, Sentinel Contributor, or Monitoring Contributor.
- Create and submit the request to the Azure REST API to configure the required resources. You'll need to manage the bearer tokens in both the context of the local (workspace) and the remote (continuous export) tenant.
Continuously export to an event hub behind a firewall
You can enable continuous export as a trusted service, so that you can send data to an event hub that has an Azure Firewall enabled.
To grant access to continuous export as a trusted service:
Sign in to the Azure portal.
Navigate to Microsoft Defender for Cloud > Environmental settings.
Select the relevant resource.
Select Continuous export.
Select Export as a trusted service.
You need to add the relevant role assignment on the destination Event Hubs.
To add the relevant role assignment on the destination Event Hub:
Navigate to the selected Event Hubs.
Select Access Control > Add role assignment
Select Azure Event Hubs Data Sender.
Select the Members tab.
Select + Select members.
Search for and select Windows Azure Security Resource Provider.
Select Review + assign.
View exported alerts and recommendations in Azure Monitor
You might also choose to view exported Security Alerts and/or recommendations in Azure Monitor.
Azure Monitor provides a unified alerting experience for various Azure alerts including Diagnostic Log, Metric alerts, and custom alerts based on Log Analytics workspace queries.
To view alerts and recommendations from Defender for Cloud in Azure Monitor, configure an Alert rule based on Log Analytics queries (Log Alert):
From Azure Monitor's Alerts page, select New alert rule.
In the create rule page, configure your new rule (in the same way you'd configure a log alert rule in Azure Monitor):
For Resource, select the Log Analytics workspace to which you exported security alerts and recommendations.
For Condition, select Custom log search. In the page that appears, configure the query, lookback period, and frequency period. In the search query, you can type SecurityAlert or SecurityRecommendation to query the data types that Defender for Cloud continuously exports to as you enable the Continuous export to Log Analytics feature.
Optionally, configure the Action Group that you'd like to trigger. Action groups can trigger email sending, ITSM tickets, WebHooks, and more.
The Microsoft Defender for Cloud alerts or recommendations appears (depending on your configured continuous export rules and the condition you defined in your Azure Monitor alert rule) in Azure Monitor alerts, with automatic triggering of an action group (if provided).
Manual one-time export of alerts and recommendations
To download a CSV report for alerts or recommendations, open the Security alerts or Recommendations page and select the Download CSV report button.
Due to Azure Resource Graph limitations, the reports are limited to a file size of 13K rows. If you're seeing errors related to too much data being exported, try limiting the output by selecting a smaller set of subscriptions to be exported.
These reports contain alerts and recommendations for resources from the currently selected subscriptions.
In this article, you learned how to configure continuous exports of your recommendations and alerts. You also learned how to download your alerts data as a CSV file.
For related material, see the following documentation: