Bylaw

Gallery › PostgreSQL › Azure Landing Zones Library

Enforce recommended guardrails for PostgreSQL

Converted Initiative Version 1.2.0

This policy initiative is a group of policies that ensures PostgreSQL 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-PostgreSQL.alz_policy_set_definition.json · 53 lines
{
  "name": "Enforce-Guardrails-PostgreSQL",
  "properties": {
    "description": "This policy initiative is a group of policies that ensures PostgreSQL is compliant per regulated Landing Zones.",
    "displayName": "Enforce recommended guardrails for PostgreSQL",
    "metadata": {
      "alzCloudEnvironments": [
        "AzureCloud",
        "AzureChinaCloud",
        "AzureUSGovernment"
      ],
      "category": "PostgreSQL",
      "source": "https://github.com/Azure/Enterprise-Scale/",
      "version": "1.2.0"
    },
    "parameters": {
      "postgreSqlAdvThreatProtection": {
        "allowedValues": [
          "DeployIfNotExists",
          "Disabled"
        ],
        "defaultValue": "DeployIfNotExists",
        "type": "string"
      }
    },
    "policyDefinitions": [
      {
        "definitionVersion": "1.*.*",
        "groupNames": [],
        "parameters": {
          "effect": {
            "value": "[parameters('postgreSqlAdvThreatProtection')]"
          }
        },
        "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/db048e65-913c-49f9-bb5f-1084184671d3",
        "policyDefinitionReferenceId": "Dine-PostgreSql-Adv-Threat-Protection"
      },
      {
        "definitionVersion": "1.*.*",
        "groupNames": [],
        "parameters": {
          "effect": {
            "value": "[parameters('postgreSqlAdvThreatProtection')]"
          }
        },
        "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/2a6ae02f-7590-40d7-88ba-b18e205a32fd",
        "policyDefinitionReferenceId": "Dine-PostgreSql-Flexible-Adv-Threat-Protection"
      }
    ],
    "policyType": "Custom"
  },
  "type": "Microsoft.Authorization/policySetDefinitions"
}
BylawEnforce-Guardrails-PostgreSQL.bylaw.ps1 · 35 lines
# Converted from Enforce-Guardrails-PostgreSQL.alz_policy_set_definition.json by ConvertTo-Bylaw.
Initiative 'Enforce-Guardrails-PostgreSQL' {

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

    Parameter PostgreSqlAdvThreatProtection @{
        Type          = 'string'
        AllowedValues = @('DeployIfNotExists', 'Disabled')
        Default       = 'DeployIfNotExists'
    }

    PolicyDefinition @{
        Id          = 'db048e65-913c-49f9-bb5f-1084184671d3'
        ReferenceId = 'Dine-PostgreSql-Adv-Threat-Protection'
        Version     = '1.*.*'
        Parameters  = @{
            effect = (Param PostgreSqlAdvThreatProtection)
        }
    }

    PolicyDefinition @{
        Id          = '2a6ae02f-7590-40d7-88ba-b18e205a32fd'
        ReferenceId = 'Dine-PostgreSql-Flexible-Adv-Threat-Protection'
        Version     = '1.*.*'
        Parameters  = @{
            effect = (Param PostgreSqlAdvThreatProtection)
        }
    }
}

Members (2)

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