terraform-aws-modules / terraform-aws-iam

Terraform module to create AWS IAM resources 🇺🇦
https://registry.terraform.io/modules/terraform-aws-modules/iam/aws
Apache License 2.0
787 stars 996 forks source link

feat: Allow users to change own password in iam-group-with-policies module #435

Closed vutny closed 11 months ago

vutny commented 11 months ago

Description

This PR corrects IAM Self-manage policy according to example from AWS: Allows MFA-authenticated IAM users to manage their own credentials on the My security credentials page :

  1. Previously, it did not allow users to change their password on their own user page. To allow this, now the iam:GetLoginProfile and iam:UpdateLoginProfile actions to be added to the AllowManageOwnPasswords statement.
  2. The DenyAllExceptListedIfNoMFA statement has been corrected to include missing iam:GetMFADevice permission for own MFA management.
  3. Also, in the same statement iam:ChangePassword action should not be allowed without MFA authorization if it was enforced. This does not allow a user to create a password at sign-in, the MFA must be created and user must authenticate using it before attempting to change administrator provided password.

Motivation and Context

Stay up to date with AWS recommendations for access policies, grant permissions necessary for IAM user selfie-management via AWS Web Console. Make sure if MFA is enforced, it disallows unauthorized password change for IAM user in case of credentials leak.

Breaking Changes

None.

How Has This Been Tested?

vutny commented 11 months ago

@bryantbiggs , please have a look. Thanks!

antonbabenko commented 11 months ago

This PR is included in version 5.31.0 :tada:

github-actions[bot] commented 10 months ago

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.