Virtual Network should have DDoS protection enabled

High Azure General vnet-ddos-protection

Applies to

  • Microsoft.Network/virtualNetworks

What CGPulse checks

A resource passes this rule when ddosProtectionPlan.enabled must equal true. Anything else is reported as a finding with the evaluated property value attached as evidence.

How to fix it

Enable DDoS protection to defend against volumetric attacks. In Azure Portal: VNet > DDoS protection > associate with a DDoS Protection Plan. See: https://learn.microsoft.com/en-us/azure/ddos-protection/manage-ddos-protection

CLI

az network vnet update --ids "{id}" --ddos-protection-plan "<ddos-plan-id>" --ddos-protection true

Bicep

param location string = resourceGroup().location

resource ddosPlan 'Microsoft.Network/ddosProtectionPlans@2023-11-01' = {{
  name: '{name}-ddos-plan'
  location: location
}}

resource vnet 'Microsoft.Network/virtualNetworks@2023-11-01' existing = {{
  name: '{name}'
}}
// TODO: Associate the DDoS plan with the VNet by updating the VNet's ddosProtectionPlan property

Terraform

resource "azurerm_network_ddos_protection_plan" "{name}" {
  name                = "{name}-ddos-plan"
  resource_group_name = "{rg}"
  location            = var.location
}
resource "azurerm_virtual_network" "{name}" {
  name                = "{name}"
  resource_group_name = "{rg}"
  location            = var.location
  address_space       = ["10.0.0.0/16"]
  ddos_protection_plan {
    id     = azurerm_network_ddos_protection_plan.{name}.id
    enable = true
  }
}

Compliance frameworks

Vendor documentation

Is your environment compliant with this rule?

CGPulse checks it — and 621 others — against your Azure and AWS accounts with read-only access.

Run a free scan

Related Azure rules

Rejoining the server...

Rejoin failed... trying again in seconds.

Failed to rejoin.
Please retry or reload the page.

The session has been paused by the server.

Failed to resume the session.
Please reload the page.