Control: Storage buckets self logging should be disabled
Description
It is recommended that self logging should be disabled for storage buckets.
Usage
Run the control in your terminal:
powerpipe control run terraform_gcp_compliance.control.storage_bucket_self_logging_disabled
Snapshot and share results via Turbot Pipes:
powerpipe loginpowerpipe control run terraform_gcp_compliance.control.storage_bucket_self_logging_disabled --share
SQL
This control uses a named query:
select address as resource, case when (attributes_std -> 'logging') is null then 'skip' when (attributes_std -> 'logging' ->> 'log_bucket') = (attributes_std ->> 'name') then 'alarm' else 'ok' end as status, split_part(address, '.', 2) || case when (attributes_std -> 'logging') is null then ' logging is undefined' when (attributes_std -> 'logging' ->> 'log_bucket') = (attributes_std ->> 'name') then ' self logging enabled' else ' self logging disabled' end || '.' reason , path || ':' || start_linefrom terraform_resourcewhere type = 'google_storage_bucket';