Bylaw

Gallery › App Configuration › Azure built-in policies

App Configuration stores should have local authentication methods disabled

Converted Policy Audit Deny Disabled Mode Indexed Version 1.0.1

Disabling local authentication methods improves security by ensuring that App Configuration stores require Microsoft Entra identities exclusively for authentication. Learn more at: https://go.microsoft.com/fwlink/?linkid=2161954.

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

Azure Policy JSONDisableLocalAuth_Audit.json · 50 lines
{
  "properties": {
    "displayName": "App Configuration stores should have local authentication methods disabled",
    "policyType": "BuiltIn",
    "mode": "Indexed",
    "description": "Disabling local authentication methods improves security by ensuring that App Configuration stores require Microsoft Entra identities exclusively for authentication. Learn more at: https://go.microsoft.com/fwlink/?linkid=2161954.",
    "metadata": {
      "version": "1.0.1",
      "category": "App Configuration"
    },
    "version": "1.0.1",
    "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.AppConfiguration/configurationStores"
          },
          {
            "field": "Microsoft.AppConfiguration/configurationStores/disableLocalAuth",
            "notEquals": true
          }
        ]
      },
      "then": {
        "effect": "[parameters('effect')]"
      }
    },
    "versions": [
      "1.0.1"
    ]
  },
  "id": "/providers/Microsoft.Authorization/policyDefinitions/b08ab3ca-1062-4db3-8803-eec9cae605d6",
  "name": "b08ab3ca-1062-4db3-8803-eec9cae605d6"
}
Bylawb08ab3ca-1062-4db3-8803-eec9cae605d6.bylaw.ps1 · 28 lines
# Converted from DisableLocalAuth_Audit.json by ConvertTo-Bylaw.
Policy 'b08ab3ca-1062-4db3-8803-eec9cae605d6' {

    Properties @{
        DisplayName   = 'App Configuration stores should have local authentication methods disabled'
        Description   = 'Disabling local authentication methods improves security by ensuring that App Configuration stores require Microsoft Entra identities exclusively for authentication. Learn more at: https://go.microsoft.com/fwlink/?linkid=2161954.'
        Version       = '1.0.1'
        Category      = 'App Configuration'
        PolicyVersion = '1.0.1'
        Mode          = 'Indexed'
    }

    Parameter Effect @{
        AllowedValues = @('Audit', 'Deny', 'Disabled')
        Default       = 'Audit'
        DisplayName   = 'Effect'
        Description   = 'Enable or disable the execution of the policy'
    }

    Resource 'Microsoft.AppConfiguration/configurationStores' {

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

    Effect (Param Effect)
}

Source: built-in-policies/policyDefinitions/App Configuration/DisableLocalAuth_Audit.json in Azure/azure-policy, under the MIT licence.