Description
Ensure that the AWS account's IAM password policy enables password expiration and sets the password expiration period to 90 days or less. The password policy applies to all IAM users who sign in to the AWS Management Console with a password.
Rationale
Passwords that never expire can stay valid for years, so a leaked, reused or guessed password remains useful to an attacker indefinitely. A compromised IAM user password gives console access to the account, allowing data exfiltration, privilege escalation and unauthorized changes. Rotating passwords at least every 90 days, together with password reuse prevention, MFA and strong length and complexity rules, limits how long a compromised password can be used.
Impact
Limits how long a compromised password can be used
Users must set a new password when their current password reaches the expiration period, which may require communicating the change in advance
Passwords older than the new expiration period expire immediately, and those users must change their password at their next sign-in
If Require administrator reset (hard expiry) is enabled, users with expired passwords cannot sign in until an administrator resets their password
Default Value
No custom password policy is set by default. Without a custom policy, passwords do not expire.
Pre-Requisites
IAM permissions: iam:GetAccountPasswordPolicy and iam:UpdateAccountPasswordPolicy
Agreement on the other password policy settings to keep (for example, minimum length, character types and password reuse), because updating the policy replaces all of its settings
Remediation
Test Plan
Console:
Sign in to the AWS Management Console at https://console.aws.amazon.com.
Open the IAM console and select Account settings in the left menu.
In the Password policy section, check whether password expiration is enabled and the expiration period in days.
If no custom password policy is set, password expiration is not enabled, or the expiration period is more than 90 days, follow the implementation steps.
CLI:
Show the current password policy:
aws iam get-account-password-policy
The account fails if MaxPasswordAge is missing or greater than 90, or if the command returns a NoSuchEntity error (no custom policy is set, so passwords do not expire).
Implementation Steps
Console:
Sign in to the AWS Management Console at https://console.aws.amazon.com.
Open the IAM console and select Account settings in the left menu.
In the Password policy section, choose Edit.
Select Custom (if the default policy is in use).
Select Enable password expiration and set Expiration period (in days) to 90 or less.
Leave the other password settings as they are, unless they also need to be changed.
Choose Save changes.
CLI:
Set passwords to expire after 90 days:
aws iam update-account-password-policy --max-password-age 90
This command replaces the whole password policy, and any setting not included reverts to its default. To keep the existing settings, add the matching options from the Test Plan output, for example:
aws iam update-account-password-policy --max-password-age 90 --minimum-password-length 14 --require-uppercase-characters --require-lowercase-characters --require-numbers --require-symbols --allow-users-to-change-password --password-reuse-prevention 24
Backout Plan
Before making changes, save the current password policy:
aws iam get-account-password-policy > password-policy-backup.json
To roll back:
Sign in to the AWS Management Console at https://console.aws.amazon.com.
Open the IAM console and select Account settings in the left menu.
In the Password policy section, choose Edit.
Set the password expiration and the other settings back to the values in the saved backup. If no custom policy existed before, select IAM default instead.
Choose Save changes.
Note: rolling back allows passwords to remain valid for longer, or indefinitely. Use it only as a temporary measure.
Reference