More Info:
Enable Microsoft Defender for Cloud for SQL Server Virtual MachinesRisk Level
HighAddress
Security, Operational MaturityCompliance Standards
CISAZURE, CBP, HITRUSTTriage and Remediation
- Remediation
Remediation
Using Console
Using Console
Sure, here are the step-by-step instructions to remediate the misconfiguration of enabling Microsoft Defender for Cloud for SQL Server Virtual Machines in Azure using the Azure console:
- Log in to the Azure portal (https://portal.azure.com/).
- Navigate to the virtual machine that hosts the SQL Server instance that you want to protect with Microsoft Defender for Cloud.
- Click on the “Networking” option in the left-hand menu.
- Select the “Network Security Group” associated with the virtual machine.
- Click on the “Inbound security rules” option.
- Click on the “Add” button to create a new inbound security rule.
- In the “Add inbound security rule” pane, enter the following details:
- Name: Enter a name for the rule (e.g., “Microsoft Defender for Cloud - SQL Server VM”).
- Priority: Enter a priority for the rule (e.g., “100”).
- Source: Select “Any” to allow traffic from any source IP address.
- Source port ranges: Leave this field blank.
- Destination: Select “VirtualNetwork” to allow traffic to the virtual network that contains the SQL Server VM.
- Destination port ranges: Enter “1433” to allow traffic to the default SQL Server port.
- Protocol: Select “TCP” as the protocol.
- Action: Select “Allow” to allow traffic through the rule.
- Priority: Enter a priority for the rule (e.g., “100”).
- Click on the “Review + create” button to review the details of the new rule.
- Click on the “Create” button to create the new rule.
- Navigate to the “Security Center” option in the left-hand menu.
- Click on the “Recommendations” option.
- Locate the recommendation to enable Microsoft Defender for Cloud for SQL Server Virtual Machines.
- Click on the “Remediate” button to enable Microsoft Defender for Cloud for the SQL Server VM.
- Wait for the remediation process to complete.
Using CLI
Using CLI
To remediate the misconfiguration “Enable Microsoft Defender for Cloud for SQL Server Virtual Machines” for Azure using Azure CLI, follow the below steps:Step 1: Open the Azure CLI and login to your Azure account using the command:Step 2: Once you are logged in, set the subscription in which the SQL Server Virtual Machines are deployed using the command:Step 3: Enable Microsoft Defender for Cloud for SQL Server Virtual Machines using the command:Note: Replace the placeholders with the actual values of your resource group name, workspace ID, storage account ID and policy name.Step 4: Verify that Microsoft Defender for Cloud is enabled for SQL Server Virtual Machines using the command:This command will show the details of the security alert policy for SQL Server Virtual Machines and you can verify that the policy is enabled.By following these steps, you can remediate the misconfiguration “Enable Microsoft Defender for Cloud for SQL Server Virtual Machines” for Azure using Azure CLI.
Using Python
Using Python
To enable Microsoft Defender for Cloud for SQL Server Virtual Machines on Azure using Python, you can follow the below steps:
-
Install the Azure SDK for Python by running the following command:
- Authenticate to your Azure account using the Azure CLI or by providing the credentials in the code.
-
Use the Azure SDK for Python to retrieve the virtual machine you want to enable Microsoft Defender for Cloud on.
-
Use the Azure SDK for Python to retrieve the SQL Server instance running on the virtual machine.
-
Use the Azure SDK for Python to enable Microsoft Defender for Cloud for the SQL Server instance.
Note: Replace the values in the code with your own values.
- Verify that Microsoft Defender for Cloud for SQL Server Virtual Machines is enabled by checking the SQL Server instance in the Azure portal. You have now successfully enabled Microsoft Defender for Cloud for SQL Server Virtual Machines on Azure using Python.

