IAM Password Without Number

  • Query id: 9cf25d62-0b96-42c8-b66d-998cd6ee5bb8
  • Query name: IAM Password Without Number
  • Platform: Ansible
  • Severity: Medium
  • Category: Best Practices
  • URL: Github

Description

IAM user resource Login Profile Password should have at least one number
Documentation

Code samples

Code samples with security vulnerabilities

Positive test num. 1 - yaml file
---
- name: Password policy for AWS account
  community.aws.iam_password_policy:
    state: present
    min_pw_length: 8
    require_symbols: false
    require_numbers: false
    require_uppercase: true
    require_lowercase: true
    allow_pw_change: true
    pw_max_age: 60
    pw_expire: false
- name: Password policy for AWS account2
  community.aws.iam_password_policy:
    state: present
    min_pw_length: 8
    require_uppercase: true
    require_lowercase: true
    allow_pw_change: true
    pw_max_age: 60
    password_reuse_prevent: 0
    pw_expire: false

Code samples without security vulnerabilities

Negative test num. 1 - yaml file
- name: Ok Password policy for AWS account
  community.aws.iam_password_policy:
    state: present
    min_pw_length: 8
    require_symbols: false
    require_numbers: true
    require_uppercase: true
    require_lowercase: true
    allow_pw_change: true
    pw_max_age: 60
    pw_reuse_prevent: 5
    pw_expire: false