Microsoft Azure
Microsoft Azure is a complete cloud platform with infrastructure, software, and applications available as services. Azure can complement an on-premises infrastructure as an extension of your organization’s technical assets. When using Azure in your environment, whether you opt for the cloud or on-premises option, security and monitoring are still an essential part of your daily operations.
To provide flexibility and customer choice in security operations, Microsoft offers Azure Event Hubs as a centralized service to collect data and logs from other Azure services. You can integrate InsightIDR with Azure Event Hubs to access and ingest all applicable Azure logs and data. This combines Microsoft’s data ingestion service with the incident detection and response system of InsightIDR.
When you configure Azure Event Hubs and consume data and logs through InsightIDR's Microsoft Azure event source, InsightIDR will:
- Parse Microsoft Defender for Cloud events as third-party alert detections.
- Parse Azure Active Directory events to offer ingress authentication, single sign-on (SSO), cloud service activity, and cloud service admin activity detections.
- Parse Microsoft Defender for Endpoint Advanced hunting events as third-party alert detections.
Azure detections trigger legacy detection rules in InsightIDR
Because user behaviors are monitored from the event sources and Insight Agents deployed in your environment, InsightIDR continues to offer and track additional Azure detections over time. Legacy detection rules (formerly known as User Behavior Detection Rules) treat Azure Cloud Services like an extension of your environment.
New Azure alerts for Exchange and SharePoint audit logs
InsightIDR can now produce alerts for Microsoft’s exchange and SharePoint audit logs. These alerts generate cloud service activity and ingress authentication events. Read more about the event log format here: https://learn.microsoft.com/en-gb/microsoft-365/compliance/audit-log-search?view=o365-worldwide.
To set up Microsoft Azure:
- Complete the prerequisite steps.
- Configure Microsoft Azure to send data to InsightIDR.
- Configure InsightIDR to receive data from the event source.
- Test the configuration.
- Troubleshoot common issues.
Requirements
To successfully configure the Microsoft Azure event source, you must:
- Have a Premium P1 or Premium P2 license for Azure Active Directory.
- Have a license for Azure Monitor, Microsoft Defender for Cloud, or Microsoft Defender for Endpoint, depending on which data you want to send to InsightIDR.
- Have access to a Standard pricing tier or higher. The pricing tier also affects the value you can set for retention time (hrs).
- Allocate and open an outbound connection over TCP port 9093 on the InsightIDR Collector. If you do not open this port, your event source configuration will fail.
- Ensure that InsightIDR has an adequate data ingestion rate. Your throughput must equal the number of partitions. Read more about event hub scalability here: https://learn.microsoft.com/en-us/azure/event-hubs/event-hubs-scalability#number-of-partitions.
Restrictions when editing configured event hubs
To edit configured event hubs, you must have a Premium tier license. Read more about the Premium tier here: https://learn.microsoft.com/en-us/azure/event-hubs/event-hubs-premium-overview. You can find more information about tiers here: https://learn.microsoft.com/en-us/azure/event-hubs/compare-tiers.
Configure Microsoft Azure to send data to InsightIDR
Complete these tasks to establish communication between InsightIDR and Microsoft Azure.
Something not quite right?
Sometimes we're not able to provide the most current information about other vendors. For the most up-to-date information, refer to Microsoft’s documentation, including:
- Create an event hub
- Shared access authorization policies
- Connection string for a specific event hub in a namespace
- Configure Azure Monitor
- Stream Azure monitoring data to an event hub or external partner
- Microsoft Entra monitoring and health documentation
- Stream logs to an event hub
- Set up continuous export in the Azure portal
- Configure Microsoft Defender for Endpoint to stream Advanced Hunting events to your Azure Event Hubs
Task 1: Create a new event hub
To send the right information to InsightIDR, create a new Azure event hub with a unique name, such as insights-operational-logs
. You can configure the Microsoft Azure event source only if you have access to the Standard tier subscription or above.
Recommended event hub and namespace configuration
If you have a Standard tier, the number of throughput units (TUs) for the namespace and the number of partitions for the event hub determine how much data can flow through the event hub and namespace.
In most cases, we recommend configuring your event hub and namespace with these settings:
- Give your namespace 1 throughput unit (TU) - With 1 TU, you can send up to 1 MB/s of data or 1,000 events per second, whichever comes first. The more TUs you use, the more Microsoft charges for your namespace, so we recommend using as few TUs as possible. If necessary, you can increase the number of TUs later.
- Enable auto-inflate - When specifying the number of TUs for the namespace, we recommend enabling the Auto-Inflate setting. Auto-inflate automatically increases the number of TUs when data traffic exceeds the volume that the existing number of TUs can handle. Keep in mind that auto-inflate doesn't automatically reduce the number of TUs if the traffic slows down.
- Give your event hub 4 partitions - Each partition supports up to 1 MB/s of data, totaling 4 MB/s for 4 partitions. You can't change the number of partitions later, so specify as many partitions as you think you'll need. Microsoft doesn't charge extra for more partitions.
When to increase TUs or partitions
You might need to increase the number of TUs or partitions if there's a delay between when Microsoft generates a log and when the log appears in InsightIDR. This means that there aren't enough TUs or partitions to handle the amount of data flowing into the event hub. Keep in mind that it can take Microsoft up to 24 hours to generate a log after an event occurs.
Refer to the troubleshooting section to learn more about determining exactly how many TUs and partitions you need, if your environment requires more capacity than average.
To create an event hub:
- Search for Event Hubs in the search bar.
- Select the name of an active Azure Subscription.
- Create a namespace:
- Create a new Resource group.
- Enter a unique Namespace name. The system checks whether the name is available.
- Select a Location (Region) for the namespace.
- Select Standard for the Pricing tier.
- Set Throughput Units to
1
. Each throughput unit provides 1MB/s ingress and 2MB/s egress. - Optionally, Enable Auto-Inflate if you want the event hub namespace to automatically allocate more throughput units during times of heavy traffic. You can also configure this setting in the event hub namespace, in Settings > Scale.
- Optionally, set the Auto-Inflate Maximum Throughput Units to
2
. Each node costs $73 per month, per throughput unit. - Select Review + Create.
- After the Validation succeeded message displays, select Create. A Deployment in Process message displays. Azure automatically provisions and activates the new namespace in about 5 minutes. An Activated notification displays when complete, and the namespace is created.
- Create the event hub:
- Select + Event Hub on the Overview page.
- Enter a unique Event Hub name, such as
insights-operational-logs
. - Ensure that the Partition Count is set to
1
. - (Recommended) Set the Retention time (hrs) to the maximum value allowed by your tier. Standards tiers support up to 7 days (168 hours), and Premium and Dedicated tiers support up to 90 days (2160 hours).
- For existing event hubs, configure this Message Retention setting in Event Hub > Properties.
- Select Review + Create.
- After the Validation succeeded message displays, select Create. The event hub is created.
Task 2: Create a shared access policy from the event hub
A shared access policy allows InsightIDR to access the messages that Azure publishes to the event hub. When you create a shared access policy, ensure that you make a note of the policy name (we recommend a name such as R7InsightIDR
) and grant your policy Listen permission only.
Task 3: Configure activity logs
Configure Azure Monitor to send its logs to the event hub.
To configure activity logs:
- From the namespace, select Activity Logs.
- Select Export Activity Logs.
- Select + Add diagnostic setting.
- Select at least Administrative, Security, and Alert.
- Select Stream to an Event Hub.
- Ensure that your Azure Subscription is selected.
- Set the Event hub name (optional) to
insights-operational-logs
, which is the event hub you created in task 1. - Ensure that the Event hub policy name is set to
RootManagedSharedAccessKey
. - Select Save.
Task 4: Retrieve the shared access policy key
To configure the event source in InsightIDR, you will need the primary key from the R7InsightIDR
shared access policy (created in task 2), associated with the insights-operational-logs
event source (created in task 1).
Task 5 (Optional): Configure other Microsoft solutions
To configure Azure Active Directory:
Configure Azure Active Directory to send sign-in and audit events to the event hub for ingestion into InsightIDR.
- Search for Azure Active Directory in the search bar.
- Select Audit Logs from the Monitoring section.
- Select Export Data Settings.
- Select Add diagnostic setting.
- Select all Categories that you want to ingest logs for.
- Ensure that the active Azure Subscription is selected.
- Set the Event hub name (optional) to
insights-operational-logs
, which is the event hub you created in task 1. - Ensure that the Event hub policy name is set to
RootManagedSharedAccessKey
. - Select Save.
To configure Microsoft Defender for Cloud:
Configure Microsoft Defender for Cloud to send its logs to the event hub for ingestion into InsightIDR. You can configure Microsoft Defender for Cloud using one of two options.
Option 1: Configure with the event hub policy name
- Go to Microsoft Defender for Cloud > Environment settings.
- Select a Subscription.
- Select Continuous export.
- Select all checkboxes.
- Select Resource Group.
- Select Namespace.
- Select Event hub.
- Select Event hub policy name.
- Save the configuration.
Option 2: Configure as a trusted service
- If your event hub is behind a firewall, grant the Continuous Export service access to the event hub:
- Go to the event hub > Access Control.
- Select Add role assignment for the Azure Event Hubs Data Sender role.
- In Select members, select Windows Azure Security Resource Provider.
- Configure continuous export:
- Go to Microsoft Defender for Cloud > Environment settings.
- Select a Subscription.
- Select Continuous export.
- Select all checkboxes.
- Select Resource Group.
- Select Namespace.
- Select Event hub.
- Select Export as a trusted service.
- Add access controls:
- Go to Event hubs > Access control (IAM).
- Select Add > Add role assignment.
- Select Azure Event Hubs Data Sender, and go to Members.
- Select Select members.
- Search for and select Windows Azure Security Resource Provider.
- Select Select to save the changes.
- Select Review + assign.
- Return to the Environment settings > Subscription > Continuous export settings page.
- Save the configuration.
To configure Microsoft Defender for Endpoint:
Configure Microsoft Defender for Endpoint to send its logs to the event hub for ingestion into InsightIDR.
- Go to https://security.microsoft.com.
- Go to Settings.
- Select Microsoft Defender XDR.
- Select Streaming API.
- Select Add.
- Name the API.
- Select Forward events to Event Hub.
- Retrieve the Event-Hub Resource ID:
- Go to the event hub Overview page.
- Select JSON View on the right.
- Copy the Resource ID.
- Enter the Event-Hub name.
- Select Events-Types.
- Select Submit.
Configure InsightIDR to collect data from the event source
Once you have created a Microsoft Azure event hub and configured the data that you want to send to InsightIDR, you can set up the Microsoft Azure event source.
To configure the new event source in InsightIDR:
- From the left menu, go to Data Collection and click Setup Event Source > Add Event Source.
- Do one of the following:
- Search for Microsoft Azure in the event sources search bar.
- In the Product Type filter, select Cloud Service.
- Select the Microsoft Azure event source tile.
- Name the event source. This name will be used to name the log that contains the event data in Log Search.
- Select a collector.
- Optionally, choose to send unparsed logs.
- Select your Account Attribution preference:
- Use short name attribution: The system first attempts to attribute data by email address, for example,
jsmith@myorg.example.com
. If the first attempt is unsuccessful, attribution is attempted by short name, for example,jsmith
. If the short name is unsuccessful, attribution is attempted by a user’s first and last name, for example,John Smith
. - Use fully qualified domain name attribution: The system first attempts to attribute data by email address, for example,
jsmith@myorg.example.com
. If the first attempt is unsuccessful, attribution is attempted by a user’s first and last name, for example,John Smith
. This option is best if your environment has collisions with short names.
- Use short name attribution: The system first attempts to attribute data by email address, for example,
- In the Event Hub Name field, enter the name of the event hub as it is displayed in the Azure portal. Note that you'll need the name only, not the namespace.
- In the Endpoint field, enter the URL of the event hub namespace (excluding the protocol and the trailing slash).
- Under Credential, select Create New.
- Give the new credential a name that clearly identifies it.
- Enter the SharedAccessKeyName and Shared Access Key in their respective fields.
- Click Save.
Test the configuration
To test that event data is flowing into InsightIDR through the Collector:
- Verify that data is flowing to the Collector:
- From the Data Collection Management page, click the Event Sources tab.
- Find the event source you created and click View raw log. If the Raw Logs modal displays raw log entries, logs are successfully flowing to the Collector.
- Wait approximately seven minutes, then open the Log Search page in InsightIDR.
- Verify that log entries are appearing in Log Search:
- From the left menu, go to Log Search.
- Select the applicable Log Sets and the Log Names within them. The Log Name is the event source name. The EventSource logs flow into these Log Sets:
- Ingress Authentication
- SSO Authentication
- Third-Party Alerts (Azure Security Alerts)
- Unparsed Data
- Cloud Service Activity
- Cloud Service Admin Activity
- Set the time range to Last 10 minutes, and click Run.
The Results table displays all log entries that flowed into InsightIDR in the last 10 minutes. The keys and values that are displayed are helpful to know when you want to build a query and search your logs.
Some log formats are incompatible
If you see raw log entries when you select View raw log, but you do not see any log entries in Log Search, then your logs do not match the recommended format and type for this event source.
Sample logs
There are multiple ways to generate sample audit events in Azure to send to the Event Hub:
- Start and stop virtual machines. If you have a test or spare virtual machine, you can generate sample audit events by starting and stopping those machines.
- List shared access policies. Open the Event Hub Namespace. Under Settings, select Shared Access Policies for
RootManageSharedAccessKey
.
It might take several minutes for events to be available in InsightIDR.
Troubleshoot common issues
This section covers some common troubleshooting scenarios.
A connection has been established, but no data is flowing to InsightIDR
If a connection has been established, but there is no data flowing to InsightIDR, verify that you are logged into the correct Event Hub Topic.
A connection has been established, but the data flowing into InsightIDR is delayed
If there's a delay between when Microsoft generates a log and when the log appears in InsightIDR, you might need to increase the number of throughput units (TUs) for your Azure namespace or partitions for your Azure event hub.
Consider these factors to determine the number of TUs and partitions required for your environment:
Understand TUs and partitions
- Throughput units (TUs) - Each TU has a limit on how much data can be ingested into or sent out of an Azure namespace. If the number of events per second flowing from your Azure services into the namespaces exceeds the recommended ingress limit of 1 TU, then you must increase the number of TUs to accommodate your expected data volume.
- Partitions - Partitions enable parallel processing of data from an Azure event hub. Each partition supports up to 1 MB/s of data, so you might need to create several partitions if you need to send more than 1 MB/s of data to InsightIDR.
Determine your data requirements
To determine the data volume that your event hub must support, we recommend sending data from Microsoft Azure to InsightIDR, and measuring the performance.
To determine your data requirements:
- Configure the Azure event hub and namespace using the recommended number of TUs and partitions, and configure the InsightIDR event source.
- Let data flow from Azure to InsightIDR for several days.
- In the Azure portal, go to Event Hubs, and select the namespace you created to use with InsightIDR.
- In the three graphs, adjust the time horizon to see activity for the duration of time data has been flowing through the namespace.
- Select any of the graphs to open a detailed view.
- Select Add Metric, and then select Throttled Requests from the dropdown, ensuring the aggregation is set to Sum.
- Remove all other metrics.
- If you don't see any throttled requests, that means you have enough TUs and partitions to handle the volume of data you're sending to InsightIDR. You can expect your connection between Azure and InsightIDR to function as expected.
- If you see throttled requests, complete these steps to determine the number of TUs and partitions required for your environment:
- Confirm that Azure is sending only data to InsightIDR that is relevant for security use cases:
- In InsightIDR, go to Log Search.
- Select the Unparsed Data log set, and review the logs that Azure sends.
- If Azure is sending data that likely isn't relevant for security use cases, consider turning off these logs in Azure to decrease the amount of data send through the event hub and namespace. Read Microsoft's documentation about resource logs to learn more.
- Review the amount of data flowing through your namespace and event hub:
- In the Azure portal, repeat steps 2-8.
- Change the metric to Incoming Bytes, and review the data.
- Change the metric to Incoming Messages, and review the data.
- Use the number of Incoming Bytes and Incoming Messages to determine how many TUs to allocate for your namespace:
- If the number of incoming bytes consistently exceeds the amount that your namespace can handle, increase the number of TUs to accomodate it. For example, if your namespace currently has 1 TU (which supports up to 1 MB/s), and the namespace consistently receives more than 2 MB/s, increase your namespace's TUs to 3, so that it can handle up to 3 MB/s.
- If the number of incoming messages (events per second) consistently exceeds the amount that your namespace can handle, increase the number of TUs to accomodate it. For example, if your namespace currently has 1 TU (which supports up to 1,000 events per second), and the namespace consistently receives more than 2,000 events per second, increase your namespace's TUs to 3, so that it can handle up to 3,000 events per second.
- If both the number of incoming bytes and incoming messages (events per second) consistently exceed the amount that your namespace can handle, increase the number of TUs based on the higher value. For example, if your namespace currently has 1 TU (which supports up to 1 MB/s or 1,000 events per second), and the namespace consistently receives more than 2 MB/s and more than 3,000 events per second, increase your namespace's TUs to 4, so that it can handle up to 4,000 events per second.
- Use the number of Incoming Bytes to confirm whether the event hub has enough partitions to support the incoming data volume:
- If the number of incoming bytes consistently exceeds the amount that your event hub can handle, allocate more partitions. Each partition supports up to 1 MB/s.
- Because you can't add partitions to an event hub after it's created, you must create a new event hub within the namespace, and give it the appropriate number of partitions. You must also update your Azure services to export their logs to the new event hub, and update the InsightIDR event source to connect to the new event hub.
- Confirm that Azure is sending only data to InsightIDR that is relevant for security use cases:
There is an error in the connection
If there is an error in the connection, check the following:
- Verify that you have selected the Standard tier for Azure Security Center, as stated in the Requirements.
- Verify that you are logged into the correct Event Hub Instance.
- Check your firewall to verify that you have configured an outbound connection over TCP port 9093 on your InsightIDR Collector.
- Check your credentials. Ensure that you are using the Connection String Primary Key and the correct connection string as described in Configure a Microsoft Azure Event Hub.
Invalid SASL mechanism response error
If you are seeing an error that says Invalid SASL mechanism response, server may be expecting a different protocol
, update your Connection String Primary Key in InsightIDR. To do this, complete Task 3 of Configure a Microsoft Azure Event Hub to copy the key and Configure InsightIDR again.
Create or update activity log profilesFailure error
When configuring the Azure Monitor, you may try to save your changes but see an error on the top right of the UI saying Create or update activity log profilesFailure
.
To fix this error:
- Search for Subscriptions in all services.
- Select your subscription and click on Resource Providers in the left hand panel.
- Search for
microsoft.insights
. - Ensure that it is registered by clicking on either Register or Re-Register. Wait for the process to complete.
- Click Refresh.
- Repeat the steps in Configure the Azure Monitor to ensure the activity log saves without error.