Skip to main content

More Info:

Ensure that monitoring of DDoS protection at the Azure virtual network level is enabled.

Risk Level

High

Address

Operational Maturity, Security

Compliance Standards

  • Cloudanix Best Practice

Triage and Remediation

Remediation

Using Console

Sure, here are the step-by-step instructions to remediate the misconfiguration “Enable DDoS Protection Standard Monitoring for Public Virtual Networks” in Azure using the Azure console:
  1. Login to the Azure Portal (https://portal.azure.com/)
  2. Select the subscription and resource group that contains the virtual network you want to protect.
  3. In the Azure portal, search for “DDoS protection plans” in the search bar.
  4. Select “DDoS protection plans” from the search results.
  5. Click on ”+ Add” to create a new DDoS protection plan.
  6. In the “Basics” tab, enter a name for the plan and select the subscription and resource group that contains the virtual network you want to protect.
  7. In the “Settings” tab, select “Standard” as the DDoS protection plan tier.
  8. In the “Review + create” tab, review the settings and click on “Create” to create the DDoS protection plan.
  9. Once the DDoS protection plan is created, go to the virtual network that you want to protect.
  10. In the virtual network’s “Settings” menu, select “DDoS protection”.
  11. Under “DDoS protection plan”, select the DDoS protection plan that you created in step 5.
  12. Click on “Save” to save the changes.
That’s it! You have now enabled DDoS Protection Standard Monitoring for Public Virtual Networks in Azure.

To remediate the misconfiguration “Enable DDoS Protection Standard Monitoring for Public Virtual Networks” in AZURE using AZURE CLI, follow the below steps:Step 1: Open the AZURE CLI on your local machine or use the AZURE Cloud Shell.Step 2: Login to your AZURE account using the below command:
Step 3: Once you are logged in, set the default subscription using the below command:
Step 4: To enable DDoS Protection Standard Monitoring for Public Virtual Networks, run the below command:
Replace the below placeholders with appropriate values:
  • <ddos_protection_name>: Name of the DDoS protection plan.
  • <resource_group_name>: Name of the resource group where the DDoS protection plan needs to be created.
  • <location_name>: Location where the DDoS protection plan needs to be created.
  • <tags>: Tags for the DDoS protection plan.
Note: If you want to enable DDoS protection for an existing virtual network, you need to update the virtual network configuration to associate it with the DDoS protection plan.Step 5: Verify the DDoS Protection Standard Monitoring is enabled for the Public Virtual Network by running the below command:
This will return the DDoS protection plan ID associated with the virtual network. If it returns null, it means DDoS protection is not enabled for the virtual network.With these steps, you have successfully remediated the misconfiguration “Enable DDoS Protection Standard Monitoring for Public Virtual Networks” in AZURE using AZURE CLI.
To remediate the misconfiguration “Enable DDoS Protection Standard Monitoring for Public Virtual Networks” in Azure using Python, you can follow the below steps:
  1. Import the necessary modules:
  1. Set the credentials:
  1. Instantiate the NetworkManagementClient:
  1. Get the list of public IP addresses:
  1. For each public IP address, check if DDoS protection is enabled. If not, enable it:
This code will check for all the public IP addresses in your Azure subscription and enable DDoS protection standard monitoring for each public IP address that does not already have it enabled.Note: Make sure to replace the placeholders like <subscription_id>, <client_id>, <client_secret>, <tenant_id>, <resource_group_name> with the appropriate values for your Azure environment.
This does not force replacement of any existing virtual networks; it only adds a new policy assignment.For verification, terraform plan should show creation of a single azurerm_policy_assignment.ddos_protection_standard_monitoring resource with policy_definition_id set to the DDoS monitoring policy/initiative ID and no changes to existing resources.