turbot/steampipe-mod-terraform-azure-compliance

Control: Ensure that Register with Azure Active Directory is enabled on App Service

Description

Managed service identity in App Service makes the app more secure by eliminating secrets from the app, such as credentials in the connection strings. When registering with Azure Active Directory in the app service, the app will connect to other Azure services securely without the need of username and passwords.

Usage

Run the control in your terminal:

powerpipe control run terraform_azure_compliance.control.appservice_web_app_register_with_active_directory_enabled

Snapshot and share results via Turbot Pipes:

powerpipe login
powerpipe control run terraform_azure_compliance.control.appservice_web_app_register_with_active_directory_enabled --share

SQL

This control uses a named query:

select
address as resource,
case
when (attributes_std -> 'identity') is null then 'alarm'
when (attributes_std -> 'identity' ->> 'type')::text = 'SystemAssigned' then 'ok'
else 'ok'
end status,
split_part(address, '.', 2) || case
when (attributes_std -> 'identity') is null then ' ''identity'' not defined'
when (attributes_std -> 'identity' ->> 'type')::text = 'SystemAssigned' then ' register with azure active directory enabled'
else ' register with azure active directory disabled.'
end || '.' reason
, path || ':' || start_line
from
terraform_resource
where
type = 'azurerm_app_service';

Tags