Gallery › Security Center › Azure built-in policies
Email notification to subscription owner for high severity alerts should be enabled
Converted Policy AuditIfNotExists Disabled Mode All Version 2.1.0
To ensure your subscription owners are notified when there is a potential security breach in their subscription, set email notifications to subscription owners 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_to_subscription_owner.json · 82 lines
{
"properties": {
"displayName": "Email notification to subscription owner for high severity alerts should be enabled",
"policyType": "BuiltIn",
"mode": "All",
"description": "To ensure your subscription owners are notified when there is a potential security breach in their subscription, set email notifications to subscription owners for high severity alerts in Security Center.",
"metadata": {
"version": "2.1.0",
"category": "Security Center"
},
"version": "2.1.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",
"existenceScope": "subscription",
"existenceCondition": {
"not": {
"allOf": [
{
"field": "Microsoft.Security/securityContacts/alertsToAdmins",
"equals": "Off"
},
{
"anyOf": [
{
"field": "Microsoft.Security/securityContacts/alertNotifications.minimalSeverity",
"equals": "High"
},
{
"count": {
"field": "Microsoft.Security/securityContacts/notificationsSources[*]",
"where": {
"allOf": [
{
"field": "Microsoft.Security/securityContacts/notificationsSources[*].sourceType",
"equals": "Alert"
},
{
"field": "Microsoft.Security/securityContacts/notificationsSources[*].Alert.minimalSeverity",
"equals": "High"
}
]
}
},
"equals": 1
}
]
}
]
}
}
}
}
},
"versions": [
"2.1.0",
"2.0.0"
]
},
"id": "/providers/Microsoft.Authorization/policyDefinitions/0b15565f-aa9e-48ba-8619-45960f2c314d",
"name": "0b15565f-aa9e-48ba-8619-45960f2c314d"
}Bylaw0b15565f-aa9e-48ba-8619-45960f2c314d.bylaw.ps1 · 37 lines
# Converted from ASC_Email_notification_to_subscription_owner.json by ConvertTo-Bylaw.
Policy '0b15565f-aa9e-48ba-8619-45960f2c314d' {
Properties @{
DisplayName = 'Email notification to subscription owner for high severity alerts should be enabled'
Description = 'To ensure your subscription owners are notified when there is a potential security breach in their subscription, set email notifications to subscription owners for high severity alerts in Security Center.'
Version = '2.1.0'
Category = 'Security Center'
PolicyVersion = '2.1.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' -ExistenceScope Subscription -Effect (Param Effect) {
Require 'alertsToAdmins, alertNotifications.minimalSeverity, notificationsSources and 2 more are as required' {
AnyOf {
Field alertsToAdmins | Must -Not -Be 'Off' -IfPresent
AllOf {
Field alertNotifications.minimalSeverity | Must -Not -Be 'High' -IfPresent
Count 'notificationsSources[*]' -Where {
Field sourceType | Must -Be 'Alert'
Field Alert.minimalSeverity | Must -Be 'High'
} | Must -Not -Be 1
}
}
}
}
}Source: built-in-policies/policyDefinitions/Security Center/ASC_Email_notification_to_subscription_owner.json in Azure/azure-policy, under the MIT licence.
Bylaw