Gallery › Security Center › Azure built-in policies
IP Forwarding on your virtual machine should be disabled
Converted Policy AuditIfNotExists Disabled Mode All Version 3.0.0
Enabling IP forwarding on a virtual machine's NIC allows the machine to receive traffic addressed to other destinations. IP forwarding is rarely required (e.g., when using the VM as a network virtual appliance), and therefore, this should be reviewed by the network security team.
ConvertTo-Bylaw converted this policy, and proved that the file compiles back to the same definition.
Azure Policy JSONASC_IPForwardingOnVirtualMachines_Audit.json · 55 lines
{
"properties": {
"displayName": "IP Forwarding on your virtual machine should be disabled",
"policyType": "BuiltIn",
"mode": "All",
"description": "Enabling IP forwarding on a virtual machine's NIC allows the machine to receive traffic addressed to other destinations. IP forwarding is rarely required (e.g., when using the VM as a network virtual appliance), and therefore, this should be reviewed by the network security team.",
"metadata": {
"version": "3.0.0",
"category": "Security Center"
},
"version": "3.0.0",
"parameters": {
"effect": {
"type": "string",
"defaultValue": "AuditIfNotExists",
"allowedValues": [
"AuditIfNotExists",
"Disabled"
],
"metadata": {
"displayName": "Effect",
"description": "Enable or disable the execution of the policy"
}
}
},
"policyRule": {
"if": {
"field": "type",
"in": [
"Microsoft.Compute/virtualMachines",
"Microsoft.ClassicCompute/virtualMachines"
]
},
"then": {
"effect": "[parameters('effect')]",
"details": {
"type": "Microsoft.Security/assessments",
"name": "c3b51c94-588b-426b-a892-24696f9e54cc",
"existenceCondition": {
"field": "Microsoft.Security/assessments/status.code",
"in": [
"NotApplicable",
"Healthy"
]
}
}
}
},
"versions": [
"3.0.0"
]
},
"id": "/providers/Microsoft.Authorization/policyDefinitions/bd352bd5-2853-4985-bf0d-73806b4a5744",
"name": "bd352bd5-2853-4985-bf0d-73806b4a5744"
}Bylawbd352bd5-2853-4985-bf0d-73806b4a5744.bylaw.ps1 · 33 lines
# Converted from ASC_IPForwardingOnVirtualMachines_Audit.json by ConvertTo-Bylaw.
Policy 'bd352bd5-2853-4985-bf0d-73806b4a5744' {
Properties @{
DisplayName = 'IP Forwarding on your virtual machine should be disabled'
Description = 'Enabling IP forwarding on a virtual machine''s NIC allows the machine to receive traffic addressed to other destinations. IP forwarding is rarely required (e.g., when using the VM as a network virtual appliance), and therefore, this should be reviewed by the network security team.'
Version = '3.0.0'
Category = 'Security Center'
PolicyVersion = '3.0.0'
Mode = 'All'
}
Parameter Effect @{
Type = 'string'
AllowedValues = @('AuditIfNotExists', 'Disabled')
Default = 'AuditIfNotExists'
DisplayName = 'Effect'
Description = 'Enable or disable the execution of the policy'
}
Resource * {
Require 'type is not one of 2 values' {
Field type | Must -Not -BeIn @('Microsoft.Compute/virtualMachines', 'Microsoft.ClassicCompute/virtualMachines') -IfPresent
}
}
AuditIfNotExists 'Microsoft.Security/assessments' -Name 'c3b51c94-588b-426b-a892-24696f9e54cc' -Effect (Param Effect) {
Require 'status.code is one of 2 values' {
Field status.code | Must -BeIn @('NotApplicable', 'Healthy')
}
}
}Source: built-in-policies/policyDefinitions/Security Center/ASC_IPForwardingOnVirtualMachines_Audit.json in Azure/azure-policy, under the MIT licence.
Bylaw