rules/findings/azure/appservices/azure-app-service-basic-publishing-credentials-enabled.json

{
  "provider": "Azure",
  "serviceType": "_ARG_0_",
  "serviceName": "Hosted Services",
  "displayName": "Ensure \u0027Basic Authentication Publishing Credentials\u0027 are \u0027Disabled\u0027",
  "description": "Basic Authentication Publishing Credentials provides the ability to publish\u2014 or deploy to\u2014an App Service app 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 \u0027Basic Auth Publishing Credentials\u0027 will prevent the following deployment methods from working:\nFTP Basic Auth Publishing Credentials:\n\u2022 FTP\n\u2022 FTPS SCM Basic Auth Publishing Credentials:\n\u2022 Local Git\n\u2022 GitHub\n\u2022 Azure Repos\n\u2022 Bitbucket\n\u2022 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 \u0022SCM Basic Auth Publishing Credentials\u0022) are recommended to reduce potential attack surface.\u003Cbr/\u003E\u003Cbr/\u003EAn Identity Provider that can be used by the App Service app for authenticating users is required.",
  "remediation": {
    "text": "\n\t\t\t#### Remediate from Azure Portal\n\t\t\t1. Search for, and open App Services from the search bar.\n\t\t\t2. For each App Service listed: \n\t\t\t3. Click on the App Service name. \n\t\t\t4. Under the Settings menu item, click on Configuration \n\t\t\t5. Under the General settings tab, scroll down to locate the two Basic Auth settings: \n\t\t\t\t* Set the SCM Basic Auth Publishing Credentials radio button to Off \n\t\t\t\t* Set the FTP Basic Auth Publishing Credentials radio button to Off\n\t\t\t\n\t\t\t*CAUTION*: The new settings are not yet applied. Applying them may cause your App Service resource to restart - proceed with caution. Click the Save button, then click Continue to apply the updated configuration.\n\t\t\tRepeat this procedure for each App Service.\n\t\t",
    "code": {
      "powerShell": null,
      "iac": null,
      "terraform": null,
      "other": null
    }
  },
  "recommendation": null,
  "references": [
    "https://learn.microsoft.com/en-us/azure/app-service/configure-basic-auth-disable?tabs=portal",
    "https://learn.microsoft.com/en-us/cli/azure/webapp",
    "https://learn.microsoft.com/en-us/cli/azure/resource?view=azure-cli-latest"
  ],
  "compliance": [
    {
      "name": "_ARG_1_",
      "version": "_ARG_2_",
      "reference": "_ARG_3_",
      "profile": [
        "Level 1"
      ]
    }
  ],
  "level": "medium",
  "tags": [],
  "rule": {
    "path": "az_app_services",
    "subPath": null,
    "selectCondition": {},
    "query": [
      {
        "filter": [
          {
            "conditions": [
              [
                "basicPublishingCredentialsPolicies.properties.allow",
                "ne",
                "false"
              ]
            ]
          }
        ]
      },
      {
        "connectOperator": "and",
        "filter": [
          {
            "include": "_ARG_4_"
          }
        ]
      }
    ],
    "shouldExist": null,
    "returnObject": null,
    "removeIfNotExists": null
  },
  "output": {
    "html": {
      "data": {
        "properties": {
          "name": "Name",
          "location": "location",
          "resourceGroupName": "Resource Group Name",
          "basicPublishingCredentialsPolicies.properties.allow": "Basic Authentication Publishing Credentials"
        },
        "expandObject": null
      },
      "table": "default",
      "decorate": [],
      "emphasis": [],
      "actions": {
        "objectData": {
          "properties": [
            "name",
            "location",
            "resourceGroupName",
            "basicPublishingCredentialsPolicies"
          ],
          "expandObject": null,
          "limit": null
        },
        "showGoToButton": "True",
        "showModalButton": "True",
        "directLink": null
      }
    },
    "text": {
      "data": {
        "properties": {
          "name": "Name",
          "location": "location",
          "resourceGroupName": "Resource Group Name",
          "basicPublishingCredentialsPolicies.properties.allow": "Basic Authentication Publishing Credentials"
        },
        "expandObject": null
      },
      "status": {
        "keyName": [
          "name"
        ],
        "message": "Ensure \u0027Basic Authentication Publishing Credentials\u0027 are \u0027Disabled\u0027 for {name}",
        "defaultMessage": null
      },
      "properties": {
        "resourceName": "name",
        "resourceId": "id",
        "resourceType": "type"
      },
      "onlyStatus": false
    }
  },
  "idSuffix": "azure__ARG_0__basic_publishing_credentials_enabled",
  "notes": [],
  "categories": [],
  "immutableProperties": [
    "name",
    "id"
  ],
  "id": "azure_app_service__ARG_5_"
}