Bylaw

Gallery › Communication › Azure built-in policies

Communication services resource should have local authentication methods disabled

Converted Policy Audit Deny Disabled Mode Indexed Version 1.0.0

Disabling local authentication methods improves security by ensuring that Communication services resource exclusively require Microsoft Entra ID identities for authentication.

ConvertTo-Bylaw converted this policy, and proved that the file compiles back to the same definition.

Azure Policy JSONCommunication_DisableLocalAuth_Audit.json · 50 lines
{
  "properties": {
    "displayName": "Communication services resource should have local authentication methods disabled",
    "policyType": "BuiltIn",
    "mode": "Indexed",
    "description": "Disabling local authentication methods improves security by ensuring that Communication services resource exclusively require Microsoft Entra ID identities for authentication.",
    "metadata": {
      "version": "1.0.0",
      "category": "Communication"
    },
    "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.Communication/communicationServices"
          },
          {
            "field": "Microsoft.Communication/communicationServices/disableLocalAuth",
            "notEquals": true
          }
        ]
      },
      "then": {
        "effect": "[parameters('effect')]"
      }
    },
    "versions": [
      "1.0.0"
    ]
  },
  "id": "/providers/Microsoft.Authorization/policyDefinitions/fc264132-db9c-4302-bb7d-3994c36461fe",
  "name": "fc264132-db9c-4302-bb7d-3994c36461fe"
}
Bylawfc264132-db9c-4302-bb7d-3994c36461fe.bylaw.ps1 · 28 lines
# Converted from Communication_DisableLocalAuth_Audit.json by ConvertTo-Bylaw.
Policy 'fc264132-db9c-4302-bb7d-3994c36461fe' {

    Properties @{
        DisplayName   = 'Communication services resource should have local authentication methods disabled'
        Description   = 'Disabling local authentication methods improves security by ensuring that Communication services resource exclusively require Microsoft Entra ID identities for authentication.'
        Version       = '1.0.0'
        Category      = 'Communication'
        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.Communication/communicationServices' {

        Require 'disableLocalAuth is true' {
            Field disableLocalAuth | Must -Be $true
        }
    }

    Effect (Param Effect)
}

Source: built-in-policies/policyDefinitions/Communication/Communication_DisableLocalAuth_Audit.json in Azure/azure-policy, under the MIT licence.