turbot/steampipe-mod-aws-insights

Dashboard: AWS IAM Role Dashboard

This dashboard answers the following questions:

  • How many roles are in each account?
  • How many roles are with inline policies?
  • How many roles are without any attached and boundary policies?
  • How many roles allow all actions (action = '*')?
This dashboard contains 6 cards.

Usage

Install the mod:

mkdir dashboards
cd dashboards
powerpipe mod init
powerpipe mod install github.com/turbot/steampipe-mod-aws-insights

Start the Powerpipe server:

steampipe service start
powerpipe server

Open http://localhost:9033 in your browser and select AWS IAM Role Dashboard dashboard.

You could also snapshot and share results via Turbot Pipes:

powerpipe login
powerpipe dashboard run aws_insights.dashboard.iam_role_dashboard --share

Queries

This dashboard uses the the following queries:
with roles_can_be_assumed_anonymously as (
select
name,
stmt -> 'Principal',
Principal
from
aws_iam_role role,
jsonb_array_elements(role.assume_role_policy_std -> 'Statement') as stmt,
jsonb_array_elements_text(stmt -> 'Principal' -> 'AWS') as principal
where
principal = '*'
and stmt ->> 'Effect' = 'Allow'
)
select
count(distinct name) as value,
'Allows All Principals to Assume Role' as label,
case when count(distinct name) > 0 then 'alert' else 'ok' end as type
from
roles_can_be_assumed_anonymously;

Tags