Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: mfa resource name should be * as this is not set to username if … #118

Merged
merged 2 commits into from
Jan 11, 2024

Conversation

sheenamt
Copy link
Contributor

Users could not create their own virtual MFA devices in the console due to hard coding the MFA permissions to a specific MFA key name. This fixes that issue.

@sheenamt sheenamt requested a review from chtakahashi January 11, 2024 19:55
main.tf Outdated
@@ -104,7 +104,7 @@ data "aws_iam_policy_document" "main" {
]

resources = [
"arn:${data.aws_partition.current.partition}:iam::*:mfa/&{aws:username}",
"arn:${data.aws_partition.current.partition}:iam::*:mfa/*",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can entirely remove the mfa/* line in here. the iam:DeactivateMFADevice permission is based on user:
check the DeactivateMFADevice row in here: (https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsidentityandaccessmanagementiam.html)

@chtakahashi chtakahashi merged commit 1ff82fe into main Jan 11, 2024
1 check passed
@chtakahashi chtakahashi deleted the update-mfa-creation branch January 11, 2024 20:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants