turbot/steampipe-mod-terraform-azure-compliance

Control: Web Application Firewall (WAF) should be enabled for Application Gateway

Description

Deploy Azure Web Application Firewall (WAF) in front of public-facing web applications for additional inspection of incoming traffic. Web Application Firewall (WAF) provides centralized protection of your web applications from common exploits and vulnerabilities such as SQL injections, Cross-Site Scripting, local and remote file executions. You can also restrict access to your web applications by countries, IP address ranges, and other http(s) parameters via custom rules.

Usage

Run the control in your terminal:

powerpipe control run terraform_azure_compliance.control.application_gateway_waf_enabled

Snapshot and share results via Turbot Pipes:

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

SQL

This control uses a named query:

select
address as resource,
case
when (attributes_std -> 'waf_configuration') is not null then 'ok'
else 'alarm'
end status,
split_part(address, '.', 2) || case
when (attributes_std -> 'waf_configuration') is not null then ' WAF enabled'
else ' WAF disabled'
end || '.' reason
, path || ':' || start_line
from
terraform_resource
where
type = 'azurerm_application_gateway';

Tags