Bylaw

Gallery › VirtualEnclaves › Azure built-in policies

[Preview]: Control the use of Storage Accounts in a Virtual Enclave

Converted Initiative Version 1.1.0-preview Preview

This initiative deploys Azure policies for Storage Accounts ensuring boundary protection of this resource while it operates within the logically separated structure of Azure Virtual Enclaves. https://aka.ms/VirtualEnclaves

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

Azure Policy JSONStorageAccountInitiative.json · 81 lines
{
  "properties": {
    "displayName": "[Preview]: Control the use of Storage Accounts in a Virtual Enclave",
    "policyType": "BuiltIn",
    "description": "This initiative deploys Azure policies for Storage Accounts ensuring boundary protection of this resource while it operates within the logically separated structure of Azure Virtual Enclaves. https://aka.ms/VirtualEnclaves",
    "metadata": {
      "version": "1.1.0-preview",
      "category": "VirtualEnclaves",
      "preview": true
    },
    "version": "1.1.0-preview",
    "policyDefinitions": [
      {
        "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/6fac406b-40ca-413b-bf8e-0bf964659c25",
        "policyDefinitionReferenceId": "StorageAccountShouldUseCmkForEncryption",
        "definitionVersion": "1.*.*"
      },
      {
        "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/7809fda1-ba27-48c1-9c63-1f5aee46ba89",
        "policyDefinitionReferenceId": "StorageAccountShouldRestrictPublicAccess",
        "definitionVersion": "1.*.*"
      },
      {
        "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/41a72361-06e3-4e80-832a-690bd0708bc1",
        "policyDefinitionReferenceId": "StorageAccountShouldHaveRestrictedPublicAccess",
        "definitionVersion": "1.*.*"
      },
      {
        "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/404c3081-a854-4457-ae30-26a93ef643f9",
        "policyDefinitionReferenceId": "StorageAccountShouldUseHttpsTrafficOnly",
        "definitionVersion": "2.*.*"
      },
      {
        "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/fe83a0eb-a853-422d-aac2-1bffd182c5d0",
        "policyDefinitionReferenceId": "StorageAccountShouldUseTls12",
        "definitionVersion": "1.*.*",
        "parameters": {
          "minimumTlsVersion": {
            "value": "TLS1_2"
          }
        }
      },
      {
        "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/13502221-8df0-4414-9937-de9c5c4e396b",
        "policyDefinitionReferenceId": "StorageAccountShouldDisablePublicBlobAccess",
        "definitionVersion": "1.*.*"
      },
      {
        "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/b5ec538c-daa0-4006-8596-35468b9148e8",
        "policyDefinitionReferenceId": "StorageAccountShouldUseCmkForEncryptionScopes",
        "definitionVersion": "1.*.*"
      },
      {
        "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/7c322315-e26d-4174-a99e-f49d351b4688",
        "policyDefinitionReferenceId": "StorageAccountShouldUseCmkForTableEncryption",
        "definitionVersion": "1.*.*"
      },
      {
        "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/f0e5abd0-2554-4736-b7c0-4ffef23475ef",
        "policyDefinitionReferenceId": "StorageAccountShouldUseCmkForQueueEncryption",
        "definitionVersion": "1.*.*"
      },
      {
        "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/6edd7eda-6dd8-40f7-810d-67160c639cd9",
        "policyDefinitionReferenceId": "StorageAccountShouldUsePrivateLink",
        "definitionVersion": "2.*.*"
      },
      {
        "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/640d2586-54d2-465f-877f-9ffc1d2109f4",
        "policyDefinitionReferenceId": "StorageAccountShouldHaveDefenderEnabled",
        "definitionVersion": "1.*.*"
      }
    ],
    "versions": [
      "1.1.0-PREVIEW",
      "1.0.0-PREVIEW"
    ]
  },
  "id": "/providers/Microsoft.Authorization/policySetDefinitions/ca122c06-05f6-4423-9018-ccb523168eb2",
  "name": "ca122c06-05f6-4423-9018-ccb523168eb2"
}
Bylawca122c06-05f6-4423-9018-ccb523168eb2.bylaw.ps1 · 81 lines
# Converted from StorageAccountInitiative.json by ConvertTo-Bylaw.
Initiative 'ca122c06-05f6-4423-9018-ccb523168eb2' {

    Properties @{
        DisplayName   = '[Preview]: Control the use of Storage Accounts in a Virtual Enclave'
        Description   = 'This initiative deploys Azure policies for Storage Accounts ensuring boundary protection of this resource while it operates within the logically separated structure of Azure Virtual Enclaves. https://aka.ms/VirtualEnclaves'
        Version       = '1.1.0-preview'
        Category      = 'VirtualEnclaves'
        Preview       = $true
        PolicyVersion = '1.1.0-preview'
    }

    PolicyDefinition @{
        Id          = '6fac406b-40ca-413b-bf8e-0bf964659c25'
        ReferenceId = 'StorageAccountShouldUseCmkForEncryption'
        Version     = '1.*.*'
    }

    PolicyDefinition @{
        Id          = '7809fda1-ba27-48c1-9c63-1f5aee46ba89'
        ReferenceId = 'StorageAccountShouldRestrictPublicAccess'
        Version     = '1.*.*'
    }

    PolicyDefinition @{
        Id          = '41a72361-06e3-4e80-832a-690bd0708bc1'
        ReferenceId = 'StorageAccountShouldHaveRestrictedPublicAccess'
        Version     = '1.*.*'
    }

    PolicyDefinition @{
        Id          = '404c3081-a854-4457-ae30-26a93ef643f9'
        ReferenceId = 'StorageAccountShouldUseHttpsTrafficOnly'
        Version     = '2.*.*'
    }

    PolicyDefinition @{
        Id          = 'fe83a0eb-a853-422d-aac2-1bffd182c5d0'
        ReferenceId = 'StorageAccountShouldUseTls12'
        Version     = '1.*.*'
        Parameters  = @{
            minimumTlsVersion = 'TLS1_2'
        }
    }

    PolicyDefinition @{
        Id          = '13502221-8df0-4414-9937-de9c5c4e396b'
        ReferenceId = 'StorageAccountShouldDisablePublicBlobAccess'
        Version     = '1.*.*'
    }

    PolicyDefinition @{
        Id          = 'b5ec538c-daa0-4006-8596-35468b9148e8'
        ReferenceId = 'StorageAccountShouldUseCmkForEncryptionScopes'
        Version     = '1.*.*'
    }

    PolicyDefinition @{
        Id          = '7c322315-e26d-4174-a99e-f49d351b4688'
        ReferenceId = 'StorageAccountShouldUseCmkForTableEncryption'
        Version     = '1.*.*'
    }

    PolicyDefinition @{
        Id          = 'f0e5abd0-2554-4736-b7c0-4ffef23475ef'
        ReferenceId = 'StorageAccountShouldUseCmkForQueueEncryption'
        Version     = '1.*.*'
    }

    PolicyDefinition @{
        Id          = '6edd7eda-6dd8-40f7-810d-67160c639cd9'
        ReferenceId = 'StorageAccountShouldUsePrivateLink'
        Version     = '2.*.*'
    }

    PolicyDefinition @{
        Id          = '640d2586-54d2-465f-877f-9ffc1d2109f4'
        ReferenceId = 'StorageAccountShouldHaveDefenderEnabled'
        Version     = '1.*.*'
    }
}

Members (11)

Source: built-in-policies/policySetDefinitions/VirtualEnclaves/StorageAccountInitiative.json in Azure/azure-policy, under the MIT licence.