Ensure 'Basic Authentication Publishing Credentials' are 'Disabled'
Description
Basic Authentication Publishing Credentials provides the ability to publish -- or deploy to -- an App Service deployment slot without a centralized Identity Provider. For a more effective, capable, and secure solution for Identity, Authentication, Authorization, and Accountability, a centralized Identity Provider such as Entra ID is strongly advised.
Rationale
Basic Authentication introduces an identity silo for privileged access to a resource and produces logging which may not provide a full chain of accountability. This can be exploited in numerous ways and represents a significant vulnerability and attack vector.
Impact
Disabling 'Basic Auth Publishing Credentials' will prevent the following deployment methods from working:
FTP Basic Auth Publishing Credentials:
- FTP
- FTPS
SCM Basic Auth Publishing Credentials:
- Local Git
- GitHub
- Azure Repos
- Bitbucket
- Visual Studio (Version 17.12 and earlier)
If this recommendation cannot be implemented because one of the above listed deployment methods is necessary and cannot be adapted, compensating controls (e.g. using FTPS Only and disabling only "SCM Basic Auth Publishing Credentials") are recommended to reduce potential attack surface.
An Identity Provider that can be used by the App Service deployment slot for authenticating users is required.
Audit Procedure
Using Azure Portal
- Go to
App Services. - Click the name of an app.
- Under
Deployment, clickDeployment slots. - Click the name of a deployment slot.
- Under
Settings, clickConfiguration. - In the
General settingstab, underPlatform settings, ensure thatSCM Basic Auth Publishing CredentialsandFTP Basic Auth Publishing Credentialsare set toOff. - Repeat steps 1-6 for each app and deployment slot.
Using Azure CLI
Run the following command to list apps:
az webapp list
For each app, run the following command to list deployment slots:
az webapp deployment slot list --resource-group <resource-group-name> --name <app-name>
For each deployment slot, run the following command to get the basic authentication for FTP setting:
az resource show --resource-group <resource-group-name> --name ftp --namespace Microsoft.Web --resource-type basicPublishingCredentialsPolicies --parent sites/<app-name>/slots/<deployment-slot-name> --query properties.allow
Ensure that false is returned.
For each deployment slot, run the following command to get the basic authentication for SCM setting:
az resource show --resource-group <resource-group-name> --name scm --namespace Microsoft.Web --resource-type basicPublishingCredentialsPolicies --parent sites/<app-name>/slots/<deployment-slot-name> --query properties.allow
Ensure that false is returned.
Expected Result
Both SCM Basic Auth Publishing Credentials and FTP Basic Auth Publishing Credentials should return false, indicating they are disabled.
Remediation
CAUTION: Applying changes may cause your App Service resource to restart.
Using Azure Portal
- Go to
App Services. - Click the name of an app.
- Under
Deployment, clickDeployment slots. - Click the name of a deployment slot.
- Under
Settings, clickConfiguration. - In the
General settingstab, underPlatform settings, setSCM Basic Auth Publishing CredentialsandFTP Basic Auth Publishing CredentialstoOff. - Click
Save. - Click
Continue. - Repeat steps 1-8 for each app and deployment slot requiring remediation.
Using Azure CLI
For each deployment slot requiring remediation, run the following command to disable basic authentication for FTP:
az resource update --resource-group <resource-group-name> --name ftp --namespace Microsoft.Web --resource-type basicPublishingCredentialsPolicies --parent sites/<app-name>/slots/<deployment-slot-name> --set properties.allow=false
For each deployment slot requiring remediation, run the following command to disable basic authentication for SCM:
az resource update --resource-group <resource-group-name> --name scm --namespace Microsoft.Web --resource-type basicPublishingCredentialsPolicies --parent sites/<app-name>/slots/<deployment-slot-name> --set properties.allow=false
Default Value
Basic authentication is enabled by default.
References
- https://learn.microsoft.com/en-us/azure/app-service/configure-basic-auth-disable
- https://learn.microsoft.com/en-us/cli/azure/webapp
- https://learn.microsoft.com/en-us/cli/azure/resource
Profile
Level 1 | Automated