Review IAM password expiration policy

Choose password expiration according to the organization’s authentication and recovery policy.

Description

max_password_age sets how long an IAM user’s console password remains valid. You can omit it when regular expiration is unnecessary. Access keys are unaffected.

Potential impact

A new or shorter limit immediately expires passwords already older than that limit. Users may lose console access until they change or reset them.

Remediation

If expiration is required, choose 1–1,095 days according to policy. Verify users can change or recover their passwords, retain MFA and replace an exposed password immediately.

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 = true
}

After

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 = true
  max_password_age               = 10
}

The first configuration has no automatic expiration. The second uses max_password_age = 10 to illustrate a ten-day limit.

References