Review IAM users’ password-change permissions

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

Description

allow_users_to_change_password grants every IAM user permission to change their own console password. With false, individual IAM policies can still grant this access.

Potential impact

Users without permission must ask an administrator to replace an initial or exposed password.

Remediation

Set allow_users_to_change_password = true for account-wide access. For selected users, grant iam:ChangePassword on their own IAM user and iam:GetAccountPasswordPolicy to read the policy. Check effective permission limits, MFA and password-strength requirements.

Examples

Before

hcl
resource "aws_iam_account_password_policy" "example" {
  minimum_password_length        = 8
  require_lowercase_characters   = true
  require_numbers                = true
  require_uppercase_characters   = true
  require_symbols                = true
  allow_users_to_change_password = false
}

After

hcl
resource "aws_iam_account_password_policy" "example" {
  minimum_password_length        = 10
  require_lowercase_characters   = true
  require_numbers                = true
  require_uppercase_characters   = true
  require_symbols                = true
  allow_users_to_change_password = true
}

The second configuration grants self-service and also increases the minimum length from 8 to 10. Choose a length that meets your requirements.

References