Gallery › Security Center › Azure built-in policies
Email notification for high severity alerts should be enabled
Converted Policy AuditIfNotExists Disabled Mode All Version 1.2.0
To ensure the relevant people in your organization are notified when there is a potential security breach in one of your subscriptions, enable email notifications for high severity alerts in Security Center.
ConvertTo-Bylaw converted this policy, and proved that the file compiles back to the same definition.
Azure Policy JSONASC_Email_notification.json · 72 lines
{
"properties": {
"displayName": "Email notification for high severity alerts should be enabled",
"policyType": "BuiltIn",
"mode": "All",
"description": "To ensure the relevant people in your organization are notified when there is a potential security breach in one of your subscriptions, enable email notifications for high severity alerts in Security Center.",
"metadata": {
"version": "1.2.0",
"category": "Security Center"
},
"version": "1.2.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",
"equals": "Microsoft.Resources/subscriptions"
},
"then": {
"effect": "[parameters('effect')]",
"details": {
"type": "Microsoft.Security/securityContacts",
"existenceCondition": {
"anyOf": [
{
"field": "Microsoft.Security/securityContacts/alertNotifications",
"equals": "On"
},
{
"allOf": [
{
"field": "Microsoft.Security/securityContacts/isEnabled",
"equals": true
},
{
"count": {
"field": "Microsoft.Security/securityContacts/notificationsSources[*]",
"where": {
"field": "Microsoft.Security/securityContacts/notificationsSources[*].sourceType",
"equals": "Alert"
}
},
"greater": 0
}
]
}
]
}
}
}
},
"versions": [
"1.2.0",
"1.1.0",
"1.0.1"
]
},
"id": "/providers/Microsoft.Authorization/policyDefinitions/6e2593d9-add6-4083-9c9b-4b7d2188c899",
"name": "6e2593d9-add6-4083-9c9b-4b7d2188c899"
}Bylaw6e2593d9-add6-4083-9c9b-4b7d2188c899.bylaw.ps1 · 36 lines
# Converted from ASC_Email_notification.json by ConvertTo-Bylaw.
Policy '6e2593d9-add6-4083-9c9b-4b7d2188c899' {
Properties @{
DisplayName = 'Email notification for high severity alerts should be enabled'
Description = 'To ensure the relevant people in your organization are notified when there is a potential security breach in one of your subscriptions, enable email notifications for high severity alerts in Security Center.'
Version = '1.2.0'
Category = 'Security Center'
PolicyVersion = '1.2.0'
Mode = 'All'
}
Parameter Effect @{
Type = 'string'
AllowedValues = @('AuditIfNotExists', 'Disabled')
Default = 'AuditIfNotExists'
DisplayName = 'Effect'
Description = 'Enable or disable the execution of the policy'
}
Resource 'Microsoft.Resources/subscriptions'
AuditIfNotExists 'Microsoft.Security/securityContacts' -Effect (Param Effect) {
Require 'alertNotifications, isEnabled, notificationsSources and 1 more are as required' {
AnyOf {
Field alertNotifications | Must -Be 'On'
AllOf {
Field isEnabled | Must -Be $true
Count 'notificationsSources[*]' -Where {
Field sourceType | Must -Be 'Alert'
} | Must -BeGreaterThan 0
}
}
}
}
}Source: built-in-policies/policyDefinitions/Security Center/ASC_Email_notification.json in Azure/azure-policy, under the MIT licence.
Bylaw