exam questions

Exam AWS Certified Security - Specialty All Questions

View all questions & answers for the AWS Certified Security - Specialty exam

Exam AWS Certified Security - Specialty topic 1 question 195 discussion

Exam question from Amazon's AWS Certified Security - Specialty
Question #: 195
Topic #: 1
[All AWS Certified Security - Specialty Questions]

A company has an AWS account and allows a third-party contractor, who uses another AWS account, to assume certain IAM roles. The company wants to ensure that IAM roles can be assumed by the contractor only if the contractor has multi-factor authentication enabled on their IAM user accounts.
What should the company do to accomplish this?

  • A. Add the following condition to the IAM policy attached to all IAM roles: "Effect": "Deny", "Condition" : { "BoolItExists" : { "aws:MultiFactorAuthPresent" : false } }
  • B. Add the following condition to the IAM policy attached to all IAM roles: "Effect": "Deny", "Condition" : { "Bool" : { "aws:MultiFactorAuthPresent" : false } }
  • C. Add the following condition to the IAM policy attached to all IAM roles: "Effect": "Allow", "Condition" : { "Null" : { "aws:MultiFactorAuthPresent" : false } }
  • D. Add the following condition to the IAM policy attached to all IAM roles: "Effect": "Allow", "Condition" : { "BoolItExists" : { "aws:MultiFactorAuthPresent" : false } }
Show Suggested Answer Hide Answer
Suggested Answer: A 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
studyingalot
Highly Voted 3 years, 8 months ago
A - https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_condition-keys.html#condition-keys-multifactorauthpresent "Recommended Combination - We recommend that you use the BoolIfExists operator to check whether a request is authenticated using MFA."
upvoted 21 times
scuzzy2010
3 years, 8 months ago
I agree. Also see https://aws.amazon.com/premiumsupport/knowledge-center/enforce-mfa-other-account-access-bucket/
upvoted 3 times
...
...
arestokles
Highly Voted 3 years, 9 months ago
B. come on Guys! A says Bool"it"Exists
upvoted 14 times
rhinozD
3 years, 8 months ago
No, B is not recommended way. ##### WARNING: NOT RECOMMENDED ##### "Effect" : "Deny", "Condition" : { "Bool" : { "aws:MultiFactorAuthPresent" : "false" } } silly typo on A.
upvoted 9 times
sapien45
2 years, 10 months ago
Incorrect Homie We recommend that you use the BoolIfExists operator to check whether a request is authenticated using MFA. "Effect" : "Deny", "Condition" : { "BoolIfExists" : { "aws:MultiFactorAuthPresent" : "false" } }
upvoted 1 times
Prathamesh2589
2 years, 9 months ago
it might be typo - BoolIfExists vs BoolItExists t vs f watchout in exam though
upvoted 1 times
ksaru
2 years, 3 months ago
Folks - Please do not assume that it was a typo - it might be a trick. See below an excerpt from AWS documentation supporting option B i.e. Bool condition works for temporary creds and not on long term ones. URL - https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_condition-keys.html#condition-keys-multifactorauthpresent This combination of the Deny effect, Bool element, and false value denies requests that can be authenticated using MFA, but were not. This applies only to temporary credentials that support using MFA. This statement does not deny access to requests that are made using long-term credentials, or to requests that are authenticated using MFA
upvoted 1 times
...
...
...
...
AWSum1
2 years, 6 months ago
I too thought it was B. Then I read this https://stackoverflow.com/questions/69847891/aws-iam-bool-v-s-boolifexists#71569399
upvoted 1 times
...
ca777
3 years, 9 months ago
B 100%: A should be like this : "Deny", "Condition" : { "BoolIfExists" : { "aws:MultiFactorAuthPresent" : "false" } }
upvoted 3 times
...
...
Raphaello
Most Recent 1 year, 4 months ago
Selected Answer: A
AWS recommends using "BoolIfExists" due to complicate evaluation interference with many resources when using MFA. Option A is correct.
upvoted 1 times
...
Salah21
1 year, 8 months ago
Selected Answer: B
A is wrong in this case because "BoolIfExists" doesn't exist. True it is recommended to use the "BoolIfExists" operator to ensure that all requests (including CLI commands AOI operations) are denied if without MFA. But in the question we know that it's roles that are being assumed and no scripts are involved. So the credentials that are used by the roles are temporary, so Bool should work perfectly. https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_condition-keys.html#condition-keys-multifactorauthpresent
upvoted 1 times
Salah21
1 year, 8 months ago
A is wrong ... because "BoolItExists" doesn't exist. Ps: If it's a typo, then A is correct.
upvoted 1 times
...
...
mamila
1 year, 10 months ago
Selected Answer: B
BoolItExists does not exist so answer cannot be A but B.
upvoted 1 times
...
Andrii223
2 years, 1 month ago
Answer - A https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_condition-keys.html Recommended Combination We recommend that you use the BoolIfExists operator to check whether a request is authenticated using MFA. "Effect" : "Deny", "Condition" : { "BoolIfExists" : { "aws:MultiFactorAuthPresent" :
upvoted 1 times
...
G4Exams
2 years, 2 months ago
Selected Answer: A
The policy should be denied if no secure transport.
upvoted 1 times
...
ITGURU51
2 years, 2 months ago
The condition statement in the policy should be as follows: "BoolIfExists": { "aws:MultiFactorAuthPresent": "false Therefore A is the correct answer.
upvoted 1 times
...
sun11111
2 years, 4 months ago
A:Recommended Combination We recommend that you use the BoolIfExists operator to check whether a request is authenticated using MFA. ##### WARNING: NOT RECOMMENDED ##### "Effect" : "Deny", "Condition" : { "Bool" : { "aws:MultiFactorAuthPresent" : "false" } } https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_condition-keys.html#condition-keys-multifactorauthpresent
upvoted 1 times
...
Siddharthbole
2 years, 6 months ago
A Read it in reverse order. No MFA exists > Deny
upvoted 1 times
...
AWSum1
2 years, 6 months ago
Selected Answer: A
https://stackoverflow.com/questions/69847891/aws-iam-bool-v-s-boolifexists#71569399
upvoted 1 times
...
dcasabona
2 years, 11 months ago
Selected Answer: A
It seems to be option A. This combination of Deny, BoolIfExists, and false denies requests that are not authenticated using MFA. Specifically, it denies requests from temporary credentials that do not include MFA. It also denies requests that are made using long-term credentials, such as AWS CLI or AWS API operations made using access keys. The *IfExists operator checks for the presence of the aws:MultiFactorAuthPresent key and whether or not it could be present, as indicated by its existence. Use this when you want to deny any request that is not authenticated using MFA. This is more secure, but can break any code or scripts that use access keys to access the AWS CLI or AWS API.
upvoted 1 times
...
oopsy
3 years, 3 months ago
A https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_condition-keys.html - See Recommended Combination
upvoted 1 times
...
ceros399
3 years, 3 months ago
Selected Answer: A
A is true B is wrong because in that case, not all scenarios will be incluided because aws:MultiFactorAuthPresent only is present when the call is using temporary credentials, if long term credentials are being used, then It will not be present thus the premission will be granted, to apply to al cases we must make sure that the aws:MultiFactorAuthPresent is in the call using "BoolIfExist"
upvoted 2 times
...
RaySmith
3 years, 4 months ago
A is correct
upvoted 1 times
...
cloudchica
3 years, 5 months ago
A is the right answer "The condition check for MultiFactorAuthPresent in the Deny statement should not be a {"Bool":{"aws:MultiFactorAuthPresent":false}} because that key is not present and cannot be evaluated when MFA is not used. So instead, use the BoolIfExists check to see whether the key is present before checking the value." https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_examples_ec2_require-mfa.html
upvoted 1 times
...
Radhaghosh
3 years, 5 months ago
Answer is A, Read BoolItExists --> BoolfExists (that is a typo)
upvoted 1 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...