It is simple not works while working with SCP. Only if you attach it directly to a user, or a userGroup where the user part of this group.
replied 2 years ago
Thank you for your comment. We'll review and update the Knowledge Center article as needed.
G'Day Author,
I have tried that SCP verbatim: no it does not work as is, but finally did, modulo a little adjustment in the SCP.
- Remove "aws:ViaAWSService": "false"
- Add "iam:GetUser",
- Add "iam:GetLoginProfile",
- Use ${aws:username} to prevent inter-staff tinkering
Rationale behind: "aws:ViaAWSService": "false" may prevent you from setting up MFA even though all other conditions are met, because setting up an MFA, at some point through the Wizard, is delegated to an AWS Service.
Tip I advise you to start with a canary release, you may want to add a canary user-specific condition: "Condition": { "StringEquals": { "aws:username": "unit-test-user1" },
Remember your "unit test user 1" will still need an actual policy. You may just add an AWS managed role from the "Job" category.
Find below excerpts from my working version, that did the job: Sorry I can't copy the complete JSON, as there is a length cap here.
{
"Sid": "AllowManageOwnMFADevice",
"Effect": "Allow",
"Action": [
"iam:CreateVirtualMFADevice",
"iam:DeleteVirtualMFADevice",
"iam:EnableMFADevice",
"iam:ResyncMFADevice"
],
"Resource": [
"arn:aws:iam::123456789012:user/${aws:username}",
"arn:aws:iam::123456789012:mfa/*"
]
},
replied 9 months ago
Thank you for your comment. We'll review and update the Knowledge Center article as needed.
Relevant content
asked 3 years ago
asked 2 years ago
asked 3 years ago
asked 3 years ago

