turbot/steampipe-mod-aws-insights

Dashboard: AWS IAM Role Detail

This dashboard answers the following questions for each role:

  • What relationships does the role have with other resources?
  • How is the role configured?
  • What tags are applied?
  • What policies are attached to the role?
  • What inline policies are associated with the role?
  • What boundary policies are set on the role?
This dashboard contains 3 cards, 1 graph, 1 hierarchy, 1 input and 3 tables.

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 Detail dashboard.

You could also snapshot and share results via Turbot Pipes:

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

Queries

This dashboard uses the the following queries:
-- Policies (attached to groups)
select
p.name as "Policy",
policy_arn as "ARN",
'Attached to Role' as "Via"
from
aws_iam_role as r,
jsonb_array_elements_text(r.attached_policy_arns) as policy_arn,
aws_iam_policy as p
where
p.arn = policy_arn
and r.arn = $1
and r.account_id = split_part($1, ':', 5)
-- Inline Policies (defined on role)
union select
i ->> 'PolicyName' as "Policy",
'N/A' as "ARN",
'Inline' as "Via"
from
aws_iam_role as r,
jsonb_array_elements(inline_policies_std) as i
where
arn = $1
and account_id = split_part($1, ':', 5)

Tags