turbot/steampipe-mod-terraform-azure-compliance

Control: Ensure the storage container storing the activity logs is not publicly accessible

Description

The storage account container containing the activity log export should not be publicly accessible.

Usage

Run the control in your terminal:

powerpipe control run terraform_azure_compliance.control.monitor_logs_storage_container_not_public_accessible

Snapshot and share results via Turbot Pipes:

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

SQL

This control uses a named query:

select
address as resource,
case
when (attributes_std -> 'container_access_type') is null then 'ok'
when (attributes_std ->> 'container_access_type') ilike 'Private' then 'ok'
else 'alarm'
end status,
split_part(address, '.', 2) || case
when (attributes_std -> 'container_access_type') is null then ' container insights-operational-logs storing activity logs not publicly accessible'
when (attributes_std ->> 'container_access_type') ilike 'Private' then ' container insights-operational-logs storing activity logs not publicly accessible'
else ' container insights-operational-logs storing activity logs publicly accessible'
end || '.' reason
, path || ':' || start_line
from
terraform_resource
where
type = 'azurerm_storage_container'
and (attributes_std ->> 'name') ilike 'insights-operational-logs';

Tags