AWS中的IAM,MFA政策的问题

发布于 2025-02-11 20:00:16 字数 1521 浏览 3 评论 0 原文

来自 n,我为IAM用户实施了IAM策略。但是,将此策略附加到用户之后,他们无法通过AWS控制台访问S3存储桶。

“策略定义,除非用MFA登录用户,否则将拒绝所有操作,除非管理用户的个人IAM帐户和MFA设置。IAM用户没有分配MFA设备。”

地位: “分配的MFA设备=未分配|管理”

示例策略附加

{
            "Sid": "BlockMostAccessUnlessSignedInWithMFA",
            "Effect": "Deny",
            "NotAction": [
                "iam:CreateVirtualMFADevice",
                "iam:EnableMFADevice",
                "iam:ListMFADevices",
                "iam:ListUsers",
                "iam:ListVirtualMFADevices",
                "iam:ResyncMFADevice"
            ],
            "Resource": "*",
            "Condition": {
                "BoolIfExists": {
                    "aws:MultiFactorAuthPresent": "false"
                }
            }

iam用户正面临问题,当他们尝试设置MFA时,这给了他们有关权限的错误。

“实体已经存在该实体已经存在。了解更多 •同一路径和名称的MfadeVice实体已经存在。前 您可以添加新的虚拟MFA设备,请您的管理员删除 现有的设备使用CLI或API。”

“在您或您的AWS之后列出对象的权限不足 管理员已更新您的权限以允许S3:ListBucket 动作,刷新页面。了解有关身份和访问的更多信息 Amazon S3的管理“

我已经尝试了 MFA )设备(控制台), 但无法解决问题。

如果您知道什么,我很乐意让您知道。

谢谢你!

From the AWS documentation, I implement an IAM Policy for MFA authentication for the IAM users. After attaching this policy to the users, though, they are unable to access the s3 buckets through the AWS console.

"Policy defines that, Unless the user is signed into the AWS console with MFA, all actions will be denied, except for managing the user's personal IAM account and MFA settings. IAM users does not have an MFA device assigned."

Status:
"Assigned MFA device = Not assigned | Manage”

example Policy attached

{
            "Sid": "BlockMostAccessUnlessSignedInWithMFA",
            "Effect": "Deny",
            "NotAction": [
                "iam:CreateVirtualMFADevice",
                "iam:EnableMFADevice",
                "iam:ListMFADevices",
                "iam:ListUsers",
                "iam:ListVirtualMFADevices",
                "iam:ResyncMFADevice"
            ],
            "Resource": "*",
            "Condition": {
                "BoolIfExists": {
                    "aws:MultiFactorAuthPresent": "false"
                }
            }

IAM users is facing the issue, when they tried setting up MFA it gave them an error about permissions.

“Entity already exists This entity already exists. Learn more
• MFADevice entity at the same path and name already exists. Before
you can add a new virtual MFA device, ask your administrator to delete
the existing device using the CLI or API.”

and

"Insufficient permissions to list objects After you or your AWS
administrator have updated your permissions to allow the s3:ListBucket
action, refresh the page. Learn more about Identity and access
management in Amazon S3 "

I already tried Enabling a virtual multi-factor authentication (MFA) device (console),
But unable to fix the issue.

If you know anything, I'd be happy to let you know.

Thank you!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

奢欲 2025-02-18 20:00:16

我能够通过此IAM政策实现所需的结果:
IAM策略允许IAM用户自我管理MFA设备。本政策提供了使用AWS控制台或AWS CLI完成此操作所需的权限。

mfaselfmanagedpolicy

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Action": [
                "iam:CreateVirtualMFADevice",
                "iam:EnableMFADevice",
                "iam:ResyncMFADevice",
                "iam:DeleteVirtualMFADevice"
            ],
            "Resource": [
                "arn:aws:iam::*:mfa/${aws:username}",
                "arn:aws:iam::*:user/${aws:username}"
            ],
            "Effect": "Allow"
        },
        {
            "Action": [
                "iam:DeactivateMFADevice"
            ],
            "Resource": [
                "arn:aws:iam::*:mfa/${aws:username}",
                "arn:aws:iam::*:user/${aws:username}"
            ],
            "Effect": "Allow",
            "Condition": {
                "Bool": {
                    "aws:MultiFactorAuthPresent": "true"
                }
            }
        },
        {
            "Action": [
                "iam:ListMFADevices",
                "iam:ListVirtualMFADevices",
                "iam:ListUsers"
            ],
            "Resource": "*",
            "Effect": "Allow"
        }
    ]
}

I am able to achieve the desired result through this IAM Policy :
IAM policy that allows IAM users to self-manage an MFA device. This policy provides the permissions necessary to complete this action using the AWS Console or AWS CLI .

MFASelfManagedPolicy

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Action": [
                "iam:CreateVirtualMFADevice",
                "iam:EnableMFADevice",
                "iam:ResyncMFADevice",
                "iam:DeleteVirtualMFADevice"
            ],
            "Resource": [
                "arn:aws:iam::*:mfa/${aws:username}",
                "arn:aws:iam::*:user/${aws:username}"
            ],
            "Effect": "Allow"
        },
        {
            "Action": [
                "iam:DeactivateMFADevice"
            ],
            "Resource": [
                "arn:aws:iam::*:mfa/${aws:username}",
                "arn:aws:iam::*:user/${aws:username}"
            ],
            "Effect": "Allow",
            "Condition": {
                "Bool": {
                    "aws:MultiFactorAuthPresent": "true"
                }
            }
        },
        {
            "Action": [
                "iam:ListMFADevices",
                "iam:ListVirtualMFADevices",
                "iam:ListUsers"
            ],
            "Resource": "*",
            "Effect": "Allow"
        }
    ]
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文