Project: KICS (Provisioning / Security & Compliance)
File: 574e8d82-1db2-4b9c-b526-e320ede9a9ff.md

title: SQL Server Database With Alerts Disabled hide: toc: true navigation: true <style> .highlight .hll { background-color: #ff171742; } .md-content { max-width: 1100px; margin: 0 auto; } </style> Query id: 574e8d82-1db2-4b9c-b526-e320ede9a9ff Query name: SQL Server Database With Alerts Disabled Platform: AzureResourceManager Severity: <span style="color:#ff7213">Medium</span> Category: Best Practices URL: All Alerts should be enabled in SQL Database Server SecurityAlerts Policy Properties<br> ```json title="Positive test num. 1 - json file" hl_lines="14" { "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", "contentVersion": "2.0.0.0", "apiProfile": "2019-03-01-hybrid", "parameters": {}, "variables": {}, "functions": [], "resources": [ { "type": "Microsoft.Sql/servers/databases/securityAlertPolicies", "apiVersion": "2021-02-01-preview", "name": "sample/databases/default", "properties": { "disabledAlerts": [ "Sql_Injection" ], "emailAccountAdmins": true, "emailAddresses": [ "sample@email.com" ], "retentionDays": 4, "state": "Enabled" } } ], "outputs": {} } ``` ```json title="Positive test num. 2 - json file" hl_lines="16" { "properties": { "template": { "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", "contentVersion": "2.0.0.0", "apiProfile": "2019-03-01-hybrid", "parameters": {}, "variables": {}, "functions": [], "resources": [ { "type": "Microsoft.Sql/servers/databases/securityAlertPolicies", "apiVersion": "2021-02-01-preview", "name": "sample/databases/default", "properties": { "disabledAlerts": [ "Sql_Injection" ], "emailAccountAdmins": true, "emailAddresses": [ "sample@email.com" ], "retentionDays": 4, "state": "Enabled" } } ], "outputs": {} }, "parameters": {} }, "kind": "template", "type": "Microsoft.Blueprint/blueprints/artifacts", "name": "myTemplate" } ``` ```json title="Negative test num. 1 - json file" { "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", "contentVersion": "2.0.0.0", "apiProfile": "2019-03-01-hybrid", "parameters": {}, "variables": {}, "functions": [], "resources": [ { "type": "Microsoft.Sql/servers/databases/securityAlertPolicies", "apiVersion": "2021-02-01-preview", "name": "sample/databases/default", "properties": { "disabledAlerts": [], "emailAccountAdmins": true, "emailAddresses": [ "sample@email.com" ], "retentionDays": 4, "state": "Enabled" } } ], "outputs": {} } ``` ```json title="Negative test num. 2 - json file" { "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", "contentVersion": "2.0.0.0", "apiProfile": "2019-03-01-hybrid", "parameters": {}, "variables": {}, "functions": [], "resources": [ { "type": "Microsoft.Sql/servers/databases/securityAlertPolicies", "apiVersion": "2021-02-01-preview", "name": "sample/databases/default", "properties": { "emailAccountAdmins": true, "emailAddresses": [ "sample@email.com" ], "retentionDays": 4, "state": "Enabled" } } ], "outputs": {} } ``` ```json title="Negative test num. 3 - json file" { "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", "contentVersion": "2.0.0.0", "apiProfile": "2019-03-01-hybrid", "parameters": {}, "variables": {}, "functions": [], "resources": [ { "type": "Microsoft.Sql/servers/databases/securityAlertPolicies", "apiVersion": "2021-02-01-preview", "name": "sample/databases/default", "properties": { "emailAccountAdmins": true, "emailAddresses": [ "sample@email.com" ], "retentionDays": 4, "state": "Disabled" } } ], "outputs": {} } ``` <details><summary>Negative test num. 4 - json file</summary> ```json { "properties": { "template": { "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", "contentVersion": "2.0.0.0", "apiProfile": "2019-03-01-hybrid", "parameters": {}, "variables": {}, "functions": [], "resources": [ { "type": "Microsoft.Sql/servers/databases/securityAlertPolicies", "apiVersion": "2021-02-01-preview", "name": "sample/databases/default", "properties": { "disabledAlerts": [], "emailAccountAdmins": true, "emailAddresses": [ "sample@email.com" ], "retentionDays": 4, "state": "Enabled" } } ], "outputs": {} }, "parameters": {} }, "kind": "template", "type": "Microsoft.Blueprint/blueprints/artifacts", "name": "myTemplate" } ``` </details> <details><summary>Negative test num. 5 - json file</summary> ```json { "properties": { "template": { "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", "contentVersion": "2.0.0.0", "apiProfile": "2019-03-01-hybrid", "parameters": {}, "variables": {}, "functions": [], "resources": [ { "type": "Microsoft.Sql/servers/databases/securityAlertPolicies", "apiVersion": "2021-02-01-preview", "name": "sample/databases/default", "properties": { "emailAccountAdmins": true, "emailAddresses": [ "sample@email.com" ], "retentionDays": 4, "state": "Enabled" } } ], "outputs": {} }, "parameters": {} }, "kind": "template", "type": "Microsoft.Blueprint/blueprints/artifacts", "name": "myTemplate" } ``` </details> <details><summary>Negative test num. 6 - json file</summary> ```json { "properties": { "template": { "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", "contentVersion": "2.0.0.0", "apiProfile": "2019-03-01-hybrid", "parameters": {}, "variables": {}, "functions": [], "resources": [ { "type": "Microsoft.Sql/servers/databases/securityAlertPolicies", "apiVersion": "2021-02-01-preview", "name": "sample/databases/default", "properties": { "emailAccountAdmins": true, "emailAddresses": [ "sample@email.com" ], "retentionDays": 4, "state": "Disabled" } } ], "outputs": {} }, "parameters": {} }, "kind": "template", "type": "Microsoft.Blueprint/blueprints/artifacts", "name": "myTemplate" } ``` </details>