turbot/steampipe-mod-aws-compliance

Control: Amazon DocumentDB cluster snapshots should not be public

Description

This control checks whether Amazon DocumentDB cluster snapshots are public. The control fails if any existing Amazon DocumentDB cluster snapshots are public.

Usage

Run the control in your terminal:

powerpipe control run aws_compliance.control.docdb_cluster_snapshot_restrict_public_access

Snapshot and share results via Turbot Pipes:

powerpipe login
powerpipe control run aws_compliance.control.docdb_cluster_snapshot_restrict_public_access --share

SQL

This control uses a named query:

select
arn as resource,
case
when (cluster_snapshot ->> 'AttributeName' = 'restore') and cluster_snapshot -> 'AttributeValues' = '["all"]' then 'alarm'
else 'ok'
end status,
case
when (cluster_snapshot ->> 'AttributeName' = 'restore') and cluster_snapshot -> 'AttributeValues' = '["all"]' then title || ' does not restrict public access.'
else title || ' restrict public access.'
end reason
, region, account_id
from
aws_docdb_cluster_snapshot,
jsonb_array_elements(db_cluster_snapshot_attributes) as cluster_snapshot;

Tags