Enabling Microsoft Defender for Cloud for Arc Enabled SQL Server Machines
Published Jul 03 2023 04:48 PM 11.4K Views
Microsoft

Welcome back to the third installment of our multi part blog series on enhancing the security and management of Azure Arc Enabled SQL Server. In our previous posts, we explored how to evaluate SQL Server configurations using Best Practices Assessment for Azure Arc Enabled SQL Server (Post 1) and learned how to efficiently onboard multiple SQL servers at scale using Azure Policy (Post 2). Now, in multi part series, we will take another crucial step towards fortifying your SQL Server environment by enabling Microsoft Defender for Cloud on Arc Enabled SQL Server Machines.

 

Microsoft Defender offers robust protection and detection capabilities for SQL servers, safeguarding your databases from potential threats and vulnerabilities. In this blog post, we will explore how Microsoft Defender for SQL servers can help detect and mitigate potential threats to your databases. We'll walk you through the process of enabling Microsoft Defender for Cloud on Azure Arc enabled SQL Server machines, generating incidents and alerts, and reviewing security recommendations to bolster your SQL Server security.

Understanding Microsoft Defender for SQL Servers

 

Microsoft Defender offers robust protection by detecting anomalous activities that indicate unusual and potentially harmful attempts to access or exploit SQL server databases.

 

Alerts for Suspicious Database Activities: Microsoft Defender provides real-time alerts for suspicious database activities, potential vulnerabilities, SQL injection attacks, and unusual database access and query patterns.

 

Protection for Hybrid Environments: Extend your Azure-native SQL server protections to safeguard SQL servers hosted in Azure, multicloud environments, and on-premises machines with Microsoft Defender. It fully supports hybrid environments and safeguards SQL servers hosted in Azure, multicloud environments, and even on-premises machines. Let's explore the supported configurations:

  1. SQL Server on Virtual Machines
  2. On-premises SQL servers
  3. Azure Arc-enabled SQL Server
  4. SQL Server running on Windows machines without Azure Arc
  5. Multicloud SQL servers:
    • Connect your AWS accounts to Microsoft Defender for Cloud
    • Connect your GCP project to Microsoft Defender for Cloud

Identifying Vulnerabilities and Mitigating Threats

The Microsoft Defender plan includes powerful functionality for identifying and mitigating potential database vulnerabilities, ensuring the robustness of your SQL server deployments. Through a comprehensive vulnerability assessment service, you can discover, track, and remediate potential database vulnerabilities. The assessment scans provide a comprehensive overview of your SQL machines' security state and detailed security findings.

 

Prerequisites:

Enabling Microsoft Defender for Cloud on Arc enabled SQL Server Machines

Step 1: Setting up Microsoft Monitoring Agent

 

1. Access Azure Arc by searching for it on the Azure home page and selecting Azure Arc.

 

Ganapathivarma_0-1688398124414.png

 

2. Navigate to All Azure Arc Resources and choose your SQL Server instance (JSLU-Win-SQL-02) Server - Azure Arc resource.

 

Ganapathivarma_1-1688398183524.png

 

3. Check if Microsoft Monitoring Agent is installed under the Extensions section. If it's in the status of Creating, wait for it to become Succeeded.

 

Ganapathivarma_0-1688398502093.png

 

4. Return to the extensions page on your Arc-enabled server and refresh it until the status for MicrosoftMonitoringAgent shows "Succeeded.

 

Ganapathivarma_0-1688420645148.png

 

 

5. If the extension doesn't exist, follow Enable VM insights for Azure Monitor Agent to configure Microsoft Monitoring Agent.

 

6. Once Microsoft Monitoring Agent is successfully installed, proceed with adding Log Analytics Agent - Azure Arc.

Ganapathivarma_1-1688398613847.png

7. Open another Azure Portal window and navigate to your resource group (ArcSql-Levelup). Then, choose your arcsqllevelup Log Analytics Workspace.
8. In the left menu blade, click on Agents, and expand the Log Analytics agent instructions.

 

Ganapathivarma_0-1688401657511.png

 

9. Copy the Workspace ID and Primary key (Workspace Key) from your Log Analytics Workspace and paste them into the add extension page. Click Review + create and then Create.

 

Ganapathivarma_1-1688401718210.png

 

10. Upon completion, you will have the following extensions successfully installed.

 

Ganapathivarma_2-1688401756373.png

 

 

Step 2: Enabling Defender for Cloud

 

1. Search for "defender" on the Azure home page and select Microsoft Defender for Cloud.

2. Click on "Inventory" from the left blade.

 

Ganapathivarma_4-1688401843197.png

 

3.. Navigate to the Inventory page and filter Resource types to "servers - azure arc and sql server - azure arc."

 

Ganapathivarma_5-1688401892194.png

 

4. Check if Defender is already turned on for your Arc-enabled servers and SQL Servers at the subscription level. If not, enable it at the Resource Group level.

 

5. Expand the Tenant Root Group, and subsequently, select your subscription.

 

Ganapathivarma_6-1688402150806.png

 

6. Enable the plans for Servers and Databases, and proceed to click on "Select types" under Pricing for Databases.

 

Ganapathivarma_7-1688402198130.png

 

7. On the Resource types selection page, make sure to enable only "SQL servers on machines" and then proceed by clicking "Continue." Next, Save the settings.

 

Ganapathivarma_10-1688402434784.png

 

 

8. Return to the Environment settings page and click on "Refresh" to view the enabled plans at the subscription level.

 

Ganapathivarma_0-1688404894233.png

 

9. Head over to the Inventory page, where you will notice that Defender for Cloud is now activated for both your Arc-enabled servers and SQL servers.

 

Ganapathivarma_9-1688402317559.png

 

Step 3: Generating Defender for Cloud Incidents and Alerts

 

(Prerequisite) 

  • You can deploy this lab environment  by cloning the repository from the Azure Arc Git repo (Link) using Powershell or Azure Cloud Shell
  • For this demo, the PowerShell script from the provided GitHub repository link is utilized to simulate a brute force attack.

1. Log in to SQL Server machine ( JSLU-Win-SQL-02) that has been deployed for demo. Open PowerShell, change the directory to C:\ArcBoxLevelup, and run .\testDefenderForSQL.ps1, waiting for it to complete. 

 

Ganapathivarma_12-1688402570836.png

 

Ganapathivarma_13-1688402614790.png

 

Step 4: Reviewing Alerts from Defender

 

1. Search for "Azure Arc" on the Azure home page and select Azure Arc.

 

Ganapathivarma_1-1688404974537.png

 

2. Choose your Arc enabled SQL Server machine (JSLU-Win-SQL-02) SQL Server - Azure Arc resource.

 

Ganapathivarma_2-1688405002939.png

 

3. Select Microsoft Defender for Cloud from the left menu blade and review the number of Security alerts.

 

Ganapathivarma_3-1688405038590.png

 

4. Explore further into the Recommendations section by selecting "View additional recommendations" in Defender for Cloud.

 

Ganapathivarma_0-1688410270798.png

 

5. Scroll further to find your alerts and click on the suspected brute-force attack attempt.

 

Ganapathivarma_2-1688412512153.png

 

6. Click anywhere on the alert to view its description.

 

Ganapathivarma_1-1688412336198.png

 

7. Click View full details for more information on the user, client IP address, and cause.

 

Ganapathivarma_0-1688412193120.png

 

8. Take action to review logs and mitigate the attack, suppress alerts, or configure email notifications.

 

Ganapathivarma_2-1688405299524.png

 

9. Repeat the process for the Potential SQL Injection alert.


10. Navigate to the Search panel, enter "Resource Graph," and then proceed to select "Resource Graph Explorer."

Ganapathivarma_3-1688405335490.png

11. Create a new query, execute it, and then choose "Formatted results" to visualize the data. Finally, pin the results to your dashboard for easy access and reference.

 

 

 

 

 

securityresources

| where type == "microsoft.security/locations/alerts"

| project TimeGeneratedUtc = 
properties.TimeGeneratedUtc, Id = tolower(tostring(properties.ResourceIdentifiers[0].AzureResourceId))

, AlertName = properties.AlertDisplayName, Severity = 
properties.Severity, Intent = properties.Intent, Status = properties.Status

, AlertURL = properties.AlertUri

| join kind = inner ( resources

| where type startswith "microsoft.hybridcompute/machines"

| project Id = tolower(tostring(id))

) on Id

| project TimeGeneratedUtc, Id, AlertName, Severity, Intent, Status, AlertURL

 

 

 

 

 

Ganapathivarma_0-1688410843502.png

 

Summary:

In this blog post, we delve into the powerful capabilities of Microsoft Defender for SQL servers, a robust security solution designed to protect your databases from potential threats and vulnerabilities. The post explores how the Defender plan detects and alerts on anomalous activities, potential exploits, and SQL injection attacks, providing enhanced protection for your SQL servers. The blog further discusses how Microsoft Defender extends its protective capabilities to Azure-native SQL servers and hybrid environments, enabling seamless security across various deployment scenarios, including on-premises and multicloud environments.

 

Thanks for reading this blog post. If you have any comments or questions, don’t hesitate to leave them in the comments section. To learn more about the services used in this post, check out the following resources:

3 Comments
Co-Authors
Version history
Last update:
‎Jul 04 2023 03:02 AM
Updated by: