turbot/terraform_azure_compliance

Query: network_watcher_flow_log_retention_period_90_days

Usage

powerpipe query terraform_azure_compliance.query.network_watcher_flow_log_retention_period_90_days

Steampipe Tables

SQL

select
address as resource,
case
when (attributes_std -> 'retention_policy' ->> 'enabled') = 'false' then 'alarm'
when (attributes_std -> 'retention_policy' ->> 'enabled') = 'true' and (attributes_std -> 'retention_policy' ->> 'days')::int >= 90 then 'ok'
else 'alarm'
end as status,
split_part(address, '.', 2) || case
when (attributes_std -> 'retention_policy' ->> 'enabled') = 'false' then ' retention policy disabled'
else ' retention set to ' || (attributes_std -> 'retention_policy' ->> 'days') || ' day(s)'
end || '.' reason
, path || ':' || start_line
from
terraform_resource
where
type = 'azurerm_network_watcher_flow_log';

Controls

The query is being used by the following controls: