Gallery › Internet of Things › Azure built-in policies
Azure IoT Hub should have local authentication methods disabled for Service Apis
Converted Policy Audit Deny Disabled Mode Indexed Version 1.0.0
Disabling local authentication methods improves security by ensuring that Azure IoT Hub exclusively require Azure Active Directory identities for Service Api authentication. Learn more at: https://aka.ms/iothubdisablelocalauth.
ConvertTo-Bylaw converted this policy, and proved that the file compiles back to the same definition.
Azure Policy JSONIoTHub_DisableLocalAuth_AuditDeny.json · 50 lines
{
"properties": {
"displayName": "Azure IoT Hub should have local authentication methods disabled for Service Apis",
"policyType": "BuiltIn",
"mode": "Indexed",
"description": "Disabling local authentication methods improves security by ensuring that Azure IoT Hub exclusively require Azure Active Directory identities for Service Api authentication. Learn more at: https://aka.ms/iothubdisablelocalauth.",
"metadata": {
"version": "1.0.0",
"category": "Internet of Things"
},
"version": "1.0.0",
"parameters": {
"effect": {
"type": "String",
"defaultValue": "Audit",
"allowedValues": [
"Audit",
"Deny",
"Disabled"
],
"metadata": {
"displayName": "Effect",
"description": "Enable or disable the execution of the policy"
}
}
},
"policyRule": {
"if": {
"allOf": [
{
"field": "type",
"equals": "Microsoft.Devices/IotHubs"
},
{
"field": "Microsoft.Devices/IotHubs/disableLocalAuth",
"notEquals": true
}
]
},
"then": {
"effect": "[parameters('effect')]"
}
},
"versions": [
"1.0.0"
]
},
"id": "/providers/Microsoft.Authorization/policyDefinitions/672d56b3-23a7-4a3c-a233-b77ed7777518",
"name": "672d56b3-23a7-4a3c-a233-b77ed7777518"
}Bylaw672d56b3-23a7-4a3c-a233-b77ed7777518.bylaw.ps1 · 28 lines
# Converted from IoTHub_DisableLocalAuth_AuditDeny.json by ConvertTo-Bylaw.
Policy '672d56b3-23a7-4a3c-a233-b77ed7777518' {
Properties @{
DisplayName = 'Azure IoT Hub should have local authentication methods disabled for Service Apis'
Description = 'Disabling local authentication methods improves security by ensuring that Azure IoT Hub exclusively require Azure Active Directory identities for Service Api authentication. Learn more at: https://aka.ms/iothubdisablelocalauth.'
Version = '1.0.0'
Category = 'Internet of Things'
PolicyVersion = '1.0.0'
Mode = 'Indexed'
}
Parameter Effect @{
AllowedValues = @('Audit', 'Deny', 'Disabled')
Default = 'Audit'
DisplayName = 'Effect'
Description = 'Enable or disable the execution of the policy'
}
Resource 'Microsoft.Devices/IotHubs' {
Require 'disableLocalAuth is true' {
Field disableLocalAuth | Must -Be $true
}
}
Effect (Param Effect)
}Source: built-in-policies/policyDefinitions/Internet of Things/IoTHub_DisableLocalAuth_AuditDeny.json in Azure/azure-policy, under the MIT licence.
Bylaw