last sync: 2021-Nov-26 17:15:01 UTC

Azure Policy definition

Configure Advanced Threat Protection to be enabled on Azure database for PostgreSQL servers

Name Configure Advanced Threat Protection to be enabled on Azure database for PostgreSQL servers
Azure Portal
Id db048e65-913c-49f9-bb5f-1084184671d3
Version 1.0.0
details on versioning
Category SQL
Microsoft docs
Description Enable Advanced Threat Protection on your non-Basic tier Azure database for PostgreSQL servers to detect anomalous activities indicating unusual and potentially harmful attempts to access or exploit databases.
Mode Indexed
Type BuiltIn
Preview FALSE
Deprecated FALSE
Effect Default: DeployIfNotExists
Allowed: (DeployIfNotExists, Disabled)
Used RBAC Role
Role Name Role Id
Contributor b24988ac-6180-42a0-ab88-20f7382dd24c
History
Date/Time (UTC ymd) (i) Change type Change detail
2021-05-11 14:06:18 add db048e65-913c-49f9-bb5f-1084184671d3
Used in Initiatives
Initiative DisplayName Initiative Id Initiative Category State
Configure Advanced Threat Protection to be enabled on open-source relational databases e77fc0b3-f7e9-4c58-bc13-cb753ed8e46e Security Center GA
JSON
{
  "displayName": "Configure Advanced Threat Protection to be enabled on Azure database for PostgreSQL servers",
  "policyType": "BuiltIn",
  "mode": "Indexed",
  "description": "Enable Advanced Threat Protection on your non-Basic tier Azure database for PostgreSQL servers to detect anomalous activities indicating unusual and potentially harmful attempts to access or exploit databases.",
  "metadata": {
    "version": "1.0.0",
    "category": "SQL"
  },
  "parameters": {
    "effect": {
      "type": "String",
      "metadata": {
        "displayName": "Effect",
        "description": "Enable or disable the execution of the policy"
      },
      "allowedValues": [
        "DeployIfNotExists",
        "Disabled"
      ],
      "defaultValue": "DeployIfNotExists"
    }
  },
  "policyRule": {
    "if": {
      "allOf": [
        {
          "field": "type",
          "equals": "Microsoft.DBforPostgreSQL/servers"
        },
        {
          "field": "Microsoft.DBforPostgreSQL/servers/sku.tier",
          "notContains": "basic"
        }
      ]
    },
    "then": {
      "effect": "[parameters('effect')]",
      "details": {
        "type": "Microsoft.DBforPostgreSQL/servers/securityAlertPolicies",
        "name": "Default",
        "existenceCondition": {
          "field": "Microsoft.DBforPostgreSQL/servers/securityAlertPolicies/Default.state",
          "equals": "Enabled"
        },
        "roleDefinitionIds": [
          "/providers/microsoft.authorization/roleDefinitions/b24988ac-6180-42a0-ab88-20f7382dd24c"
        ],
        "deployment": {
          "properties": {
            "mode": "incremental",
            "template": {
              "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
              "contentVersion": "1.0.0.0",
              "parameters": {
                "serverName": {
                  "type": "string"
                }
              },
              "variables": {},
              "resources": [
                {
                  "name": "[concat(parameters('serverName'), '/Default')]",
                  "type": "Microsoft.DBforPostgreSQL/servers/securityAlertPolicies",
                  "apiVersion": "2017-12-01",
                  "properties": {
                    "state": "Enabled",
                    "emailAccountAdmins": false
                  }
                }
              ]
            },
            "parameters": {
              "serverName": {
                "value": "[field('name')]"
              }
            }
          }
        }
      }
    }
  }
}