turbot/steampipe-mod-aws-compliance

Control: IAM user should not have any inline or attached policies

Description

This rule ensures AWS Identity and Access Management (IAM) policies are attached only to groups or roles to control access to systems and assets.

Usage

Run the control in your terminal:

powerpipe control run aws_compliance.control.iam_user_no_inline_attached_policies

Snapshot and share results via Turbot Pipes:

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

SQL

This control uses a named query:

select
arn as resource,
case
when inline_policies is null and attached_policy_arns is null then 'ok'
else 'alarm'
end status,
name || ' has ' || coalesce(jsonb_array_length(inline_policies),0) || ' inline and ' ||
coalesce(jsonb_array_length(attached_policy_arns),0) || ' directly attached policies.' as reason
, account_id
from
aws_iam_user;

Tags