For AI agents: A markdown version of this page is available at https://docs.datadoghq.com/security/code_security/iac_security/iac_rules/ansible-aws-iam-password-without-minimum-length.md.
A documentation index is available at /llms.txt.
IAM password policies must enforce a minimum length to reduce the risk of credential brute-force and credential-stuffing attacks and limit the effectiveness of weak passwords.
This rule checks Ansible tasks using amazon.aws.iam_password_policy or iam_password_policy and requires min_pw_length or minimum_password_length to be set to a numeric value of at least 8. Tasks missing both properties are flagged as MissingAttribute. Tasks where the configured value is less than 8 are flagged as IncorrectValue. Configure the property to 8 or higher.
Secure example:
- name:Enforce IAM password policyamazon.aws.iam_password_policy:min_pw_length:12
Compliant Code Examples
- name:Password policy for AWS accountamazon.aws.iam_password_policy:state:presentmin_pw_length:8require_symbols:falserequire_numbers:truerequire_uppercase:truerequire_lowercase:trueallow_pw_change:truepw_max_age:60pw_reuse_prevent:5pw_expire:false- name:aws_iam_account_password_policyamazon.aws.iam_password_policy:state:presentminimum_password_length:8require_symbols:falserequire_numbers:truerequire_uppercase:truerequire_lowercase:trueallow_pw_change:truepw_max_age:60pw_reuse_prevent:5pw_expire:false
Non-Compliant Code Examples
- name:Password policy for AWS accountamazon.aws.iam_password_policy:state:presentrequire_symbols:falserequire_numbers:truerequire_uppercase:truerequire_lowercase:trueallow_pw_change:truepw_max_age:60pw_reuse_prevent:5pw_expire:false- name:aws_iam_account_password_policyamazon.aws.iam_password_policy:state:presentmin_pw_length:3require_symbols:falserequire_numbers:truerequire_uppercase:truerequire_lowercase:trueallow_pw_change:truepw_max_age:60pw_reuse_prevent:5pw_expire:false- name:aws_iam_account_password_policy_2amazon.aws.iam_password_policy:state:presentminimum_password_length:3require_symbols:falserequire_numbers:truerequire_uppercase:truerequire_lowercase:trueallow_pw_change:truepw_max_age:60pw_reuse_prevent:5pw_expire:false
1
2
rulesets:- Ansible / AWS # Rules to enforce / AWS.
Request a personalized demo
Get Started with Datadog
Ask AI
AI-generated responses may be inaccurate. Verify important info.