More Info:
Ensure that monitoring of DDoS protection at the Azure virtual network level is enabled.Risk Level
HighAddress
Operational Maturity, SecurityCompliance Standards
- Cloudanix Best Practice
Triage and Remediation
- Remediation
Remediation
Using Console
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:
- Login to the Azure Portal (https://portal.azure.com/)
- Select the subscription and resource group that contains the virtual network you want to protect.
- In the Azure portal, search for “DDoS protection plans” in the search bar.
- Select “DDoS protection plans” from the search results.
- Click on ”+ Add” to create a new DDoS protection plan.
- 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.
- In the “Settings” tab, select “Standard” as the DDoS protection plan tier.
- In the “Review + create” tab, review the settings and click on “Create” to create the DDoS protection plan.
- Once the DDoS protection plan is created, go to the virtual network that you want to protect.
- In the virtual network’s “Settings” menu, select “DDoS protection”.
- Under “DDoS protection plan”, select the DDoS protection plan that you created in step 5.
- Click on “Save” to save the changes.
Using CLI
Using CLI
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: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.
<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.
Using Python
Using Python
To remediate the misconfiguration “Enable DDoS Protection Standard Monitoring for Public Virtual Networks” in Azure using Python, you can follow the below steps: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
- Import the necessary modules:
- Set the credentials:
- Instantiate the NetworkManagementClient:
- Get the list of public IP addresses:
- For each public IP address, check if DDoS protection is enabled. If not, enable it:
<subscription_id>, <client_id>, <client_secret>, <tenant_id>, <resource_group_name> with the appropriate values for your Azure environment.Using Terraform
Using Terraform
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.
