Control: Ensure IAM password policy requires a minimum length of 8 or greater
Description
This control checks whether the account password policy for IAM users uses the recommended configurations.
Usage
Run the control in your terminal:
powerpipe control run terraform_aws_compliance.control.iam_account_password_policy_strong_min_length_8
Snapshot and share results via Turbot Pipes:
powerpipe loginpowerpipe control run terraform_aws_compliance.control.iam_account_password_policy_strong_min_length_8 --share
SQL
This control uses a named query:
select address as resource, case when (attributes_std -> 'minimum_password_length')::integer >= 8 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 then 'ok' else 'alarm' end as status, split_part(address, '.', 2) || case when (attributes_std -> 'minimum_password_length')::integer >= 8 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 then ' Strong password policies configured' else ' Strong password policies not configured' end || '.' as reason , path || ':' || start_linefrom terraform_resourcewhere type = 'aws_iam_account_password_policy';