last sync: 2020-Sep-29 13:46:04 UTC

Azure Policy

Virtual machines should be connected to an approved virtual network

Policy DisplayName Virtual machines should be connected to an approved virtual network
Policy Id d416745a-506c-48b6-8ab1-83cb814bcaa3
Policy Category Network
Policy Description This policy audits any virtual machine connected to a virtual network that is not approved.
Policy Mode Indexed
Policy Type BuiltIn
Policy in Preview FALSE
Policy Deprecated FALSE
Policy Effect Default: Audit
Allowed: (Audit,Deny,Disabled)
Roles used none
Policy Changes
Date/Time (UTC ymd) (i) Change Change detail
2019-10-11 00:02:54 add: Policy d416745a-506c-48b6-8ab1-83cb814bcaa3
Used in Policy Initiative(s)
Initiative DisplayName Initiative Id
[Preview]: Azure Security Benchmark 42a694ed-f65e-42b2-aa9e-8052e9740a92
HITRUST/HIPAA a169a624-5599-4385-a696-c8d643089fab
Policy Rule
{
  "properties": {
    "displayName": "Virtual machines should be connected to an approved virtual network",
    "policyType": "BuiltIn",
    "mode": "Indexed",
    "description": "This policy audits any virtual machine connected to a virtual network that is not approved.",
    "metadata": {
      "version": "1.0.0",
      "category": "Network"
    },
    "parameters": {
      "effect": {
        "type": "String",
        "metadata": {
          "displayName": "Effect",
          "description": "The effect determines what happens when the policy rule is evaluated to match"
        },
        "allowedValues": [
          "Audit",
          "Deny",
          "Disabled"
        ],
        "defaultValue": "Audit"
      },
      "virtualNetworkId": {
        "type": "String",
        "metadata": {
          "displayName": "Virtual network Id",
          "description": "Resource Id of the virtual network. Example: /subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Network/virtualNetworks/Name"
        }
      }
    },
    "policyRule": {
      "if": {
        "allOf": [
          {
            "field": "type",
            "equals": "Microsoft.Network/networkInterfaces"
          },
          {
            "not": {
            "field": "Microsoft.Network/networkInterfaces/ipconfigurations[*].subnet.id",
            "like": "[concat(parameters('virtualNetworkId'),'/*')]"
            }
          }
        ]
      },
      "then": {
      "effect": "[parameters('effect')]"
      }
    }
  },
  "id": "/providers/Microsoft.Authorization/policyDefinitions/d416745a-506c-48b6-8ab1-83cb814bcaa3",
  "type": "Microsoft.Authorization/policyDefinitions",
  "name": "d416745a-506c-48b6-8ab1-83cb814bcaa3"
}