Bylaw

Gallery › SignalR › Azure built-in policies

Azure SignalR Service 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 Azure SignalR Service exclusively require Azure Active Directory identities for authentication.

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

Azure Policy JSONDisableLocalAuth_AuditDeny.json · 50 lines
{
  "properties": {
    "displayName": "Azure SignalR Service should have local authentication methods disabled",
    "policyType": "BuiltIn",
    "mode": "Indexed",
    "description": "Disabling local authentication methods improves security by ensuring that Azure SignalR Service exclusively require Azure Active Directory identities for authentication.",
    "metadata": {
      "version": "1.0.0",
      "category": "SignalR"
    },
    "version": "1.0.0",
    "parameters": {
      "effect": {
        "type": "String",
        "metadata": {
          "displayName": "Effect",
          "description": "Enable or disable the execution of the policy"
        },
        "allowedValues": [
          "Audit",
          "Deny",
          "Disabled"
        ],
        "defaultValue": "Audit"
      }
    },
    "policyRule": {
      "if": {
        "allOf": [
          {
            "field": "type",
            "equals": "Microsoft.SignalRService/SignalR"
          },
          {
            "field": "Microsoft.SignalRService/SignalR/disableLocalAuth",
            "notEquals": true
          }
        ]
      },
      "then": {
        "effect": "[parameters('effect')]"
      }
    },
    "versions": [
      "1.0.0"
    ]
  },
  "id": "/providers/Microsoft.Authorization/policyDefinitions/f70eecba-335d-4bbc-81d5-5b17b03d498f",
  "name": "f70eecba-335d-4bbc-81d5-5b17b03d498f"
}
Bylawf70eecba-335d-4bbc-81d5-5b17b03d498f.bylaw.ps1 · 28 lines
# Converted from DisableLocalAuth_AuditDeny.json by ConvertTo-Bylaw.
Policy 'f70eecba-335d-4bbc-81d5-5b17b03d498f' {

    Properties @{
        DisplayName   = 'Azure SignalR Service should have local authentication methods disabled'
        Description   = 'Disabling local authentication methods improves security by ensuring that Azure SignalR Service exclusively require Azure Active Directory identities for authentication.'
        Version       = '1.0.0'
        Category      = 'SignalR'
        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.SignalRService/SignalR' {

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

    Effect (Param Effect)
}

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