turbot/steampipe-mod-aws-compliance

Control: Secrets Manager secrets should be rotated within a specified number of days

Description

This control checks whether your secrets have been rotated at least once within 90 days. Rotating secrets can help you to reduce the risk of an unauthorized use of your secrets in your AWS account. Examples include database credentials, passwords, third-party API keys, and even arbitrary text. If you do not change your secrets for a long period of time, the secrets are more likely to be compromised.

Usage

Run the control in your terminal:

powerpipe control run aws_compliance.control.secretsmanager_secret_automatic_rotation_lambda_enabled

Snapshot and share results via Turbot Pipes:

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

SQL

This control uses a named query:

select
arn as resource,
case
when rotation_rules is not null and rotation_lambda_arn is not null then 'ok'
else 'alarm'
end as status,
case
when rotation_rules is not null and rotation_lambda_arn is not null then title || ' scheduled for rotation using Lambda function.'
else title || ' automatic rotation using Lambda function disabled.'
end as reason
, region, account_id
from
aws_secretsmanager_secret;

Tags