turbot/alicloud_compliance

Query: ram_user_unused_90

Usage

steampipe query alicloud_compliance.query.ram_user_unused_90

Plugins & Tables

SQL

select
-- Required Columns
'acs:ram::' || account_id || ':user/' || name as resource,
case
when last_login_date < current_date - interval '90 days' or last_login_date is null then 'alarm'
else 'ok'
end as status,
case
when last_login_date is null then name || ' never logged in.'
else name || ' logged in '|| extract(day from current_date - last_login_date) || ' days ago.'
end as reason,
-- Additional Dimensions
account_id
from
alicloud_ram_user;

Controls

The query is being used by the following controls: