Bylaw

Gallery › MySQL › Azure Landing Zones Library

Enforce recommended guardrails for MySQL

Converted Initiative Version 1.1.0

This policy initiative is a group of policies that ensures MySQL is compliant per regulated Landing Zones.

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

Azure Policy JSONEnforce-Guardrails-MySQL.alz_policy_set_definition.json · 62 lines
{
  "name": "Enforce-Guardrails-MySQL",
  "properties": {
    "description": "This policy initiative is a group of policies that ensures MySQL is compliant per regulated Landing Zones.",
    "displayName": "Enforce recommended guardrails for MySQL",
    "metadata": {
      "alzCloudEnvironments": [
        "AzureCloud",
        "AzureChinaCloud",
        "AzureUSGovernment"
      ],
      "category": "MySQL",
      "source": "https://github.com/Azure/Enterprise-Scale/",
      "version": "1.1.0"
    },
    "parameters": {
      "mySqlAdvThreatProtection": {
        "allowedValues": [
          "DeployIfNotExists",
          "Disabled"
        ],
        "defaultValue": "DeployIfNotExists",
        "type": "string"
      },
      "mySqlInfraEncryption": {
        "allowedValues": [
          "Audit",
          "Deny",
          "Disabled"
        ],
        "defaultValue": "Deny",
        "type": "string"
      }
    },
    "policyDefinitions": [
      {
        "definitionVersion": "1.*.*",
        "groupNames": [],
        "parameters": {
          "effect": {
            "value": "[parameters('mySqlAdvThreatProtection')]"
          }
        },
        "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/80ed5239-4122-41ed-b54a-6f1fa7552816",
        "policyDefinitionReferenceId": "Dine-MySql-Adv-Threat-Protection"
      },
      {
        "definitionVersion": "1.*.*",
        "groupNames": [],
        "parameters": {
          "effect": {
            "value": "[parameters('mySqlInfraEncryption')]"
          }
        },
        "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/3a58212a-c829-4f13-9872-6371df2fd0b4",
        "policyDefinitionReferenceId": "Deny-MySql-Infra-Encryption"
      }
    ],
    "policyType": "Custom"
  },
  "type": "Microsoft.Authorization/policySetDefinitions"
}
BylawEnforce-Guardrails-MySQL.bylaw.ps1 · 40 lines
# Converted from Enforce-Guardrails-MySQL.alz_policy_set_definition.json by ConvertTo-Bylaw.
Initiative 'Enforce-Guardrails-MySQL' {

    Properties @{
        DisplayName = 'Enforce recommended guardrails for MySQL'
        Description = 'This policy initiative is a group of policies that ensures MySQL is compliant per regulated Landing Zones.'
        Category    = 'MySQL'
        Version     = '1.1.0'
        Metadata    = [ordered]@{ alzCloudEnvironments = @('AzureCloud', 'AzureChinaCloud', 'AzureUSGovernment'); source = 'https://github.com/Azure/Enterprise-Scale/' }
    }

    Parameter MySqlAdvThreatProtection @{
        Type          = 'string'
        AllowedValues = @('DeployIfNotExists', 'Disabled')
        Default       = 'DeployIfNotExists'
    }
    Parameter MySqlInfraEncryption @{
        Type          = 'string'
        AllowedValues = @('Audit', 'Deny', 'Disabled')
        Default       = 'Deny'
    }

    PolicyDefinition @{
        Id          = '80ed5239-4122-41ed-b54a-6f1fa7552816'
        ReferenceId = 'Dine-MySql-Adv-Threat-Protection'
        Version     = '1.*.*'
        Parameters  = @{
            effect = (Param MySqlAdvThreatProtection)
        }
    }

    PolicyDefinition @{
        Id          = '3a58212a-c829-4f13-9872-6371df2fd0b4'
        ReferenceId = 'Deny-MySql-Infra-Encryption'
        Version     = '1.*.*'
        Parameters  = @{
            effect = (Param MySqlInfraEncryption)
        }
    }
}

Members (2)

Source: policy_set_definitions/Enforce-Guardrails-MySQL.alz_policy_set_definition.json in Azure/Azure-Landing-Zones-Library, under the MIT licence.