Bylaw

Gallery › Stack HCI › Azure built-in policies

[Deprecated]: Azure Stack HCI systems should have encrypted volumes

Converted Policy Audit Disabled Mode All Version 1.1.0-deprecated Deprecated

This policy is deprecated because it targets security settings resource. Instead of continuing to use this policy, we recommend you instead assign this replacement policy with policy ID /providers/Microsoft.Authorization/policyDefinitions/ee8ca833-1583-4d24-837e-96c2af9488a4. Learn more about policy definition deprecation at aka.ms/policydefdeprecation.

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

Azure Policy JSONDataAtRestEncrypted_Audit.json · 56 lines
{
  "properties": {
    "displayName": "[Deprecated]: Azure Stack HCI systems should have encrypted volumes",
    "policyType": "BuiltIn",
    "mode": "All",
    "description": "This policy is deprecated because it targets security settings resource. Instead of continuing to use this policy, we recommend you instead assign this replacement policy with policy ID /providers/Microsoft.Authorization/policyDefinitions/ee8ca833-1583-4d24-837e-96c2af9488a4. Learn more about policy definition deprecation at aka.ms/policydefdeprecation.",
    "metadata": {
      "version": "1.1.0-deprecated",
      "category": "Stack HCI",
      "deprecated": true
    },
    "version": "1.1.0",
    "parameters": {
      "effect": {
        "type": "String",
        "defaultValue": "Disabled",
        "allowedValues": [
          "Audit",
          "Disabled"
        ],
        "metadata": {
          "displayName": "Effect",
          "description": "Enable or disable the execution of the policy"
        }
      }
    },
    "policyRule": {
      "if": {
        "allOf": [
          {
            "field": "type",
            "equals": "Microsoft.AzureStackHCI/clusters/securitySettings"
          },
          {
            "not": {
              "field": "Microsoft.AzureStackHCI/clusters/securitySettings/securityComplianceStatus.dataAtRestEncrypted",
              "in": [
                "Compliant",
                "Pending"
              ]
            }
          }
        ]
      },
      "then": {
        "effect": "[parameters('effect')]"
      }
    },
    "versions": [
      "1.1.0",
      "1.0.0-PREVIEW"
    ]
  },
  "id": "/providers/Microsoft.Authorization/policyDefinitions/ae95f12a-b6fd-42e0-805c-6b94b86c9830",
  "name": "ae95f12a-b6fd-42e0-805c-6b94b86c9830"
}
Bylawae95f12a-b6fd-42e0-805c-6b94b86c9830.bylaw.ps1 · 29 lines
# Converted from DataAtRestEncrypted_Audit.json by ConvertTo-Bylaw.
Policy 'ae95f12a-b6fd-42e0-805c-6b94b86c9830' {

    Properties @{
        DisplayName   = '[Deprecated]: Azure Stack HCI systems should have encrypted volumes'
        Description   = 'This policy is deprecated because it targets security settings resource. Instead of continuing to use this policy, we recommend you instead assign this replacement policy with policy ID /providers/Microsoft.Authorization/policyDefinitions/ee8ca833-1583-4d24-837e-96c2af9488a4. Learn more about policy definition deprecation at aka.ms/policydefdeprecation.'
        Version       = '1.1.0-deprecated'
        Category      = 'Stack HCI'
        Deprecated    = $true
        PolicyVersion = '1.1.0'
        Mode          = 'All'
    }

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

    Resource 'Microsoft.AzureStackHCI/clusters/securitySettings' {

        Require 'securityComplianceStatus.dataAtRestEncrypted is one of 2 values' {
            Field securityComplianceStatus.dataAtRestEncrypted | Must -BeIn @('Compliant', 'Pending')
        }
    }

    Effect (Param Effect)
}

Source: built-in-policies/policyDefinitions/Stack HCI/DataAtRestEncrypted_Audit.json in Azure/azure-policy, under the MIT licence.