Bylaw

Gallery › Regulatory Compliance › Azure built-in policies

Establish a privacy program

Converted Policy Disabled Manual Mode All Version 1.1.0

CMA_0257 - Establish a privacy program

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

Azure Policy JSONCMA_0257.json · 45 lines
{
  "properties": {
    "displayName": "Establish a privacy program",
    "policyType": "BuiltIn",
    "mode": "All",
    "description": "CMA_0257 - Establish a privacy program",
    "metadata": {
      "version": "1.1.0",
      "category": "Regulatory Compliance",
      "additionalMetadataId": "/providers/Microsoft.PolicyInsights/policyMetadata/CMA_0257"
    },
    "version": "1.1.0",
    "parameters": {
      "effect": {
        "type": "String",
        "metadata": {
          "displayName": "Effect",
          "description": "Enable or disable the execution of the policy"
        },
        "allowedValues": [
          "Manual",
          "Disabled"
        ],
        "defaultValue": "Manual"
      }
    },
    "policyRule": {
      "if": {
        "field": "type",
        "equals": "Microsoft.Resources/subscriptions"
      },
      "then": {
        "effect": "[parameters('effect')]",
        "details": {
          "defaultState": "Unknown"
        }
      }
    },
    "versions": [
      "1.1.0"
    ]
  },
  "id": "/providers/Microsoft.Authorization/policyDefinitions/39eb03c1-97cc-11ab-0960-6209ed2869f7",
  "name": "39eb03c1-97cc-11ab-0960-6209ed2869f7"
}
Bylaw39eb03c1-97cc-11ab-0960-6209ed2869f7.bylaw.ps1 · 24 lines
# Converted from CMA_0257.json by ConvertTo-Bylaw.
Policy '39eb03c1-97cc-11ab-0960-6209ed2869f7' {

    Properties @{
        DisplayName   = 'Establish a privacy program'
        Description   = 'CMA_0257 - Establish a privacy program'
        Version       = '1.1.0'
        Category      = 'Regulatory Compliance'
        PolicyVersion = '1.1.0'
        Mode          = 'All'
        Metadata      = [ordered]@{ additionalMetadataId = '/providers/Microsoft.PolicyInsights/policyMetadata/CMA_0257' }
    }

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

    Resource 'Microsoft.Resources/subscriptions'

    Manual -DefaultState Unknown -Effect (Param Effect)
}

Source: built-in-policies/policyDefinitions/Regulatory Compliance/CMA_0257.json in Azure/azure-policy, under the MIT licence.