Gallery › App Service › Azure Community Policy
Function apps should have basic local authentication methods disabled for FTP deployments
Converted Policy AuditIfNotExists Disabled Mode Indexed Version 1.0.0
Disabling local authentication methods for FTP deployments improves security by ensuring that Function apps exclusively require Microsoft Entra identities for authentication. Learn more at: https://aka.ms/app-service-disable-basic-auth.
ConvertTo-Bylaw converted this policy, and proved that the file compiles back to the same definition.
Azure Policy JSONazurepolicy.json · 56 lines
{
"name": "91e9e5aa-e64b-4124-ba4e-87e5b43f3820",
"type": "Microsoft.Authorization/policyDefinitions",
"properties": {
"displayName": "Function apps should have basic local authentication methods disabled for FTP deployments",
"description": "Disabling local authentication methods for FTP deployments improves security by ensuring that Function apps exclusively require Microsoft Entra identities for authentication. Learn more at: https://aka.ms/app-service-disable-basic-auth.",
"metadata": {
"version": "1.0.0",
"category": "App Service"
},
"mode": "Indexed",
"parameters": {
"effect": {
"type": "String",
"metadata": {
"displayName": "Effect",
"description": "AuditIfNotExists or Disabled the execution of the Policy"
},
"allowedValues": [
"AuditIfNotExists",
"Disabled"
],
"defaultValue": "AuditIfNotExists"
}
},
"policyRule": {
"if": {
"allOf": [
{
"field": "type",
"equals": "Microsoft.Web/sites"
},
{
"field": "kind",
"Contains": "functionapp"
},
{
"field": "kind",
"notContains": "workflowapp"
}
]
},
"then": {
"effect": "[parameters('effect')]",
"details": {
"name": "ftp",
"type": "Microsoft.Web/sites/basicPublishingCredentialsPolicies",
"existenceCondition": {
"field": "Microsoft.Web/sites/basicPublishingCredentialsPolicies/allow",
"equals": "false"
}
}
}
}
}
}Bylaw91e9e5aa-e64b-4124-ba4e-87e5b43f3820.bylaw.ps1 · 35 lines
# Converted from azurepolicy.json by ConvertTo-Bylaw.
Policy '91e9e5aa-e64b-4124-ba4e-87e5b43f3820' {
Properties @{
DisplayName = 'Function apps should have basic local authentication methods disabled for FTP deployments'
Description = 'Disabling local authentication methods for FTP deployments improves security by ensuring that Function apps exclusively require Microsoft Entra identities for authentication. Learn more at: https://aka.ms/app-service-disable-basic-auth.'
Version = '1.0.0'
Category = 'App Service'
Mode = 'Indexed'
}
Parameter Effect @{
AllowedValues = @('AuditIfNotExists', 'Disabled')
Default = 'AuditIfNotExists'
DisplayName = 'Effect'
Description = 'AuditIfNotExists or Disabled the execution of the Policy'
}
Resource 'Microsoft.Web/sites' {
When {
Field kind | Must -ContainText 'functionapp'
}
Require 'kind contains workflowapp' {
Field kind | Must -ContainText 'workflowapp'
}
}
AuditIfNotExists 'Microsoft.Web/sites/basicPublishingCredentialsPolicies' -Name 'ftp' -Effect (Param Effect) {
Require 'allow is false' {
Field allow | Must -Be 'false'
}
}
}Source: policyDefinitions/App Service/function-apps-should-have-ftp-basic-auth-disabled/azurepolicy.json in Azure/Community-Policy, under the MIT licence.
Bylaw