turbot/steampipe-mod-aws-compliance

Control: SSM documents should not be public

Description

This control checks whether AWS Systems Manager documents that are owned by the account are public. This control fails if SSM documents with the owner Self are public.

Usage

Run the control in your terminal:

powerpipe control run aws_compliance.control.ssm_document_prohibit_public_access

Snapshot and share results via Turbot Pipes:

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

SQL

This control uses a named query:

select
d.arn as resource,
case
when p.account_ids :: jsonb ? 'all' then 'alarm'
else 'ok'
end as status,
case
when p.account_ids :: jsonb ? 'all' then d.title || ' publicly accessible.'
else d.title || ' not publicly accessible.'
end as reason
, d.region, d.account_id
from
aws_ssm_document as d
left join aws_ssm_document_permission as p on p.document_name = d.name and p.region = d.region and p.account_id = d.account_id
where
d.owner_type = 'Self';

Tags