Security and Compliance
An IAM user must run CLI operations that require MFA while retaining the user's existing permissions without assuming a role. Which AWS STS operation should the user call with an MFA code?
Show the answer
Correct answerA. GetSessionToken
AWhy this is right: GetSessionToken returns temporary credentials with MFA context while retaining the IAM user's permissions.
BWhy not this: AssumeRoleWithSAML requires a SAML assertion and creates a role session.
CWhy not this: GetFederationToken does not accept MFA parameters to create the required MFA-authenticated session.
DWhy not this: AssumeRole requires a role and uses its permissions rather than simply retaining the user's permissions.
GetSessionToken accepts an IAM user's MFA information and returns temporary credentials that retain the user's permissions with MFA context. AssumeRole creates a role session governed by the role's permissions instead.