Control: Ensure Storage logging is enabled for Blob service for read, write, and delete requests
Description
The Storage Blob service provides scalable, cost-efficient objective storage in the cloud. 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 blobs. 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_blob_service_logging_enabledSnapshot and share results via Turbot Pipes:
powerpipe loginpowerpipe control run terraform_azure_compliance.control.storage_account_blob_service_logging_enabled --shareSQL
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_linefrom  terraform_resourcewhere  type = 'azurerm_storage_account';