Control: Ensure IAM password policy requires minimum length of 14 or greater
Description
Password policies are used to enforce password complexity requirements. IAM password policies can be used to ensure passwords are of at least a certain length and are composed of certain characters. It is recommended the password policy require a minimum password length of 14 characters and contain 1 non-alphabetic character (Number or 'Special Character').
Usage
Run the control in your terminal:
powerpipe control run terraform_oci_compliance.control.identity_authentication_password_policy_strong_min_length_14
Snapshot and share results via Turbot Pipes:
powerpipe loginpowerpipe control run terraform_oci_compliance.control.identity_authentication_password_policy_strong_min_length_14 --share
SQL
This control uses a named query:
select address as resource, case when (attributes_std -> 'password_policy' ->> 'minimum_password_length') is not null and (attributes_std -> 'password_policy' ->> 'minimum_password_length')::integer >= 14 and ((attributes_std -> 'password_policy' ->> 'is_numeric_characters_required')::boolean or (attributes_std -> 'password_policy' ->> 'is_special_characters_required')::boolean) then 'ok' else 'alarm' end as status, split_part(address, '.', 2) || case when (attributes_std -> 'password_policy' ->> 'minimum_password_length') is null then ' No password policy set' when (attributes_std -> 'password_policy' ->> 'minimum_password_length')::integer >= 14 and ((attributes_std -> 'password_policy' ->> 'is_numeric_characters_required')::boolean or (attributes_std -> 'password_policy' ->> 'is_special_characters_required')::boolean) then ' Strong password policies configured' else ' Strong password policies not configured' end || '.' reason , path || ':' || start_linefrom terraform_resourcewhere type = 'oci_identity_authentication_policy';