turbot/steampipe-mod-terraform-azure-compliance

Control: Ensure App Service Authentication is set on Azure App Service

Description

Azure App Service Authentication is a feature that can prevent anonymous HTTP requests from reaching the API app, or authenticate those that have tokens before they reach the API app. If an anonymous request is received from a browser, App Service will redirect to a logon page. To handle the logon process, a choice from a set of identity providers can be made, or a custom authentication mechanism can be implemented.

Usage

Run the control in your terminal:

powerpipe control run terraform_azure_compliance.control.appservice_authentication_enabled

Snapshot and share results via Turbot Pipes:

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

SQL

This control uses a named query:

select
address as resource,
case
when (attributes_std -> 'auth_settings') is null then 'alarm'
when (attributes_std -> 'auth_settings' ->> 'enabled')::boolean then 'ok'
else 'alarm'
end status,
split_part(address, '.', 2) || case
when (attributes_std -> 'auth_settings') is null then ' ''auth_settings'' not defined'
when (attributes_std -> 'auth_settings' ->> 'enabled')::boolean then ' authentication set'
else ' authentication not set'
end || '.' reason
, path || ':' || start_line
from
terraform_resource
where
type = 'azurerm_app_service';

Tags