last sync: 2020-Jul-03 15:47:34 UTC

Azure Policy

Virtual networks should use specified virtual network gateway

Policy DisplayName Virtual networks should use specified virtual network gateway
Policy Id f1776c76-f58c-4245-a8d0-2b207198dc8b
Policy Category Network
Policy Description This policy audits any virtual network if the default route does not point to the specified virtual network gateway.
Policy Mode Indexed
Policy Type BuiltIn
Policy in Preview FALSE
Policy Deprecated FALSE
Policy Effect Default: AuditIfNotExists
Allowed: (AuditIfNotExists,Disabled)
Roles used none
Policy Changes
Date/Time (UTC ymd) (i) Change Change detail
2019-10-11 00:02:54 add: Policy f1776c76-f58c-4245-a8d0-2b207198dc8b
Used in Policy Initiative(s)
Initiative DisplayName Initiative Id
[Preview]: Azure Security Benchmark 42a694ed-f65e-42b2-aa9e-8052e9740a92
Policy Rule
{
  "properties": {
    "displayName": "Virtual networks should use specified virtual network gateway",
    "policyType": "BuiltIn",
    "mode": "Indexed",
    "description": "This policy audits any virtual network if the default route does not point to the specified virtual network gateway.",
    "metadata": {
      "version": "1.0.0",
      "category": "Network"
    },
    "parameters": {
      "effect": {
        "type": "String",
        "metadata": {
          "displayName": "Effect",
          "description": "Enable or disable the execution of the policy"
        },
        "allowedValues": [
          "AuditIfNotExists",
          "Disabled"
        ],
        "defaultValue": "AuditIfNotExists"
      },
      "virtualNetworkGatewayId": {
        "type": "String",
        "metadata": {
          "displayName": "Virtual network gateway Id",
          "description": "Resource Id of the virtual network gateway. Example: /subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroup/providers/Microsoft.Network/virtualNetworkGateways/Name"
        }
      }
    },
    "policyRule": {
      "if": {
        "field": "type",
        "equals": "Microsoft.Network/virtualNetworks"
      },
      "then": {
      "effect": "[parameters('effect')]",
        "details": {
          "type": "Microsoft.Network/virtualNetworks/subnets",
          "name": "GatewaySubnet",
          "existenceCondition": {
            "not": {
            "field": "Microsoft.Network/virtualNetworks/subnets/ipConfigurations[*].id",
            "notContains": "[concat(parameters('virtualNetworkGatewayId'), '/')]"
            }
          }
        }
      }
    }
  },
  "id": "/providers/Microsoft.Authorization/policyDefinitions/f1776c76-f58c-4245-a8d0-2b207198dc8b",
  "type": "Microsoft.Authorization/policyDefinitions",
  "name": "f1776c76-f58c-4245-a8d0-2b207198dc8b"
}