Bylaw

Gallery › Security Center › Azure built-in policies

[Deprecated]: [Deprecated]: Audit missing blob encryption for storage accounts

Converted Policy Audit Disabled Mode All Version 1.0.0-deprecated Deprecated

This policy is no longer necessary because storage blob encryption is enabled by default and cannot be turned off.

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

Azure Policy JSONASC_BlobEncryption_Audit_Deprecated.json · 52 lines
{
  "properties": {
    "displayName": "[Deprecated]: [Deprecated]: Audit missing blob encryption for storage accounts",
    "policyType": "BuiltIn",
    "mode": "All",
    "description": "This policy is no longer necessary because storage blob encryption is enabled by default and cannot be turned off.",
    "metadata": {
      "version": "1.0.0-deprecated",
      "category": "Security Center",
      "deprecated": true
    },
    "version": "1.0.0",
    "parameters": {
      "effect": {
        "type": "string",
        "defaultValue": "Audit",
        "allowedValues": [
          "Audit",
          "Disabled"
        ],
        "metadata": {
          "displayName": "Effect",
          "description": "Enable or disable the execution of the policy"
        }
      }
    },
    "policyRule": {
      "if": {
        "allOf": [
          {
            "field": "type",
            "equals": "Microsoft.Storage/storageAccounts"
          },
          {
            "not": {
              "field": "Microsoft.Storage/storageAccounts/enableBlobEncryption",
              "equals": "True"
            }
          }
        ]
      },
      "then": {
        "effect": "[parameters('effect')]"
      }
    },
    "versions": [
      "1.0.0"
    ]
  },
  "id": "/providers/Microsoft.Authorization/policyDefinitions/655cb504-bcee-4362-bd4c-402e6aa38759",
  "name": "655cb504-bcee-4362-bd4c-402e6aa38759"
}
Bylaw655cb504-bcee-4362-bd4c-402e6aa38759.bylaw.ps1 · 30 lines
# Converted from ASC_BlobEncryption_Audit_Deprecated.json by ConvertTo-Bylaw.
Policy '655cb504-bcee-4362-bd4c-402e6aa38759' {

    Properties @{
        DisplayName   = '[Deprecated]: [Deprecated]: Audit missing blob encryption for storage accounts'
        Description   = 'This policy is no longer necessary because storage blob encryption is enabled by default and cannot be turned off.'
        Version       = '1.0.0-deprecated'
        Category      = 'Security Center'
        Deprecated    = $true
        PolicyVersion = '1.0.0'
        Mode          = 'All'
    }

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

    Resource 'Microsoft.Storage/storageAccounts' {

        Require 'enableBlobEncryption is True' {
            Field enableBlobEncryption | Must -Be 'True'
        }
    }

    Effect (Param Effect)
}

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