Skip to main content

More Info:

Enable Vulnerability Assessment (VA) setting Also send email notifications to admins and subscription owners

Risk Level

Medium

Address

Security

Compliance Standards

  • CIS AZURE
  • Cloudanix Best Practice

Triage and Remediation

Remediation

Using Console

To remediate this misconfiguration in Azure using the Azure console, follow these steps:
  1. Log in to the Azure portal (https://portal.azure.com/).
  2. Navigate to the Security Center dashboard.
  3. Click on “Security policy” on the left-hand side of the screen.
  4. Select the subscription you want to remediate.
  5. Click on “Vulnerability assessment settings” in the “Security policy” window.
  6. Ensure that the “Email notifications to subscription owners and admins” toggle is turned on.
  7. If the toggle is not turned on, click on the toggle to turn it on.
  8. Click on “Save” to save the changes.
Once you have completed these steps, the vulnerability assessment setting will be configured to send email notifications to subscription owners and admins in case of any security issues.

To remediate the misconfiguration “Ensure Vulnerability Assessment Setting To Send Email Notifications To Admins And Subscription Owners Is Set” for Azure using Azure CLI, follow the below steps:
  1. Open the Azure CLI on your computer.
  2. Login to your Azure account using the command: az login
  3. Select the Azure subscription in which the misconfiguration exists using the command: az account set --subscription <subscription_id> Replace <subscription_id> with the ID of your Azure subscription.
  4. Run the below command to enable email notifications for vulnerability assessment: az security va-notification-contacts create --email <email_address> --phone <phone_number> --alert-notifications true --security-contact-name <contact_name> Replace <email_address> with the email address of the admin or subscription owner who needs to receive the email notifications. Replace <phone_number> with the phone number of the admin or subscription owner who needs to receive the SMS notifications. Replace <contact_name> with the name of the contact to be created.
  5. If you want to verify that the email notifications have been enabled, you can run the below command: az security va-notification-contacts list This command will list all the notification contacts that have been created.
By following the above steps, you can remediate the misconfiguration “Ensure Vulnerability Assessment Setting To Send Email Notifications To Admins And Subscription Owners Is Set” for Azure using Azure CLI.
To remediate the misconfiguration “Ensure Vulnerability Assessment Setting To Send Email Notifications To Admins And Subscription Owners Is Set” for Azure using Python, follow the below steps:
  1. Import the required libraries:
  1. Authenticate to Azure using the DefaultAzureCredential:
  1. Get the current email notification settings:
  1. Check if the email notification settings are configured to send notifications to admins and subscription owners:
  1. Create a new email notification subscription:
  1. Verify that the email notification subscription was created successfully:
By following these steps, you can remediate the misconfiguration “Ensure Vulnerability Assessment Setting To Send Email Notifications To Admins And Subscription Owners Is Set” for Azure using Python.
This change does not replace the existing SQL server; it adds/enables the Vulnerability Assessment configuration on it. After applying, terraform plan should show creation or update of azurerm_mssql_server_vulnerability_assessment.sql_server_va with recurring_scans.email_subscription_admins = true.

Additional Reading: