turbot/steampipe-mod-terraform-aws-compliance

Control: Ensure IAM password policy requires minimum length of 14 or greate

Description

Password policies are, in part, used to enforce password complexity requirements. IAM password policies can be used to ensure password are at least a given length. It is recommended that the password policy require a minimum password length 14.

Usage

Run the control in your terminal:

powerpipe control run terraform_aws_compliance.control.iam_account_password_policy_min_length_14

Snapshot and share results via Turbot Pipes:

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

SQL

This control uses a named query:

select
address as resource,
case
when (attributes_std -> 'minimum_password_length') is null then 'alarm'
when (attributes_std -> 'minimum_password_length')::integer >= 14 then 'ok'
else 'alarm'
end as status,
split_part(address, '.', 2) || case
when (attributes_std -> 'minimum_password_length') is null then ' ''minimum_password_length'' is not defined'
when (attributes_std -> 'minimum_password_length')::integer >= 14 then ' ''minimum_password_length'' is set and greater than 14'
else ' ''minimum_password_length'' is set and less than 14'
end || '.' as reason
, path || ':' || start_line
from
terraform_resource
where
type = 'aws_iam_account_password_policy';

Tags