Gallery › Compute › Azure built-in policies
Microsoft Antimalware for Azure should be configured to automatically update protection signatures
Converted Policy AuditIfNotExists Disabled Mode Indexed Version 1.0.0
This policy audits any Windows virtual machine not configured with automatic update of Microsoft Antimalware protection signatures.
ConvertTo-Bylaw converted this policy, and proved that the file compiles back to the same definition.
Azure Policy JSONVirtualMachines_AntiMalwareAutoUpdate_AINE.json · 68 lines
{
"properties": {
"displayName": "Microsoft Antimalware for Azure should be configured to automatically update protection signatures",
"policyType": "BuiltIn",
"mode": "Indexed",
"description": "This policy audits any Windows virtual machine not configured with automatic update of Microsoft Antimalware protection signatures.",
"metadata": {
"version": "1.0.0",
"category": "Compute"
},
"version": "1.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": {
"allOf": [
{
"field": "type",
"equals": "Microsoft.Compute/virtualMachines"
},
{
"field": "Microsoft.Compute/virtualMachines/storageProfile.osDisk.osType",
"equals": "Windows"
}
]
},
"then": {
"effect": "[parameters('effect')]",
"details": {
"type": "Microsoft.Compute/virtualMachines/extensions",
"existenceCondition": {
"allOf": [
{
"field": "Microsoft.Compute/virtualMachines/extensions/type",
"equals": "IaaSAntimalware"
},
{
"field": "Microsoft.Compute/virtualMachines/extensions/publisher",
"equals": "Microsoft.Azure.Security"
},
{
"field": "Microsoft.Compute/virtualMachines/extensions/autoUpgradeMinorVersion",
"equals": "true"
}
]
}
}
}
},
"versions": [
"1.0.0"
]
},
"id": "/providers/Microsoft.Authorization/policyDefinitions/c43e4a30-77cb-48ab-a4dd-93f175c63b57",
"name": "c43e4a30-77cb-48ab-a4dd-93f175c63b57"
}Bylawc43e4a30-77cb-48ab-a4dd-93f175c63b57.bylaw.ps1 · 35 lines
# Converted from VirtualMachines_AntiMalwareAutoUpdate_AINE.json by ConvertTo-Bylaw.
Policy 'c43e4a30-77cb-48ab-a4dd-93f175c63b57' {
Properties @{
DisplayName = 'Microsoft Antimalware for Azure should be configured to automatically update protection signatures'
Description = 'This policy audits any Windows virtual machine not configured with automatic update of Microsoft Antimalware protection signatures.'
Version = '1.0.0'
Category = 'Compute'
PolicyVersion = '1.0.0'
Mode = 'Indexed'
}
Parameter Effect @{
Type = 'string'
AllowedValues = @('AuditIfNotExists', 'Disabled')
Default = 'AuditIfNotExists'
DisplayName = 'Effect'
Description = 'Enable or disable the execution of the policy'
}
Resource 'Microsoft.Compute/virtualMachines' {
Require 'storageProfile.osDisk.osType is not Windows' {
Field storageProfile.osDisk.osType | Must -Not -Be 'Windows' -IfPresent
}
}
AuditIfNotExists 'Microsoft.Compute/virtualMachines/extensions' -Effect (Param Effect) {
Require 'type is IaaSAntimalware, publisher is Microsoft.Azure.Security and autoUpgradeMinorVersion is true' {
Field 'Microsoft.Compute/virtualMachines/extensions/type' | Must -Be 'IaaSAntimalware'
Field publisher | Must -Be 'Microsoft.Azure.Security'
Field autoUpgradeMinorVersion | Must -Be 'true'
}
}
}Source: built-in-policies/policyDefinitions/Compute/VirtualMachines_AntiMalwareAutoUpdate_AINE.json in Azure/azure-policy, under the MIT licence.
Bylaw