LOW
Source
Trivy/CSPM
CSPM ID
identity-enabled
ID
AVD-AZU-0002

Web App has registration with AD enabled

Registering the identity used by an App with AD allows it to interact with other services without using username and password

Impact

Interaction between services can’t easily be achieved without username/password

Follow the appropriate remediation steps below to resolve the issue.

  1. Log into the Microsoft Azure Management Console.

  2. Find the search bar at the top and search for App Services. Step

  3. Select the “App Service” by clicking on “Name” to go to its configuration.Step

  4. Scroll down the selected “App Services” navigation panel and in “Settings” click on the “Identity” option.</br

  5. On the “Identity” page verify the “Status” option under “System assigned” tab. If the “Status” is set to “Off” then the “Identity” is not enabled to authenticate to App Service without storing credentials in the code. It is recommended to use Identity management to store credentials for other services such as Storage, SQL etc.Step

  6. If the “Status” is set to “Off” then select the “On” option next to “Status” to turn on Identity management. Step

  7. Click on the “Save” button at the top to ensure identity is authenticated to all services that supports Azure AD authentication, without having to include any credentials in code. Step

  8. Click “Yes” in the confirmation popup to complete the change.Step

  9. Repeat steps 3 - 8 to ensure a system or user assigned managed identity is enabled for all “App services” in the account.

Register the app identity with AD

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
 resource "azurerm_app_service" "good_example" {
   name                = "example-app-service"
   location            = azurerm_resource_group.example.location
   resource_group_name = azurerm_resource_group.example.name
   app_service_plan_id = azurerm_app_service_plan.example.id
 
   identity {
     type = "UserAssigned"
     identity_ids = "webapp1"
   }
 }