我想向我们的新用户发送他们的 IAM 用户名和临时凭证,然后要求他们更改密码并要求他们配置自己的虚拟 MFA,然后才能访问控制台中的任何其他内容。
1)创建用户时,我显然可以生成一个临时密码并要求他们在第一次登录时更改它。Security Credentials-->Manage Password-->'Require user to create a new password at next sign-in'.
2) 以下策略将允许 IAM 用户更改自己的密码:
{
"Version": "2012-10-17",
"Statement": {
"Effect": "Allow",
"Action": [
"iam:ChangePassword",
"iam:GetAccountPasswordPolicy"
],
"Resource": "*"
}
}
3) 以下策略只允许用户管理自己的虚拟 mfa 设备:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AllowUsersToCreateEnableResyncDeleteTheirOwnVirtualMFADevice",
"Effect": "Allow",
"Action": [
"iam:CreateVirtualMFADevice",
"iam:EnableMFADevice",
"iam:ResyncMFADevice",
"iam:DeleteVirtualMFADevice"
],
"Resource": [
"arn:aws:iam::account-id-without-hyphens:mfa/${aws:username}",
"arn:aws:iam::account-id-without-hyphens:user/${aws:username}"
]
},
{
"Sid": "AllowUsersToDeactivateTheirOwnVirtualMFADevice",
"Effect": "Allow",
"Action": [
"iam:DeactivateMFADevice"
],
"Resource": [
"arn:aws:iam::account-id-without-hyphens:mfa/${aws:username}",
"arn:aws:iam::account-id-without-hyphens:user/${aws:username}"
],
"Condition": {
"Bool": {
"aws:MultiFactorAuthPresent": true
}
}
},
{
"Sid": "AllowUsersToListMFADevicesandUsersForConsole",
"Effect": "Allow",
"Action": [
"iam:ListMFADevices",
"iam:ListVirtualMFADevices",
"iam:ListUsers"
],
"Resource": "*"
}
]
}
使用上面的三种方法我可以要求他们更改密码并允许他们配置自己的虚拟 MFA 设备,我只是不知道是否有办法要求他们配置 MFA。