Bylaw

Gallery › Mission › Azure built-in policies

Control the use of Container Registry in Mission Platforms

Converted Initiative Version 1.0.0

This policy set applies exclusively to Mission Platform products and services; usage outside of these scopes is not supported. It deploys coordinated Container Registry controls that enforce private network access, tenant isolation, and boundary protection across Mission Platform workloads; refer to https://learn.microsoft.com/azure/container-registry/container-registry-private-link for architectural guidance.

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

Azure Policy JSONACRInitiative.json · 95 lines
{
  "properties": {
    "displayName": "Control the use of Container Registry in Mission Platforms",
    "policyType": "BuiltIn",
    "description": "This policy set applies exclusively to Mission Platform products and services; usage outside of these scopes is not supported. It deploys coordinated Container Registry controls that enforce private network access, tenant isolation, and boundary protection across Mission Platform workloads; refer to https://learn.microsoft.com/azure/container-registry/container-registry-private-link for architectural guidance.",
    "metadata": {
      "version": "1.0.0",
      "category": "Mission"
    },
    "version": "1.0.0",
    "parameters": {
      "Effect": {
        "type": "String",
        "metadata": {
          "displayName": "Effect",
          "description": "Enable or disable the execution of the policies in this initiative"
        },
        "allowedValues": [
          "Audit",
          "Deny",
          "Disabled"
        ],
        "defaultValue": "Audit"
      },
      "excludedSubscriptionIDs": {
        "type": "Array",
        "metadata": {
          "displayName": "Excluded Subscription IDs",
          "description": "List of subscription IDs to exclude from policy evaluation"
        },
        "defaultValue": []
      }
    },
    "policyDefinitions": [
      {
        "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/a3701552-92ea-433e-9d17-33b7f1208fc9",
        "policyDefinitionReferenceId": "ContainerRegistryDisablePublicNetworkAccess",
        "definitionVersion": "1.*.*"
      },
      {
        "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/d0793b48-0edc-4296-a390-4c75d1bdfd71",
        "policyDefinitionReferenceId": "ContainerRegistryShouldNotAllowUnrestrictedNetworkAccess",
        "definitionVersion": "2.*.*"
      },
      {
        "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/9f2dea28-e834-476c-99c5-3507b4728395",
        "policyDefinitionReferenceId": "ContainerRegistryAnonymousAuthenticationDisabled",
        "definitionVersion": "1.*.*"
      },
      {
        "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/cced2946-b08a-44fe-9fd9-e4ed8a779897",
        "policyDefinitionReferenceId": "ContainerRegistryConfiguredAnonymousAuthenticationDisabled",
        "definitionVersion": "1.*.*"
      },
      {
        "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/bd560fc0-3c69-498a-ae9f-aa8eb7de0e13",
        "policyDefinitionReferenceId": "ContainerRegistryShouldHaveSkuSupportForPrivateLinks",
        "definitionVersion": "1.*.*"
      },
      {
        "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/e8eef0a8-67cf-4eb4-9386-14b0e78733d4",
        "policyDefinitionReferenceId": "ContainerRegistryShouldHavePrivateLink",
        "definitionVersion": "1.*.*"
      },
      {
        "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/0fdf0491-d080-4575-b627-ad0e843cba0f",
        "policyDefinitionReferenceId": "ContainerRegistryShouldHavePublicNetworkAccessDisabled",
        "definitionVersion": "1.*.*"
      },
      {
        "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/5b9159ae-1701-4a6f-9a7a-aa9c8ddd0580",
        "policyDefinitionReferenceId": "ContainerRegistryShouldUseCmkForEncryption",
        "definitionVersion": "1.*.*"
      },
      {
        "policyDefinitionId": "/providers/Microsoft.Authorization/policyDefinitions/696cb1d3-2dcf-4b44-aa7a-caccd18b1b96",
        "policyDefinitionReferenceId": "ContainerRegistryShouldRestrictExternalPrivateEndPoint",
        "definitionVersion": "1.*.*",
        "parameters": {
          "effect": {
            "value": "[parameters('Effect')]"
          },
          "excludedSubscriptionIDs": {
            "value": "[parameters('excludedSubscriptionIDs')]"
          }
        }
      }
    ],
    "versions": [
      "1.0.0"
    ]
  },
  "id": "/providers/Microsoft.Authorization/policySetDefinitions/d64f0787-1470-495d-b747-8534ff151e05",
  "name": "d64f0787-1470-495d-b747-8534ff151e05"
}
Bylawd64f0787-1470-495d-b747-8534ff151e05.bylaw.ps1 · 83 lines
# Converted from ACRInitiative.json by ConvertTo-Bylaw.
Initiative 'd64f0787-1470-495d-b747-8534ff151e05' {

    Properties @{
        DisplayName   = 'Control the use of Container Registry in Mission Platforms'
        Description   = 'This policy set applies exclusively to Mission Platform products and services; usage outside of these scopes is not supported. It deploys coordinated Container Registry controls that enforce private network access, tenant isolation, and boundary protection across Mission Platform workloads; refer to https://learn.microsoft.com/azure/container-registry/container-registry-private-link for architectural guidance.'
        Version       = '1.0.0'
        Category      = 'Mission'
        PolicyVersion = '1.0.0'
    }

    Parameter Effect @{
        AllowedValues = @('Audit', 'Deny', 'Disabled')
        Default       = 'Audit'
        DisplayName   = 'Effect'
        Description   = 'Enable or disable the execution of the policies in this initiative'
        JsonName      = 'Effect'
    }
    Parameter ExcludedSubscriptionIDs @{
        Type        = 'Array'
        Default     = @()
        DisplayName = 'Excluded Subscription IDs'
        Description = 'List of subscription IDs to exclude from policy evaluation'
    }

    PolicyDefinition @{
        Id          = 'a3701552-92ea-433e-9d17-33b7f1208fc9'
        ReferenceId = 'ContainerRegistryDisablePublicNetworkAccess'
        Version     = '1.*.*'
    }

    PolicyDefinition @{
        Id          = 'd0793b48-0edc-4296-a390-4c75d1bdfd71'
        ReferenceId = 'ContainerRegistryShouldNotAllowUnrestrictedNetworkAccess'
        Version     = '2.*.*'
    }

    PolicyDefinition @{
        Id          = '9f2dea28-e834-476c-99c5-3507b4728395'
        ReferenceId = 'ContainerRegistryAnonymousAuthenticationDisabled'
        Version     = '1.*.*'
    }

    PolicyDefinition @{
        Id          = 'cced2946-b08a-44fe-9fd9-e4ed8a779897'
        ReferenceId = 'ContainerRegistryConfiguredAnonymousAuthenticationDisabled'
        Version     = '1.*.*'
    }

    PolicyDefinition @{
        Id          = 'bd560fc0-3c69-498a-ae9f-aa8eb7de0e13'
        ReferenceId = 'ContainerRegistryShouldHaveSkuSupportForPrivateLinks'
        Version     = '1.*.*'
    }

    PolicyDefinition @{
        Id          = 'e8eef0a8-67cf-4eb4-9386-14b0e78733d4'
        ReferenceId = 'ContainerRegistryShouldHavePrivateLink'
        Version     = '1.*.*'
    }

    PolicyDefinition @{
        Id          = '0fdf0491-d080-4575-b627-ad0e843cba0f'
        ReferenceId = 'ContainerRegistryShouldHavePublicNetworkAccessDisabled'
        Version     = '1.*.*'
    }

    PolicyDefinition @{
        Id          = '5b9159ae-1701-4a6f-9a7a-aa9c8ddd0580'
        ReferenceId = 'ContainerRegistryShouldUseCmkForEncryption'
        Version     = '1.*.*'
    }

    PolicyDefinition @{
        Id          = '696cb1d3-2dcf-4b44-aa7a-caccd18b1b96'
        ReferenceId = 'ContainerRegistryShouldRestrictExternalPrivateEndPoint'
        Version     = '1.*.*'
        Parameters  = [ordered]@{
            effect                  = (Param Effect)
            excludedSubscriptionIDs = (Param ExcludedSubscriptionIDs)
        }
    }
}

Members (9)

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