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