turbot/aws_insights

Query: iam_access_key_age_table

Usage

powerpipe query aws_insights.query.iam_access_key_age_table

SQL

with access_key as (
select
k.user_name as user,
u.arn as user_arn,
k.access_key_id as access_key_id,
k.status as status,
now()::date - k.create_date::date as age_in_days,
k.create_date as create_date,
k.account_id as account_id
from
aws_iam_access_key as k,
aws_iam_user as u
where
u.name = k.user_name
)
select
ak.user as "User",
ak.access_key_id as "Access Key ID",
ak.age_in_days as "Age in Days",
ak.create_date as "Create Date",
ak.status as "Status",
ak.user_arn as "User ARN",
a.title as "Account",
ak.account_id as "Account ID"
from
access_key as ak,
aws_account as a
where
a.account_id = ak.account_id
order by
ak.create_date,
ak.user;

Dashboards

The query is used in the dashboards: