Gallery › Internet of Things › Azure built-in policies
Azure IoT Hub should be running TLS version 1.2 or newer
Converted Policy Audit Deny Disabled Mode Indexed Version 1.0.0-preview
Setting the minimum TLS version to 1.2 or newer improves security by ensuring your Azure IoT Hub can only be accessed from clients using TLS 1.2 or newer. Using versions of TLS less than 1.2 is not recommended since they have well documented security vulnerabilities.
ConvertTo-Bylaw converted this policy, and proved that the file compiles back to the same definition.
Azure Policy JSONIoTHub-TLS_Audit.json · 58 lines
{
"properties": {
"displayName": "Azure IoT Hub should be running TLS version 1.2 or newer",
"policyType": "BuiltIn",
"mode": "Indexed",
"description": "Setting the minimum TLS version to 1.2 or newer improves security by ensuring your Azure IoT Hub can only be accessed from clients using TLS 1.2 or newer. Using versions of TLS less than 1.2 is not recommended since they have well documented security vulnerabilities.",
"metadata": {
"version": "1.0.0-preview",
"category": "Internet of Things"
},
"version": "1.0.0-preview",
"parameters": {
"effect": {
"type": "String",
"metadata": {
"displayName": "Effect",
"description": "The effect determines what happens when the policy rule is evaluated to match"
},
"allowedValues": [
"Audit",
"Deny",
"Disabled"
],
"defaultValue": "Audit"
}
},
"policyRule": {
"if": {
"allOf": [
{
"field": "type",
"equals": "Microsoft.Devices/IotHubs"
},
{
"anyOf": [
{
"field": "Microsoft.Devices/IotHubs/minTlsVersion",
"exists": "false"
},
{
"field": "Microsoft.Devices/IotHubs/minTlsVersion",
"less": "1.2"
}
]
}
]
},
"then": {
"effect": "[parameters('effect')]"
}
},
"versions": [
"1.0.0-PREVIEW"
]
},
"id": "/providers/Microsoft.Authorization/policyDefinitions/74d00793-ec3a-4504-94e3-0ec66963833b",
"name": "74d00793-ec3a-4504-94e3-0ec66963833b"
}Bylaw74d00793-ec3a-4504-94e3-0ec66963833b.bylaw.ps1 · 32 lines
# Converted from IoTHub-TLS_Audit.json by ConvertTo-Bylaw.
Policy '74d00793-ec3a-4504-94e3-0ec66963833b' {
Properties @{
DisplayName = 'Azure IoT Hub should be running TLS version 1.2 or newer'
Description = 'Setting the minimum TLS version to 1.2 or newer improves security by ensuring your Azure IoT Hub can only be accessed from clients using TLS 1.2 or newer. Using versions of TLS less than 1.2 is not recommended since they have well documented security vulnerabilities.'
Version = '1.0.0-preview'
Category = 'Internet of Things'
PolicyVersion = '1.0.0-preview'
Mode = 'Indexed'
}
Parameter Effect @{
AllowedValues = @('Audit', 'Deny', 'Disabled')
Default = 'Audit'
DisplayName = 'Effect'
Description = 'The effect determines what happens when the policy rule is evaluated to match'
}
Resource 'Microsoft.Devices/IotHubs' {
Require 'minTlsVersion exists' {
Field minTlsVersion | Must -Exist
}
Require 'minTlsVersion is at least 1.2' {
Field minTlsVersion | Must -BeGreaterOrEqual '1.2' -IfPresent
}
}
Effect (Param Effect)
}Source: built-in-policies/policyDefinitions/Internet of Things/IoTHub-TLS_Audit.json in Azure/azure-policy, under the MIT licence.
Bylaw