Gallery › Managed Grafana › Azure built-in policies
Azure Managed Grafana workspaces should disable email settings
Converted Policy Audit Deny Disabled Mode Indexed Version 1.0.0
Disables SMTP settings configuration of email contact point for alerting in Grafana workspace.
ConvertTo-Bylaw converted this policy, and proved that the file compiles back to the same definition.
Azure Policy JSONAMG_EmailSettings_Deny.json · 50 lines
{
"properties": {
"displayName": "Azure Managed Grafana workspaces should disable email settings",
"policyType": "BuiltIn",
"mode": "Indexed",
"description": "Disables SMTP settings configuration of email contact point for alerting in Grafana workspace.",
"metadata": {
"version": "1.0.0",
"category": "Managed Grafana"
},
"version": "1.0.0",
"parameters": {
"effect": {
"type": "String",
"metadata": {
"displayName": "Effect",
"description": "Enable or disable the execution of the policy"
},
"allowedValues": [
"Audit",
"Deny",
"Disabled"
],
"defaultValue": "Audit"
}
},
"policyRule": {
"if": {
"allOf": [
{
"field": "type",
"equals": "Microsoft.Dashboard/grafana"
},
{
"field": "Microsoft.Dashboard/grafana/grafanaConfigurations.smtp.enabled",
"equals": "true"
}
]
},
"then": {
"effect": "[parameters('effect')]"
}
},
"versions": [
"1.0.0"
]
},
"id": "/providers/Microsoft.Authorization/policyDefinitions/b6752a42-6fc3-46cb-8a15-33aa109407b1",
"name": "b6752a42-6fc3-46cb-8a15-33aa109407b1"
}Bylawb6752a42-6fc3-46cb-8a15-33aa109407b1.bylaw.ps1 · 28 lines
# Converted from AMG_EmailSettings_Deny.json by ConvertTo-Bylaw.
Policy 'b6752a42-6fc3-46cb-8a15-33aa109407b1' {
Properties @{
DisplayName = 'Azure Managed Grafana workspaces should disable email settings'
Description = 'Disables SMTP settings configuration of email contact point for alerting in Grafana workspace.'
Version = '1.0.0'
Category = 'Managed Grafana'
PolicyVersion = '1.0.0'
Mode = 'Indexed'
}
Parameter Effect @{
AllowedValues = @('Audit', 'Deny', 'Disabled')
Default = 'Audit'
DisplayName = 'Effect'
Description = 'Enable or disable the execution of the policy'
}
Resource 'Microsoft.Dashboard/grafana' {
Require 'grafanaConfigurations.smtp.enabled is not true' {
Field grafanaConfigurations.smtp.enabled | Must -Not -Be 'true' -IfPresent
}
}
Effect (Param Effect)
}Source: built-in-policies/policyDefinitions/Managed Grafana/AMG_EmailSettings_Deny.json in Azure/azure-policy, under the MIT licence.
Bylaw