Bylaw

Gallery › Security Center › Azure built-in policies

[Deprecated]: Microsoft Defender for Storage (Classic) should be enabled

Converted Policy AuditIfNotExists Disabled Mode All Version 1.1.0-deprecated Deprecated

Microsoft Defender for Storage (Classic) provides detections of unusual and potentially harmful attempts to access or exploit storage accounts.

ConvertTo-Bylaw converted this policy, and proved that the file compiles back to the same definition.

Azure Policy JSONASC_EnableAdvancedThreatProtectionOnStorageAccounts_Audit.json · 52 lines
{
  "properties": {
    "displayName": "[Deprecated]: Microsoft Defender for Storage (Classic) should be enabled",
    "policyType": "BuiltIn",
    "mode": "All",
    "description": "Microsoft Defender for Storage (Classic) provides detections of unusual and potentially harmful attempts to access or exploit storage accounts.",
    "metadata": {
      "version": "1.1.0-deprecated",
      "category": "Security Center",
      "deprecated": true
    },
    "version": "1.1.0",
    "parameters": {
      "effect": {
        "type": "string",
        "defaultValue": "Disabled",
        "allowedValues": [
          "AuditIfNotExists",
          "Disabled"
        ],
        "metadata": {
          "displayName": "Effect",
          "description": "Enable or disable the execution of the policy"
        }
      }
    },
    "policyRule": {
      "if": {
        "field": "type",
        "equals": "Microsoft.Resources/subscriptions"
      },
      "then": {
        "effect": "[parameters('effect')]",
        "details": {
          "type": "Microsoft.Security/pricings",
          "name": "StorageAccounts",
          "existenceScope": "subscription",
          "existenceCondition": {
            "field": "Microsoft.Security/pricings/pricingTier",
            "equals": "Standard"
          }
        }
      }
    },
    "versions": [
      "1.1.0",
      "1.0.4"
    ]
  },
  "id": "/providers/Microsoft.Authorization/policyDefinitions/308fbb08-4ab8-4e67-9b29-592e93fb94fa",
  "name": "308fbb08-4ab8-4e67-9b29-592e93fb94fa"
}
Bylaw308fbb08-4ab8-4e67-9b29-592e93fb94fa.bylaw.ps1 · 29 lines
# Converted from ASC_EnableAdvancedThreatProtectionOnStorageAccounts_Audit.json by ConvertTo-Bylaw.
Policy '308fbb08-4ab8-4e67-9b29-592e93fb94fa' {

    Properties @{
        DisplayName   = '[Deprecated]: Microsoft Defender for Storage (Classic) should be enabled'
        Description   = 'Microsoft Defender for Storage (Classic) provides detections of unusual and potentially harmful attempts to access or exploit storage accounts.'
        Version       = '1.1.0-deprecated'
        Category      = 'Security Center'
        Deprecated    = $true
        PolicyVersion = '1.1.0'
        Mode          = 'All'
    }

    Parameter Effect @{
        Type          = 'string'
        AllowedValues = @('AuditIfNotExists', 'Disabled')
        Default       = 'Disabled'
        DisplayName   = 'Effect'
        Description   = 'Enable or disable the execution of the policy'
    }

    Resource 'Microsoft.Resources/subscriptions'

    AuditIfNotExists 'Microsoft.Security/pricings' -Name 'StorageAccounts' -ExistenceScope Subscription -Effect (Param Effect) {
        Require 'pricingTier is Standard' {
            Field pricingTier | Must -Be 'Standard'
        }
    }
}

Source: built-in-policies/policyDefinitions/Security Center/ASC_EnableAdvancedThreatProtectionOnStorageAccounts_Audit.json in Azure/azure-policy, under the MIT licence.