turbot/steampipe-mod-terraform-oci-compliance

Control: Ensure no Object Storage buckets are publicly visible

Description

A bucket is a logical container for storing objects. It is associated with a single compartment that has policies that determine what action a user can perform on a bucket and on all the objects in the bucket. It is recommended that no bucket be publicly accessible.

Usage

Run the control in your terminal:

powerpipe control run terraform_oci_compliance.control.objectstorage_bucket_public_access_blocked

Snapshot and share results via Turbot Pipes:

powerpipe login
powerpipe control run terraform_oci_compliance.control.objectstorage_bucket_public_access_blocked --share

SQL

This control uses a named query:

select
address as resource,
case
when (attributes_std ->> 'access_type') in ('ObjectRead', 'ObjectReadWithoutList')
then 'alarm'
else 'ok'
end as status,
split_part(address, '.', 2) || case
when (attributes_std ->> 'access_type') in ('ObjectRead', 'ObjectReadWithoutList')
then ' is publicly accessible'
else ' is not publicly accessible'
end || '.' reason
, path || ':' || start_line
from
terraform_resource
where
type = 'oci_objectstorage_bucket';

Tags