Skip to content

User(s) can't change their passwords - can't find any deny's

0

So I am trying to allow all users to change passwords. I have my test account with a basic user group and really no other permissions. When that user tries to change via console, the message is;

You don't have permission to iam:ChangePassword. To request access, copy the following text and send it to your AWS administrator.

AmazonQ says to look for an explicit deny but there is none anywhere. The security console had a lot of not allowed, I want them to be able to create their own keys, and as I built this policy those errors are gone and just trying to see how I can diagnose more. The policy I have for that is;

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "AllowViewAccountInfo",
            "Effect": "Allow",
            "Action": [
                "iam:GetAccountPasswordPolicy",
                "iam:GetAccountSummary"
            ],
            "Resource": "*"
        },
        {
            "Sid": "AllowManageOwnPasswords",
            "Effect": "Allow",
            "Action": [
                "iam:ChangePassword",
                "iam:GetUser",
                "iam:UpdateLoginProfile",
                "iam:GetLoginProfile"
            ],
            "Resource": "arn:aws:iam::*:user/${aws:username}"
        },
        {
            "Sid": "AllowManageOwnAccessKeys",
            "Effect": "Allow",
            "Action": [
                "iam:DeleteAccessKey",
                "iam:ListAccessKeys",
                "iam:GetAccessKeyLastUsed"
            ],
            "Resource": "arn:aws:iam::*:user/${aws:username}"
        },
        {
            "Sid": "AllowManageOwnSigningCertificates",
            "Effect": "Allow",
            "Action": [
                "iam:DeleteSigningCertificate",
                "iam:ListSigningCertificates",
                "iam:UpdateSigningCertificate",
                "iam:UploadSigningCertificate"
            ],
            "Resource": "arn:aws:iam::*:user/${aws:username}"
        },
        {
            "Sid": "AllowManageOwnSSHPublicKeys",
            "Effect": "Allow",
            "Action": [
                "iam:GetSSHPublicKey",
                "iam:ListSSHPublicKeys"
            ],
            "Resource": "arn:aws:iam::*:user/${aws:username}"
        },
        {
            "Sid": "AllowManageOwnGitCredentials",
            "Effect": "Allow",
            "Action": [
                "iam:CreateServiceSpecificCredential",
                "iam:DeleteServiceSpecificCredential",
                "iam:ListServiceSpecificCredentials",
                "iam:ResetServiceSpecificCredential",
                "iam:UpdateServiceSpecificCredential"
            ],
            "Resource": "arn:aws:iam::*:user/${aws:username}"
        }
    ]
}

Any help on this is appreciated.

5 Answers
0

The issue you're experiencing is likely related to permissions, but not necessarily due to an explicit deny. For IAM users to change their own passwords, they need specific permissions, and there might be a few things to check:

  1. First, ensure that the policy you've created is actually attached to the user or group in question. Even with a well-crafted policy, if it's not attached to the user or their group, they won't have the necessary permissions.

  2. Your policy looks mostly correct for allowing users to change their passwords. The "AllowManageOwnPasswords" section includes the necessary iam:ChangePassword permission.

  3. You might also need to enable the account password policy to allow users to change their own passwords. This is a separate setting at the account level. You can update this using the AWS Management Console or by running the AWS CLI command:

aws iam update-account-password-policy
  1. If you're using the AWS CLI to change passwords, especially with special characters, make sure you're using the change-password command correctly.

  2. Check if there are any other policies attached to the user or their groups that might be conflicting with your permissions policy.

  3. For users to change their passwords through the console, they may also need the iam:ListUsers permission to access their own user page. Consider adding this permission to your "AllowViewAccountInfo" statement.

  4. If you want users to be able to change their password from their own user page (rather than just the Security Credentials page), ensure they have both iam:GetLoginProfile and iam:UpdateLoginProfile permissions, which you've already included.

If you've verified all these points and users still can't change their passwords, you might want to check if there are any Service Control Policies (SCPs) in AWS Organizations that could be restricting these actions.
Sources
Permit IAM users to change their own passwords - AWS Identity and Access Management
How do I change my password on the AWS Management Console | AWS re:Post
Resolve the IAM user password error "user is not authorized or password does not comply" | AWS re:Post
IAM: Allows IAM users to update their own credentials programmatically and in the console - AWS Identity and Access Management

answered a year ago

EXPERT

reviewed a year ago

0

Hello.

To change the password of an IAM user, use the ChangePassword API.
Therefore, at a minimum, your IAM policy must allow "iam:ChangePassword".
As described in the following document, to allow IAM users to change only their own passwords, you can set the following IAM policy to allow them to change their passwords.
https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_passwords_enable-user-change.html#proc_letselectuserschangepassword

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": "iam:GetAccountPasswordPolicy",
      "Resource": "*"
    },
    {
      "Effect": "Allow",
      "Action": "iam:ChangePassword",
      "Resource": "arn:aws:iam::*:user/${aws:username}"
    }
  ]
}
EXPERT

answered a year ago

EXPERT

reviewed a year ago

0

The policy that you have listed should allow users to reset their own passwords, since you already have "iam:GetAccountPasswordPolicy" and "iam:ChangePassword" listed.

Things to check next:

  • Ensure the policy is actually attached to the users!
  • Check CloudTrail logs (https://us-east-1.console.aws.amazon.com/cloudtrailv2/home?region=us-east-1#/events?ReadOnly=false) for ChangePassword events or other similar actions taken by the user. You can view the events to see what was allowed and what was denied, along with any error messages. It may be that some other action is getting denied, or the error message may tell you that there is an explicit deny somewhere. For example: Example event with denial details
  • If all still looks OK, check for explicit denies in the following places:
    • Other policies attached to the user/group
    • Organization SCPs
    • A Permissions Boundary attached to the user

answered a year ago

0

Ok, so there is no Deny's and the only thing I did was run

aws iam update-account-password-policy

After that, the user was able to reset their password. The only question I have is when I visit the password policy page no longer shows what was there (15 characters, the checkbox's are all no longer there) BUT I am able to change!

answered a year ago

0

I have same issue. And I solve it by set correct new password that match all pwd rules. My new password was without any non-alphanumeric character, and I always get error. After adding needed char I change my password successfully

Account password policy

answered 7 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.