turbot/steampipe-mod-terraform-azure-compliance

Control: Ensure Storage logging is enabled for Queue service for read, write, and delete requests

Description

The Storage Queue service stores messages that may be read by any client who has access to the storage account. A queue can contain an unlimited number of messages, each of which can be up to 64KB in size using version 2011-08-18 or newer. Storage Logging happens server-side and allows details for both successful and failed requests to be recorded in the storage account. These logs allow users to see the details of read, write, and delete operations against the queues. Storage Logging log entries contain the following information about individual requests: Timing information such as start time, end-to-end latency, and server latency, authentication details , concurrency information and the sizes of the request and response messages.

Usage

Run the control in your terminal:

powerpipe control run terraform_azure_compliance.control.storage_account_queue_services_logging_enabled

Snapshot and share results via Turbot Pipes:

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

SQL

This control uses a named query:

select
address as resource,
case
when (attributes_std -> 'queue_properties') is null or (attributes_std -> 'queue_properties' -> 'logging') is null then 'alarm'
when not (attributes_std -> 'queue_properties' -> 'logging' ->> 'Read')::boolean or not (attributes_std -> 'queue_properties' -> 'logging' ->> 'Write')::boolean or not (attributes_std -> 'queue_properties' -> 'logging' ->> 'Delete')::boolean then 'alarm'
else 'ok'
end status,
split_part(address, '.', 2) || case
when (attributes_std -> 'queue_properties') is null or (attributes_std -> 'queue_properties' -> 'logging') is null then ' blob service logging not enabled'
when not (attributes_std -> 'queue_properties' -> 'logging' ->> 'Read')::boolean or not (attributes_std -> 'queue_properties' -> 'logging' ->> 'Write')::boolean or not (attributes_std -> 'queue_properties' -> 'logging' ->> 'Delete')::boolean then ' blob service logging not enabled'
else ' blob service logging enabled'
end || '.' reason
, path || ':' || start_line
from
terraform_resource
where
type = 'azurerm_storage_account';

Tags