Gallery › Machine Learning › Azure Landing Zones Library
Control private endpoint connections to Azure Machine Learning
Converted Policy Audit Deny Disabled Mode Indexed Version 1.0.0
Audit private endpoints that are created in other subscriptions and/or tenants for Azure Machine Learning.
ConvertTo-Bylaw converted this policy, and proved that the file compiles back to the same definition.
Azure Policy JSONAudit-MachineLearning-PrivateEndpointId.alz_policy_definition.json · 62 lines
{
"name": "Audit-MachineLearning-PrivateEndpointId",
"properties": {
"description": "Audit private endpoints that are created in other subscriptions and/or tenants for Azure Machine Learning.",
"displayName": "Control private endpoint connections to Azure Machine Learning",
"metadata": {
"alzCloudEnvironments": [
"AzureCloud"
],
"category": "Machine Learning",
"source": "https://github.com/Azure/Enterprise-Scale/",
"version": "1.0.0"
},
"mode": "Indexed",
"parameters": {
"effect": {
"allowedValues": [
"Audit",
"Deny",
"Disabled"
],
"defaultValue": "Audit",
"metadata": {
"description": "Enable or disable the execution of the policy",
"displayName": "Effect"
},
"type": "String"
}
},
"policyRule": {
"if": {
"allOf": [
{
"equals": "Microsoft.MachineLearningServices/workspaces/privateEndpointConnections",
"field": "type"
},
{
"equals": "Approved",
"field": "Microsoft.MachineLearningServices/workspaces/privateEndpointConnections/privateLinkServiceConnectionState.status"
},
{
"anyOf": [
{
"exists": false,
"field": "Microsoft.MachineLearningServices/workspaces/privateEndpointConnections/privateEndpoint.id"
},
{
"notEquals": "[subscription().subscriptionId]",
"value": "[split(concat(field('Microsoft.MachineLearningServices/workspaces/privateEndpointConnections/privateEndpoint.id'), '//'), '/')[2]]"
}
]
}
]
},
"then": {
"effect": "[parameters('effect')]"
}
},
"policyType": "Custom"
},
"type": "Microsoft.Authorization/policyDefinitions"
}BylawAudit-MachineLearning-PrivateEndpointId.bylaw.ps1 · 36 lines
# Converted from Audit-MachineLearning-PrivateEndpointId.alz_policy_definition.json by ConvertTo-Bylaw.
Policy 'Audit-MachineLearning-PrivateEndpointId' {
Properties @{
DisplayName = 'Control private endpoint connections to Azure Machine Learning'
Description = 'Audit private endpoints that are created in other subscriptions and/or tenants for Azure Machine Learning.'
Category = 'Machine Learning'
Version = '1.0.0'
Mode = 'Indexed'
Metadata = [ordered]@{ alzCloudEnvironments = @('AzureCloud'); source = 'https://github.com/Azure/Enterprise-Scale/' }
}
Parameter Effect @{
AllowedValues = @('Audit', 'Deny', 'Disabled')
Default = 'Audit'
DisplayName = 'Effect'
Description = 'Enable or disable the execution of the policy'
}
Resource 'Microsoft.MachineLearningServices/workspaces/privateEndpointConnections' {
When {
Field privateLinkServiceConnectionState.status | Must -Be 'Approved'
}
Require 'privateEndpoint.id exists' {
Field privateEndpoint.id | Must -Exist
}
Require 'privateEndpoint.id is as required' {
Arm '[split(concat(field(''Microsoft.MachineLearningServices/workspaces/privateEndpointConnections/privateEndpoint.id''), ''//''), ''/'')[2]]' | Must -Be (Arm '[subscription().subscriptionId]')
}
}
Effect (Param Effect)
}Source: policy_definitions/Audit-MachineLearning-PrivateEndpointId.alz_policy_definition.json in Azure/Azure-Landing-Zones-Library, under the MIT licence.
Bylaw