nerdexam
Amazon

SAP-C02 · Question #717

A solutions architect must provide a secure way for a team of cloud engineers to use the AWS CLI to upload objects into an Amazon S3 bucket. Each cloud engineer has an IAM user, IAM access keys, and…

The correct answer is D. Attach a policy to the S3-access group to deny all S3 actions unless MFA is present. Request. To securely allow cloud engineers to use the AWS CLI for S3 actions, requiring Multi-Factor Authentication (MFA), an IAM policy must be attached to their S3-access group denying S3 operations unless MFA is present. Engineers will then obtain temporary credentials from AWS STS…

Submitted by fernanda_arg· Mar 6, 2026Continuous Improvement for Existing Solutions

Question

A solutions architect must provide a secure way for a team of cloud engineers to use the AWS CLI to upload objects into an Amazon S3 bucket. Each cloud engineer has an IAM user, IAM access keys, and a virtual multi-factor authentication (MFA) device. The IAM users for the cloud engineers are in a group that is named S3-access. The cloud engineers must use MFA to perform any actions in Amazon S3. Which solution will meet these requirements?

Options

  • AAttach a policy to the S3 bucket to prompt the IAM user for an MFA code when the IAM user
  • BUpdate the trust policy for the S3-access group to require principals to use MFA when principals
  • CAttach a policy to the S3-access group to deny all S3 actions unless MFA is present. Use IAM
  • DAttach a policy to the S3-access group to deny all S3 actions unless MFA is present. Request

How the community answered

(40 responses)
  • A
    15% (6)
  • B
    3% (1)
  • C
    8% (3)
  • D
    75% (30)

Why each option

To securely allow cloud engineers to use the AWS CLI for S3 actions, requiring Multi-Factor Authentication (MFA), an IAM policy must be attached to their `S3-access` group denying S3 operations unless MFA is present. Engineers will then obtain temporary credentials from AWS STS using their IAM user's access keys and an MFA code, which are then used with the AWS CLI to perform S3 actions.

AAttach a policy to the S3 bucket to prompt the IAM user for an MFA code when the IAM user

While S3 bucket policies can enforce MFA, they don't "prompt" for a code; enforcement typically relies on the principal's credentials carrying the MFA context, and it's generally more flexible to enforce MFA at the principal (IAM user/group) level for all services.

BUpdate the trust policy for the S3-access group to require principals to use MFA when principals

IAM groups do not have "trust policies"; trust policies are a feature of IAM roles, making this option fundamentally incorrect.

CAttach a policy to the S3-access group to deny all S3 actions unless MFA is present. Use IAM

This option correctly describes the policy enforcement mechanism but is incomplete, as it doesn't specify the crucial step that users must take to obtain temporary credentials with MFA to interact with the AWS CLI.

DAttach a policy to the S3-access group to deny all S3 actions unless MFA is present. RequestCorrect

To enforce MFA for all Amazon S3 actions, an IAM policy must be attached to the S3-access group that explicitly denies any S3 action unless the aws:MultiFactorAuthPresent condition is true. When this policy is in place, cloud engineers will then need to request temporary credentials from AWS Security Token Service (STS) using their IAM user's access keys and their MFA code, and these temporary credentials, which carry the MFA context, must be used with the AWS CLI to perform the S3 operations.

Concept tested: IAM MFA enforcement, STS temporary credentials, AWS CLI usage with MFA.

Source: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_mfa_enable_cli.html

Community Discussion

No community discussion yet for this question.

Full SAP-C02 Practice