A solutions architect must enforce MFA for a team of cloud engineers who use the AWS CLI to upload objects to an S3 bucket. Each engineer has an IAM user, access keys, and a virtual MFA device. The IAM users are members of an IAM group named S3-access. MFA must be required for any actions in Amazon S3. Which solution meets these requirements?
Choose an answer
Tap an option to check your answer.
Correct answer: Attach a policy to the S3-access group that denies all S3 actions unless MFA is present. Request temporary credentials from AWS STS and configure those temporary credentials in a CLI profile that users use when performing Amazon S3 actions..
Why this is the answer
The correct solution requires both an IAM policy to enforce MFA and the use of temporary credentials with MFA for CLI access. Attaching a policy to the S3-access group that denies S3 actions unless MFA is present ensures the security requirement. For CLI users, AWS STS GetSessionToken must be used to generate temporary credentials that incorporate the MFA code. These temporary credentials are then configured in the CLI profile. The other options are incorrect because: Attaching a policy directly to the S3 bucket won't prompt for an MFA code from the CLI; MFA is enforced at the IAM user/role level. Updating the trust policy for the S3-access group is not applicable as groups don't have trust policies. Trust policies are for roles. Attaching a policy to the S3-access group that denies S3 actions unless MFA is present is a good first step, but simply continuing to use IAM access keys with the AWS CLI will not prompt for MFA. Access keys alone do not inherently support MFA for CLI operations without temporary credentials.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed