Skip to main content

More Info:

Enable Vulnerability Assessment (VA) Periodic recurring scans for critical SQL servers and corresponding SQL databases.

Risk Level

Medium

Address

Security

Compliance Standards

  • CIS AZURE
  • Cloudanix Best Practice

Triage and Remediation

Remediation

Using Console

To remediate the misconfiguration “Ensure That Vulnerability Assessment Setting Periodic Recurring Scans Is Set To On” for AZURE using AZURE console, follow the below steps:
  1. Login to the Azure portal using your credentials.
  2. Navigate to the Security Center dashboard from the left-hand side menu.
  3. Click on the “Security policy” tab from the top menu.
  4. Select the subscription and the scope for which you want to configure the vulnerability assessment settings.
  5. Click on the “Edit” button to edit the security policy.
  6. Scroll down to the “Vulnerability Assessment” section and click on the “On” button for “Periodic recurring scans”.
  7. Set the “Recurring scans” frequency as per your requirement.
  8. Click on the “Save” button to save the changes.
Once the above steps are completed, the vulnerability assessment setting for periodic recurring scans will be turned on and the system will perform periodic scans as per the configured frequency.

To remediate the misconfiguration “Ensure That Vulnerability Assessment Setting Periodic Recurring Scans Is Set To On” for Azure using Azure CLI, you can follow the below steps:
  1. Open the Azure CLI command prompt.
  2. Run the following command to enable vulnerability assessment for the specified Azure SQL Server:
    This command will show the current status of vulnerability assessment for the specified Azure SQL Server.
  3. Run the following command to enable periodic recurring scans for the specified Azure SQL Server:
    This command will enable periodic recurring scans for the specified Azure SQL Server with a frequency of 1 day.
  4. Verify the vulnerability assessment settings by running the following command:
    This command will show the updated status of vulnerability assessment for the specified Azure SQL Server.
By following these steps, you can remediate the misconfiguration “Ensure That Vulnerability Assessment Setting Periodic Recurring Scans Is Set To On” for Azure using Azure CLI.
To remediate the misconfiguration “Ensure That Vulnerability Assessment Setting Periodic Recurring Scans Is Set To On” in Azure using Python, you can use the Azure SDK for Python. Here are the steps to remediate the issue:
  1. Install the Azure SDK for Python using the following command:
  1. Import the necessary modules:
  1. Set up the credentials and the client:
  1. Get the security policy for your subscription:
  1. Update the vulnerability assessment setting to enable periodic recurring scans:
This will enable the vulnerability assessment setting for periodic recurring scans in Azure.
Substitute:
  • SQL_SERVER_NAME with your Azure SQL logical server name.
  • RESOURCE_GROUP_NAME with the server’s resource group.
  • AZURE_REGION with the region of the server, e.g. "eastus".
  • SQL_ADMIN_LOGIN / SQL_ADMIN_PASSWORD with your admin credentials.
  • VA_STORAGE_ACCOUNT_NAME with a globally-unique storage account name.
  • SECURITY_TEAM_EMAIL@example.com with one or more security notification emails.
This change does not force replacement of the SQL server; it adds/updates the server vulnerability assessment configuration to enable periodic recurring scans.After applying, terraform plan should show creation or update of azurerm_mssql_server_vulnerability_assessment.SQL_SERVER_VA with recurring_scans.enabled set to true.

Additional Reading: