turbot/steampipe-mod-azure-compliance

Query: appservice_web_app_diagnostic_log_category_http_log_enabled

Usage

powerpipe query azure_compliance.query.appservice_web_app_diagnostic_log_category_http_log_enabled

SQL

with diagnostic_settings_http_logs as (
select
distinct id
from
azure_app_service_web_app,
jsonb_array_elements(diagnostic_settings) as ds,
jsonb_array_elements(ds -> 'properties' -> 'logs') as log
where
log ->> 'category' = 'AppServiceHTTPLogs'
and (log -> 'enabled')::bool
)
select
a.id as resource,
case
when ds.id is not null then 'ok'
else 'alarm'
end as status,
case
when ds.id is not null then a.name || ' HTTP logs for diagnostic log category enabled.'
else a.name || ' HTTP logs for diagnostic log category disabled.'
end as reason
, a.resource_group as resource_group
, sub.display_name as subscription
from
azure_app_service_web_app as a
left join diagnostic_settings_http_logs as ds on ds.id = a.id
left join azure_subscription as sub on sub.subscription_id = a.subscription_id;

Controls

The query is being used by the following controls: