Gallery › Internet of Things › Azure built-in policies
Azure Device Update for IoT Hub accounts should use private link
Converted Policy AuditIfNotExists Disabled Mode Indexed Version 1.0.0
Azure Private Link lets you connect your virtual network to Azure services without a public IP address at the source or destination. The Private Link platform handles the connectivity between the consumer and services over the Azure backbone network. By mapping private endpoints to Azure Device Update for IoT Hub accounts, data leakage risks are reduced.
ConvertTo-Bylaw converted this policy, and proved that the file compiles back to the same definition.
Azure Policy JSONDeviceUpdate_PrivateLink_AINE.json · 60 lines
{
"properties": {
"displayName": "Azure Device Update for IoT Hub accounts should use private link",
"policyType": "BuiltIn",
"mode": "Indexed",
"description": "Azure Private Link lets you connect your virtual network to Azure services without a public IP address at the source or destination. The Private Link platform handles the connectivity between the consumer and services over the Azure backbone network. By mapping private endpoints to Azure Device Update for IoT Hub accounts, data leakage risks are reduced.",
"metadata": {
"version": "1.0.0",
"category": "Internet of Things"
},
"version": "1.0.0",
"parameters": {
"effect": {
"type": "String",
"metadata": {
"displayName": "Effect",
"description": "Enable or disable the execution of the policy"
},
"allowedValues": [
"AuditIfNotExists",
"Disabled"
],
"defaultValue": "AuditIfNotExists"
}
},
"policyRule": {
"if": {
"field": "type",
"equals": "Microsoft.DeviceUpdate/accounts"
},
"then": {
"effect": "[parameters('effect')]",
"details": {
"type": "Microsoft.DeviceUpdate/accounts/privateEndpointConnections",
"existenceCondition": {
"allOf": [
{
"field": "Microsoft.DeviceUpdate/accounts/privateEndpointConnections/privateEndpoint",
"exists": "true"
},
{
"field": "Microsoft.DeviceUpdate/accounts/privateEndpointConnections/provisioningState",
"equals": "Succeeded"
},
{
"field": "Microsoft.DeviceUpdate/accounts/privateEndpointConnections/privateLinkServiceConnectionState.status",
"equals": "Approved"
}
]
}
}
}
},
"versions": [
"1.0.0"
]
},
"id": "/providers/Microsoft.Authorization/policyDefinitions/27d4c5ec-8820-443f-91fe-1215e96f64b2",
"name": "27d4c5ec-8820-443f-91fe-1215e96f64b2"
}Bylaw27d4c5ec-8820-443f-91fe-1215e96f64b2.bylaw.ps1 · 29 lines
# Converted from DeviceUpdate_PrivateLink_AINE.json by ConvertTo-Bylaw.
Policy '27d4c5ec-8820-443f-91fe-1215e96f64b2' {
Properties @{
DisplayName = 'Azure Device Update for IoT Hub accounts should use private link'
Description = 'Azure Private Link lets you connect your virtual network to Azure services without a public IP address at the source or destination. The Private Link platform handles the connectivity between the consumer and services over the Azure backbone network. By mapping private endpoints to Azure Device Update for IoT Hub accounts, data leakage risks are reduced.'
Version = '1.0.0'
Category = 'Internet of Things'
PolicyVersion = '1.0.0'
Mode = 'Indexed'
}
Parameter Effect @{
AllowedValues = @('AuditIfNotExists', 'Disabled')
Default = 'AuditIfNotExists'
DisplayName = 'Effect'
Description = 'Enable or disable the execution of the policy'
}
Resource 'Microsoft.DeviceUpdate/accounts'
AuditIfNotExists 'Microsoft.DeviceUpdate/accounts/privateEndpointConnections' -Effect (Param Effect) {
Require 'privateEndpoint, provisioningState and privateLinkServiceConnectionState.status are as required' {
Field privateEndpoint | Must -Exist
Field provisioningState | Must -Be 'Succeeded'
Field privateLinkServiceConnectionState.status | Must -Be 'Approved'
}
}
}Source: built-in-policies/policyDefinitions/Internet of Things/DeviceUpdate_PrivateLink_AINE.json in Azure/azure-policy, under the MIT licence.
Bylaw