turbot/steampipe-mod-aws-compliance

Control: RDS snapshots should prohibit public access

Description

Manage access to resources in the AWS Cloud by ensuring that AWS Relational Database Service (AWS RDS) instances are not public.

Usage

Run the control in your terminal:

powerpipe control run aws_compliance.control.rds_db_snapshot_prohibit_public_access

Snapshot and share results via Turbot Pipes:

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

SQL

This control uses a named query:

(
select
arn as resource,
case
when cluster_snapshot -> 'AttributeValues' = '["all"]' then 'alarm'
else 'ok'
end status,
case
when cluster_snapshot -> 'AttributeValues' = '["all"]' then title || ' publicly restorable.'
else title || ' not publicly restorable.'
end reason
, region, account_id
from
aws_rds_db_cluster_snapshot,
jsonb_array_elements(db_cluster_snapshot_attributes) as cluster_snapshot
)
union
(
select
arn as resource,
case
when database_snapshot -> 'AttributeValues' = '["all"]' then 'alarm'
else 'ok'
end status,
case
when database_snapshot -> 'AttributeValues' = '["all"]' then title || ' publicly restorable.'
else title || ' not publicly restorable.'
end reason
, region, account_id
from
aws_rds_db_snapshot,
jsonb_array_elements(db_snapshot_attributes) as database_snapshot
);

Tags