Gallery › Machine Learning › Azure Landing Zones Library
Deny public access of Azure Machine Learning clusters via SSH
Converted Policy Audit Deny Disabled Mode All Version 1.1.0
Deny public access of Azure Machine Learning clusters via SSH.
ConvertTo-Bylaw converted this policy, and proved that the file compiles back to the same definition.
Azure Policy JSONDeny-MachineLearning-ComputeCluster-RemoteLoginPortPublicAccess.alz_policy_definition.json · 62 lines
{
"name": "Deny-MachineLearning-ComputeCluster-RemoteLoginPortPublicAccess",
"properties": {
"description": "Deny public access of Azure Machine Learning clusters via SSH.",
"displayName": "Deny public access of Azure Machine Learning clusters via SSH",
"metadata": {
"alzCloudEnvironments": [
"AzureCloud"
],
"category": "Machine Learning",
"source": "https://github.com/Azure/Enterprise-Scale/",
"version": "1.1.0"
},
"mode": "All",
"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/computes",
"field": "type"
},
{
"equals": "AmlCompute",
"field": "Microsoft.MachineLearningServices/workspaces/computes/computeType"
},
{
"anyOf": [
{
"exists": false,
"field": "Microsoft.MachineLearningServices/workspaces/computes/remoteLoginPortPublicAccess"
},
{
"field": "Microsoft.MachineLearningServices/workspaces/computes/remoteLoginPortPublicAccess",
"notEquals": "Disabled"
}
]
}
]
},
"then": {
"effect": "[parameters('effect')]"
}
},
"policyType": "Custom"
},
"type": "Microsoft.Authorization/policyDefinitions"
}BylawDeny-MachineLearning-ComputeCluster-RemoteLoginPortPublicAccess.bylaw.ps1 · 36 lines
# Converted from Deny-MachineLearning-ComputeCluster-RemoteLoginPortPublicAccess.alz_policy_definition.json by ConvertTo-Bylaw.
Policy 'Deny-MachineLearning-ComputeCluster-RemoteLoginPortPublicAccess' {
Properties @{
DisplayName = 'Deny public access of Azure Machine Learning clusters via SSH'
Description = 'Deny public access of Azure Machine Learning clusters via SSH.'
Category = 'Machine Learning'
Version = '1.1.0'
Mode = 'All'
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/computes' {
When {
Field computeType | Must -Be 'AmlCompute'
}
Require 'remoteLoginPortPublicAccess exists' {
Field remoteLoginPortPublicAccess | Must -Exist
}
Require 'remoteLoginPortPublicAccess is Disabled' {
Field remoteLoginPortPublicAccess | Must -Be 'Disabled'
}
}
Effect (Param Effect)
}Source: policy_definitions/Deny-MachineLearning-ComputeCluster-RemoteLoginPortPublicAccess.alz_policy_definition.json in Azure/Azure-Landing-Zones-Library, under the MIT licence.
Bylaw