turbot/terraform_azure_compliance

Query: monitor_log_profile_retention_365_days

Usage

powerpipe query terraform_azure_compliance.query.monitor_log_profile_retention_365_days

Steampipe Tables

SQL

select
address as resource,
case
when (attributes_std -> 'retention_policy' ->> 'enabled')::boolean and (attributes_std -> 'retention_policy' ->> 'days')::int < 365 then 'alarm'
when (attributes_std -> 'retention_policy' ->> 'enabled')::boolean and (attributes_std -> 'retention_policy' ->> 'days')::int >= 365 then 'ok'
else 'alarm'
end as status,
case
when (attributes_std -> 'retention_policy' ->> 'enabled')::boolean and (attributes_std -> 'retention_policy' ->> 'days')::int < 365 then ' retention policy enabled but set to ' || (attributes_std -> 'retention_policy' ->> 'days') || ' days'
when (attributes_std -> 'retention_policy' ->> 'enabled')::boolean and (attributes_std -> 'retention_policy' ->> 'days')::int >= 365 then ' retention policy enabled and set to ' || (attributes_std -> 'retention_policy' ->> 'days') || ' days.'
else ' retention policy disabled'
end || '.' reason
, path || ':' || start_line
from
terraform_resource
where
type = 'azurerm_monitor_log_profile';

Controls

The query is being used by the following controls: