Gallery › Machine Learning › Azure Landing Zones Library
Deny public access behind vnet to Azure Machine Learning workspace
Converted Policy Audit Deny Disabled Mode Indexed Version 1.0.1
Deny public access behind vnet to Azure Machine Learning workspaces.
ConvertTo-Bylaw converted this policy, and proved that the file compiles back to the same definition.
Azure Policy JSONDeny-MachineLearning-PublicAccessWhenBehindVnet.alz_policy_definition.json · 58 lines
{
"name": "Deny-MachineLearning-PublicAccessWhenBehindVnet",
"properties": {
"description": "Deny public access behind vnet to Azure Machine Learning workspaces.",
"displayName": "Deny public access behind vnet to Azure Machine Learning workspace",
"metadata": {
"alzCloudEnvironments": [
"AzureCloud"
],
"category": "Machine Learning",
"source": "https://github.com/Azure/Enterprise-Scale/",
"version": "1.0.1"
},
"mode": "Indexed",
"parameters": {
"effect": {
"allowedValues": [
"Audit",
"Disabled",
"Deny"
],
"defaultValue": "Deny",
"metadata": {
"description": "Enable or disable the execution of the policy",
"displayName": "Effect"
},
"type": "String"
}
},
"policyRule": {
"if": {
"allOf": [
{
"equals": "Microsoft.MachineLearningServices/workspaces",
"field": "type"
},
{
"anyOf": [
{
"exists": false,
"field": "Microsoft.MachineLearningServices/workspaces/allowPublicAccessWhenBehindVnet"
},
{
"field": "Microsoft.MachineLearningServices/workspaces/allowPublicAccessWhenBehindVnet",
"notEquals": false
}
]
}
]
},
"then": {
"effect": "[parameters('effect')]"
}
},
"policyType": "Custom"
},
"type": "Microsoft.Authorization/policyDefinitions"
}BylawDeny-MachineLearning-PublicAccessWhenBehindVnet.bylaw.ps1 · 32 lines
# Converted from Deny-MachineLearning-PublicAccessWhenBehindVnet.alz_policy_definition.json by ConvertTo-Bylaw.
Policy 'Deny-MachineLearning-PublicAccessWhenBehindVnet' {
Properties @{
DisplayName = 'Deny public access behind vnet to Azure Machine Learning workspace'
Description = 'Deny public access behind vnet to Azure Machine Learning workspaces.'
Category = 'Machine Learning'
Version = '1.0.1'
Mode = 'Indexed'
Metadata = [ordered]@{ alzCloudEnvironments = @('AzureCloud'); source = 'https://github.com/Azure/Enterprise-Scale/' }
}
Parameter Effect @{
AllowedValues = @('Audit', 'Disabled', 'Deny')
Default = 'Deny'
DisplayName = 'Effect'
Description = 'Enable or disable the execution of the policy'
}
Resource 'Microsoft.MachineLearningServices/workspaces' {
Require 'allowPublicAccessWhenBehindVnet exists' {
Field allowPublicAccessWhenBehindVnet | Must -Exist
}
Require 'allowPublicAccessWhenBehindVnet is false' {
Field allowPublicAccessWhenBehindVnet | Must -Be $false
}
}
Effect (Param Effect)
}Source: policy_definitions/Deny-MachineLearning-PublicAccessWhenBehindVnet.alz_policy_definition.json in Azure/Azure-Landing-Zones-Library, under the MIT licence.
Bylaw