Review IAM user password-change permissions

Provide a way for IAM users to change their own passwords when needed.

Description

allow_pw_change grants all IAM users in the account permission to change their own console password. With false, a separate IAM policy can still grant that permission.

Potential impact

Without that permission, users need an administrator to replace an initial or exposed password.

Remediation

For all users, set allow_pw_change: true. For selected users, grant iam:ChangePassword on their own IAM user and iam:GetAccountPasswordPolicy to read the account policy. Check applicable denies, MFA and password-strength requirements.

Examples

Use a collection that redirects community.aws.iam_password_policy to amazon.aws.iam_password_policy. Set the other policy values to your organization’s requirements.

Before

yaml
- name: Configure the password policy
  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: false
    pw_max_age: 60
    pw_reuse_prevent: 5
    pw_expire: false

- name: Configure the password policy using an alias
  community.aws.iam_password_policy:
    state: present
    min_pw_length: 8
    require_symbols: false
    require_numbers: true
    require_uppercase: true
    require_lowercase: true
    allow_password_change: false
    pw_max_age: 60
    pw_reuse_prevent: 5
    pw_expire: false

After

yaml
- name: Configure the password policy
  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

allow_password_change is an alias for allow_pw_change. Specify one name per task.

References