turbot/steampipe-mod-terraform-aws-compliance

Control: Password policies for IAM users should have strong configurations

Description

This control checks whether the account password policy for IAM users have strong configurations.

Usage

Run the control in your terminal:

powerpipe control run terraform_aws_compliance.control.iam_account_password_policy_strong

Snapshot and share results via Turbot Pipes:

powerpipe login
powerpipe control run terraform_aws_compliance.control.iam_account_password_policy_strong --share

SQL

This control uses a named query:

select
address as resource,
case
when
(attributes_std -> 'minimum_password_length')::integer >= 14
and (attributes_std -> 'require_lowercase_characters')::bool
and (attributes_std -> 'require_uppercase_characters')::bool
and (attributes_std -> 'require_numbers')::bool
and (attributes_std -> 'require_symbols')::bool
and (attributes_std -> 'password_reuse_prevention')::integer >= 24
then 'ok'
else 'alarm'
end as status,
split_part(address, '.', 2) || case
when
(attributes_std -> 'minimum_password_length')::integer >= 14
and (attributes_std -> 'require_lowercase_characters')::bool
and (attributes_std -> 'require_uppercase_characters')::bool
and (attributes_std -> 'require_numbers')::bool
and (attributes_std -> 'require_symbols')::bool
and (attributes_std -> 'password_reuse_prevention')::integer >= 24
then ' Strong password policies configured'
else ' Strong password policies not configured'
end || '.' as reason
, path || ':' || start_line
from
terraform_resource
where
type = 'aws_iam_account_password_policy';

Tags