Account Admins Not Notified By Email

  • Query id: a8852cc0-fd4b-4fc7-9372-1e43fad0732e
  • Query name: Account Admins Not Notified By Email
  • Platform: AzureResourceManager
  • Severity: Info
  • Category: Best Practices
  • URL: Github

Description

Account admins should be notified by email in the event of security alerts
Documentation

Code samples

Code samples with security vulnerabilities

Positive 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/server/default",
      "properties": {
        "emailAccountAdmins": false,
        "emailAddresses": [ "sample@email.com" ],
        "retentionDays": 4,
        "state": "Enabled"
      }
    }
  ],
  "outputs": {}
}
Positive 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/server/default",
      "properties": {
        "emailAddresses": [ "sample@email.com" ],
        "retentionDays": 4,
        "state": "Enabled"
      }
    }
  ],
  "outputs": {}
}
Positive test num. 3 - json file
{
  "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/server/default",
          "properties": {
            "emailAccountAdmins": false,
            "emailAddresses": [ "sample@email.com" ],
            "retentionDays": 4,
            "state": "Enabled"
          }
        }
      ],
      "outputs": {}
    },
    "parameters": {}
  },
  "kind": "template",
  "type": "Microsoft.Blueprint/blueprints/artifacts",
  "name": "myTemplate"
}

Positive test num. 4 - json file
{
  "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/server/default",
          "properties": {
            "emailAddresses": [ "sample@email.com" ],
            "retentionDays": 4,
            "state": "Enabled"
          }
        }
      ],
      "outputs": {}
    },
    "parameters": {}
  },
  "kind": "template",
  "type": "Microsoft.Blueprint/blueprints/artifacts",
  "name": "myTemplate"
}

Code samples without security vulnerabilities

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/server/default",
      "properties": {
        "emailAccountAdmins": true,
        "emailAddresses": [ "sample@email.com" ],
        "retentionDays": 4,
        "state": "Enabled"
      }
    }
  ],
  "outputs": {}
}
Negative test num. 2 - json file
{
  "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/server/default",
          "properties": {
            "emailAccountAdmins": true,
            "emailAddresses": [ "sample@email.com" ],
            "retentionDays": 4,
            "state": "Enabled"
          }
        }
      ],
      "outputs": {}
    },
    "parameters": {}
  },
  "kind": "template",
  "type": "Microsoft.Blueprint/blueprints/artifacts",
  "name": "myTemplate"
}