turbot/aws_compliance

Query: secretsmanager_secret_unused_90_day

Usage

powerpipe query aws_compliance.query.secretsmanager_secret_unused_90_day

SQL

select
arn as resource,
case
when last_accessed_date is null then 'alarm'
when date(current_date) - date(last_accessed_date) <= 90 then 'ok'
else 'alarm'
end as status,
case
when last_accessed_date is null then title || ' never accessed.'
else
title || ' last used ' || extract(day from current_timestamp - last_accessed_date) || ' day(s) ago.'
end as reason
, region, account_id
from
aws_secretsmanager_secret;

Controls

The query is being used by the following controls: