Table of Contents | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Introduction
Microsoft Azure, often referred to as Azure is a cloud computing platform run by Microsoft. It offers access, management, and the development of applications and services through global data centers. It also provides a range of capabilities, including software as a service (SaaS), platform as a service (PaaS), and infrastructure as a service (IaaS).
...
This setup guide will cover the basic required setup for the SNARE - Azure cloud log collection to work. Security related setup, charges you may incur, and other intricacies related to Microsoft Azure will not be covered in detail in this guide.
Overview
Logging is a crucial component of all All applications, both whether on-premises or in the cloud and on-premises, helping with troubleshooting and implementing security of compliance standards, must include logging since it aids in security implementation and debugging. Azure provides services in order to collect cloud platform logs to ensure optimal application performance.
Snare Central can be configured to collect activity and resource or diagnostic logs from Azure using Log Analytics API.
...
Snare Central needs to request authentication keys from Microsoft Entra ID in order to connect to the Log Analytics API. Once authentication is accepted and the required API permission(s) were , required API permissions are granted, and access control is setup, Snare Central will be able to query the target activity and diagnostic logs using the same API.
About Azure platform logs
Below are the types of logs that can be collected from Azure (Snare Central supports the collection some log types, see details here for the supported log types).
Microsoft Entra logs
Microsoft Entra logs contain the history of sign-in activity and an audit trail of changes made in Microsoft Entra ID for a particular tenant.
Types of activity logs in Microsoft Entra ID: Sign-in logs and Audit logs
Activity logs
It provides insight into the operations on each Azure resource and use to determine what, who, and when for any write operations (PUT, POST, DELETE) taken on the resources in your subscription.
There's a single activity log for each Azure subscription.
Resource logs
Resource logs provide an insight into operations that were performed within an Azure resource, known as the data plane. Examples include getting a secret from a key vault or making a request to a database.
Log contents vary according to the Azure service and resource type.
Logs aren't collected until they're routed to a destination, to be enabled and configured via Diagnostic settings. While some Azure resource may have some special type of logs (e.g. Azure NSG - Flow logs)
Snare Central and Log Analytics API communication
In order for the Snare Central to properly communicate to and collect Azure logs using from the Log Analytics API, these things the following steps need to be created and setup first on Azure sidecompleted in Azure environment:
Register Snare Central in Microsoft Entra ID.
Create and setup Log Analytics workspace.workspace
Set up the workspace Access Control (IAM)
Export activity and diagnostic logs to a Log Analytics workspace.
Register Snare Central in Microsoft Entra ID
To allow Snare Central to access the Log Analytics API, Snare Central must be registered in Microsoft Entra ID formerly known as Azure Active Directory (AD). This allows the Snare Central to establish an identity and specify the needed permission levels for the API access.
The Log Analytics API use uses Microsoft Entra ID to provide authentication services that you can use to setup the necessary permission rights for the Snare Central to access them.
Expand | ||
---|---|---|
| ||
Step 1: App registration
Step 2: Key or client secret generation
Step 3: Setting up APIs permissions
|
About Azure logs
Azure Monitor Logs
Logs are recorded system events and can contain different types of data, be structured or free-form text, and they contain a timestamp. Azure Monitor stores structured and unstructured log data of all types in Azure Monitor Logs. It is also a feature of Azure Monitor that collects and organizes log and performance data from monitored resources.
Azure Platform Logs
Azure Platform logs provide detailed diagnostic and auditing information for Azure resources and the Azure platform they depend on. They are automatically generated although you need to configure certain platform logs to be forwarded to one or more destinations to be retained.
Azure Monitor Logs can be exported into a Log Analytics workspaces for querying and analysis. Snare Central can connect to the Log Analytics Workspace to collect the
Log Analytics workspaces
Azure Monitor Logs stores the data that it collects in one or more Log Analytics workspaces. You must create at least one workspace to use Azure Monitor Logs.
A Log Analytics workspace is a unique environment for log data from Azure Monitor and other Azure services. Each workspace has its own data repository and configuration but might combine data from multiple services.
Azure Monitor Log Analytics API
The Log Analytics Query API is a REST API that you can use to query the full set of data collected by Azure Monitor logs. You can use the same query language that's used throughout the service. Use this API to retrieve data, build new visualizations of your data, and extend the capabilities of Log Analytics.
Azure Platform Logs
Types of platform logs
Microsoft Entra logs
Microsoft Entra logs contain the history of sign-in activity and an audit trail of changes made in Microsoft Entra ID for a particular tenant.
The features of Microsoft Entra monitoring, and health provide a comprehensive view of identity related activity in your environment.
Types of activity logs in Microsoft Entra ID:
Audit logs provide you with records of system activities for compliance, including the history of every task performed in your tenant.
Sign-in logs capture the sign-in attempts of your users and client applications.
Activity logs
Formerly known as operational logs and audit logs.
It provides insight into the operations on each Azure resource and use to determine what, who, and when for any write operations (PUT, POST, DELETE) taken on the resources in your subscription.
There's a single activity log for each Azure subscription.
Resource logs
Resource logs were previously referred to as diagnostic logs.
Resource logs provide an insight into operations that were performed within an Azure resource, known as the data plane. Examples include getting a secret from a key vault or making a request to a database.
The contents of resource logs vary according to the Azure service and resource type.
Logs aren't collected until they're routed to a destination, to be enabled and configured via Diagnostic settings. While some Azure resource may have some special type of logs (e.g. Azure NSG - Flow logs)
Notes
https://learn.microsoft.com/en-us/azure/azure-monitor/logs/api/overview
https://azure.microsoft.com/en-us/pricing/details/monitor/
...
Create Log Analytics workspace
When Azure collects logs and data, the information is stored in a workspace. A workspace has a unique workspace ID and resource ID. After you've created a workspace, you can configure the Azure resource(s) to send the activity logs and diagnostic logs to the created workspace.
Snare Central can query and collect logs from the created workspace using the Log Analytics API.
Expand | ||
---|---|---|
| ||
Creating a workspace
|
Set up the workspace Access Control (IAM)
Expand | ||
---|---|---|
| ||
Setting up Access Control (IAM)
|
Export activity and diagnostic logs to a Log Analytics workspace.
Expand | ||
---|---|---|
| ||
Export activity logs to a Log Analytics workspace
Export diagnostic logs to the Log Analytics workspace
|
Setting Up Snare Central - Azure Cloud Log Collection
Starting from Snare Central v8.6.0, Azure Cloud Log Collection functionality is available as long as you have the proper license for it.
This capability requires a license with either Office 365 Logs Collection (IA_CLOUD_O365) or Cloud Logs Collection (IA_CLOUD) license features.
This guide will help you setup up your Snare Central and start collecting supported Azure activity and resource logs in no-time by simply using the intuitive Cloud Log Collection Configuration Web UI of Snare Central.
Info |
---|
For more info about the supported Azure Log types, see: Supported Azure Log Types. |
Expand | ||
---|---|---|
| ||
Step 1. Go to Snare Central and navigate to System > Administrative Tools > Cloud Log Collection Configuration. Step 2. Select Azure Cloud and Click ADD CLOUD COLLECTION button. Step 3. Input all the necessary Azure Cloud Collection Configuration Information and click Test Connection Button to check if the configuration is correct and can properly connect to the Log Analytics API.
Step 4. Click ADD button, then you should be able to see the added Azure Cloud Log Collector under the Azure Cloud Collection List. |
Updating/Deleting - Azure Cloud Log Collection Configuration
If you want to update or delete an existing Azure Cloud - Log Collector that were previously configured, you can simply use the Snare Central’s Cloud Log Collection Configuration Web UI and follow the simple steps below.
Expand | ||
---|---|---|
| ||
Step 1. Go to Snare Central and navigate to System > Administrative Tools > Cloud Log Collection Configuration. Step 2. Select Azure Cloud and Click the Azure Cloud Log Collector that you want to update. Step 3. In the Edit screen, you can update the configuration and optionally do a Test Connection to check if the updated configuration can successfully connect to the Log Analytics API, then simply click the SAVE button to save the updated configuration. |
Expand | ||
---|---|---|
| ||
Step 1. Go to Snare Central and navigate to System > Administrative Tools > Cloud Log Collection Configuration. Step 2. Select Azure Cloud and Click the Azure Cloud Collector that you want to delete.
|
Troubleshooting Guide
This guide will be your resource for resolving common issues and challenges that you may encounter with Azure - Cloud Log Collection.
Azure Cloud icon is gray in System > Administrative Tools > Cloud Log Collection Configuration Web UI.
Expand | ||
---|---|---|
| ||
When Azure Cloud icon in Cloud Log Providers list is gray, it is possible that Snare Central does not have IA_CLOUD or IA_CLOUD_O365 license.
You can check it via navigating to Status > Snare Health Checker or simply click the heart icon in the lower left corner of Snare Central and scroll down to Snare Central License and select Show Details to view the License Information.
If there are no IA_CLOUD or IA_CLOUD_O365 in the License Information, then you needed the correct license with IA_CLOUD or IA_CLOUD_O365. Once you have the correct license, click License Page button.
In the License Update page, click Browse button and navigate to the correct license then click Load License button. Wait for a while then navigate to System > Administrative Tools > Cloud Log Collection Configuration and you should be able to see Azure Cloud icon is now green and you should be able to Add Azure Cloud Collection. |
Azure Cloud Log Collector icon is gray, and the Status is Not Running (Disabled by configuration)
Expand | ||
---|---|---|
| ||
When your configured Azure Cloud Log Collector icon is gray, it is possible that the log collector is disabled during configuration or toggled off. Select the Azure Cloud Log Collector and check if Status: Not Running (Disabled by configuration) To enable Azure Cloud Log Collector, simply toggle on the Enable button beside its name in Cloud Log Providers or the one in the upper right corner beside the Edit icon, then click Confirm in the pop-up dialog box. Once toggled to ON, the configured Azure Cloud Log Collector icon should be green and enabled. Snare Central will now start collecting Azure activity and platform Logs (assuming that the configuration parameters were valid and working). |
Azure Cloud Log Collector icon is red, and the Status is Not Running (Could not generate access token for ….)
Expand | ||
---|---|---|
| ||
When the Azure Cloud Log Collector icon is red and Status is Not Running (Could not generate access token for ….), it is possible that the Client ID or Client Secret is invalid or expired. Go to Azure portal site and check if Tenant ID is correct or if the Client ID and Client Secret is not yet expired or check if the value entered in the Snare Central cloud collection configuration is correct. If the value entered in the Snare Central Configuration is incorrect, you can simply edit it by clicking the Edit icon on the upper left corner. |
Azure Cloud Log Collector icon is red, and the Status is Not Running (The provided credentials have insufficient access …)
Expand | ||
---|---|---|
| ||
When the Azure Cloud Log Collector icon is red and Status: Not Running (The provided credentials have insufficient access …), it is possible that the Log Analytics API permission is not properly set, or the Log Analytics workspace’s access control was not properly configured. Go to the Azure portal site, check the assigned application at Application Registration, and verify if the permissions were properly set. See App Registration guide above, to identify whether API has the correct permission. If the permission is correct, then check the Log Analytics workspace’s access control to see if it's properly configured. See Setting up workspace Access Control guide, to identify whether access control is properly configured or not. Update and configure the necessary API permission and workspace’s access control then re-enable the collector by Disabling and Enabling Azure Cloud Log Collector again after 5 minutes (it may take a while for the new settings to reflect on the entire Azure environment). |
Azure Cloud Log Collector icon is red, and the Status is Not Running (The workspace could not be found for logtype ...)
Expand | ||
---|---|---|
| ||
When the Azure Cloud Log Collector icon is red and Status: Not Running (The workspace could not be found for logtype ...), it is possible that the configured Workspace ID is incorrect or does not exist. Go to Azure portal site and search for the target Log Analytics workspace and check if the Workspace ID value entered in the Snare Central cloud collection configuration is correct. If the Workspace ID value entered in the Snare Central Configuration is incorrect, you can simply edit and update it by clicking the Edit icon on the upper left corner. If Log Analytics workspace does not exist, then you need to create a new Log Analytic workspace (See Create Log Analytics workspace guide), setup the necessary access control (See Setting up workspace Access Control guide) and edit the Workspace ID on the collector’s configuration. |
Azure Cloud Log Collector icon is red, and the Status is Not Running (Cannot connect to microsoft API, please check the IP configuration …)
Expand | ||
---|---|---|
| ||
When the Azure Cloud Log Collector icon is red and the Status is Status: Not Running (Cannot connect to microsoft API, please check the IP configuration of the Snare Central.), it is possible that the IP Configuration is incorrect. Go to Snare Central and navigate to System > Administrative Tools > Configuration Wizard > IP Address Configuration then check if the IP Configuration parameters were correct (most of the time the problem lies on the Domain Name Server(s)). After updating the necessary IP Configuration parameter/s, re-enable the collector by Disabling and Enabling Azure Cloud Log Collector again after 1 minutes. |
Azure Cloud Log Collector icon is red, and the Status is Not Running (Cannot connect to proxy server, ….)
Expand | ||
---|---|---|
| ||
When the Azure Cloud Log Collector icon is red and the Status is Status: Not Running (Cannot connect to proxy server, ….), it is possible that the proxy was enabled in the Snare Central with incorrect settings. Go to Snare Central and navigate to System > Administrative Tools > Configuration Wizard > Network Services then Proxy Settings, check the following:
After updating the necessary Proxy Settings or configuring the proper firewall settings, re-enable the collector by Disabling and Enabling Azure Cloud Log Collector again after 1 minute. |
Azure Cloud Log Collector icon is red, and the Status is Not Running (Invalid proxy credentials...)
Expand | ||
---|---|---|
| ||
When the Azure Cloud Log Collector icon is red and the Status is Status: Not Running (Invalid proxy credentials, please re-configure these parameters.), it is possible that the proxy was enabled in the Snare Central with incorrect settings. Go to Snare Central and navigate to System > Administrative Tools > Configuration Wizard > Network Services then Proxy Settings, check the following.
|
Azure Cloud Log Collector icon is red, and the Status is Not Running (Invalid proxy type…)
Expand | ||
---|---|---|
| ||
When the Azure Cloud Log Collector icon is red and the Status is Status: Not Running (Invalid proxy type, please re-configure 'type' based on the actual proxy server type.), it is possible that the proxy was enabled in the Snare Central with incorrect settings. Go to Snare Central and navigate to System > Administrative Tools > Configuration Wizard > Network Services then Proxy Settings, check the following:
After updating the necessary Proxy Settings or configuring the proper firewall settings, re-enable the collector by Disabling and Enabling Azure Cloud Log Collector again after 1 minute. |