turbot/steampipe-mod-aws-compliance

Control: Ensure that IAM Access analyzer is enabled for all regions

Description

This control checks whether IAM Access analyzer is enabled for all regions. The control fails if IAM Access analyzer is not enabled for all regions.

Usage

Run the control in your terminal:

powerpipe control run aws_compliance.control.iam_access_analyzer_enabled

Snapshot and share results via Turbot Pipes:

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

SQL

This control uses a named query:

select
'arn:' || r.partition || '::' || r.region || ':' || r.account_id as resource,
case
-- Skip any regions that are disabled in the account.
when r.opt_in_status = 'not-opted-in' then 'skip'
when aa.arn is not null then 'ok'
else 'alarm'
end as status,
case
when r.opt_in_status = 'not-opted-in' then r.region || ' region is disabled.'
when aa.arn is not null then aa.name || ' enabled in ' || r.region || '.'
else 'Access Analyzer not enabled in ' || r.region || '.'
end as reason
, r.region, r.account_id
from
aws_region as r
left join aws_accessanalyzer_analyzer as aa on r.account_id = aa.account_id and r.region = aa.region;

Tags