Triage and Remediation
- Remediation
Remediation
Using Console
Using Console
To remediate the “Monitor SQL Encryption setting is not enabled” misconfiguration in AZURE using the AZURE console, follow the below steps:
- Login to the AZURE portal (https://portal.azure.com/).
- Navigate to the “SQL servers” option from the left navigation pane.
- Select the SQL server for which you want to enable the encryption setting.
- Click on the “Security” option from the left navigation pane.
- Select the “Auditing & Threat detection” option.
- Click on the “Advanced Threat Protection” option.
- Scroll down to the “SQL Advanced Threat Protection” section.
- Click on the “Edit” button.
- Enable the “Monitor SQL Encryption setting” option.
- Click on the “Save” button to save the changes.
Using CLI
Using CLI
To remediate the “Monitor SQL Encryption setting is not enabled” misconfiguration in Azure using Azure CLI, follow the below steps:Step 1: Open Azure CLI and login to your Azure account using the command:Step 2: Once you are logged in, set the Azure subscription where your SQL Server is located using the command:Step 3: Check if the SQL Encryption setting is enabled or not using the command:Step 4: If the SQL Encryption setting is not enabled, enable it using the command:Step 5: Verify that the SQL Encryption setting is enabled by running the command in Step 3 again.By following these steps, you can remediate the “Monitor SQL Encryption setting is not enabled” misconfiguration in Azure using Azure CLI.
Using Python
Using Python
To remediate the “Monitor SQL Encryption setting is not enabled” misconfiguration in Azure using Python, you can follow the below steps:The above steps will remediate the “Monitor SQL Encryption setting is not enabled” misconfiguration in Azure using Python.
- Import the necessary libraries:
- Authenticate to Azure using the
DefaultAzureCredentialclass:
- Instantiate the
SecurityCenterclient using the credential:
- Get the security policy for SQL encryption:
- If the
sqlEncryptionsetting is not enabled, enable it and update the security policy:
Using Terraform
Using Terraform
POLICY_DEFINITION_ID_FOR_MONITOR_SQL_ENCRYPTION with the full resource ID of the built‑in Azure Policy (or initiative) that turns on the “Monitor SQL Encryption” recommendation in Microsoft Defender for Cloud (Azure Security Center) for virtual machines, e.g. copied from the Azure Portal’s Policy blade.Changing policy_definition_id on an existing azurerm_policy_assignment forces replacement of that policy assignment; any dependent processes relying on the old assignment will see it removed and the new one created.For verification, terraform plan should show this policy assignment being created (or updated/replaced if you are modifying an existing one), with the policy_definition_id set to the desired “Monitor SQL Encryption” policy and the scope matching the subscription or management group where you want the recommendation enforced.
