last sync: 2021-Sep-24 16:09:49 UTC

Azure Policy definition

Deploy Advanced Threat Protection on storage accounts

Name Deploy Advanced Threat Protection on storage accounts
Azure Portal
Id 361c2074-3595-4e5d-8cab-4f21dffc835c
Version 1.0.0
details on versioning
Category Storage
Microsoft docs
Description This policy enables Advanced Threat Protection on storage accounts.
Mode Indexed
Type BuiltIn
Preview FALSE
Deprecated FALSE
Effect Default: DeployIfNotExists
Allowed: (DeployIfNotExists, Disabled)
Used RBAC Role
Role Name Role Id
Security Admin fb1c8493-542b-48eb-b624-b4c8fea62acd
History none
Used in Initiatives
Initiative DisplayName Initiative Id Initiative Category State
[Preview]: CMMC Level 3 b5629c75-5c77-4422-87b9-2509e680f8de Regulatory Compliance Preview
JSON
{
  "displayName": "Deploy Advanced Threat Protection on storage accounts",
  "policyType": "BuiltIn",
  "mode": "Indexed",
  "description": "This policy enables Advanced Threat Protection on storage accounts.",
  "metadata": {
    "version": "1.0.0",
    "category": "Storage"
  },
  "parameters": {
    "effect": {
      "type": "String",
      "metadata": {
        "displayName": "Effect",
        "description": "Enable or disable the execution of the policy"
      },
      "allowedValues": [
        "DeployIfNotExists",
        "Disabled"
      ],
      "defaultValue": "DeployIfNotExists"
    }
  },
  "policyRule": {
    "if": {
      "field": "type",
      "equals": "Microsoft.Storage/storageAccounts"
    },
    "then": {
      "effect": "[parameters('effect')]",
      "details": {
        "type": "Microsoft.Security/advancedThreatProtectionSettings",
        "name": "current",
        "existenceCondition": {
          "field": "Microsoft.Security/advancedThreatProtectionSettings/isEnabled",
          "equals": "true"
        },
        "roleDefinitionIds": [
          "/providers/Microsoft.Authorization/roleDefinitions/fb1c8493-542b-48eb-b624-b4c8fea62acd"
        ],
        "deployment": {
          "properties": {
            "mode": "incremental",
            "template": {
              "$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
              "contentVersion": "1.0.0.0",
              "parameters": {
                "storageAccountName": {
                  "type": "string"
                }
              },
              "resources": [
                {
                  "apiVersion": "2019-01-01",
                  "type": "Microsoft.Storage/storageAccounts/providers/advancedThreatProtectionSettings",
                  "name": "[concat(parameters('storageAccountName'), '/Microsoft.Security/current')]",
                  "properties": {
                    "isEnabled": true
                  }
                }
              ]
            },
            "parameters": {
              "storageAccountName": {
                "value": "[field('name')]"
              }
            }
          }
        }
      }
    }
  }
}