Welcome to ExamTopics
ExamTopics Logo
- Expert Verified, Online, Free.
exam questions

Exam AWS Certified DevOps Engineer - Professional DOP-C02 All Questions

View all questions & answers for the AWS Certified DevOps Engineer - Professional DOP-C02 exam

Exam AWS Certified DevOps Engineer - Professional DOP-C02 topic 1 question 194 discussion

A company is reviewing its IAM policies. One policy written by the DevOps engineer has been flagged as too permissive. The policy is used by an AWS Lambda function that issues a stop command to Amazon EC2 instances tagged with Environment: NonProduction over the weekend. The current policy is:



What changes should the engineer make to achieve a policy of least permission? (Choose three.)

  • A. Add the following conditional expression:

  • B. Change "Resource": "*"to "Resource": "arn:aws:ec2:*:*:instance/*"
  • C. Add the following conditional expression:

  • D. Add the following conditional expression:

  • E. Change "Action": "ec2:*"to "Action": "ec2:StopInstances"
  • F. Add the following conditional expression:
Show Suggested Answer Hide Answer
Suggested Answer: C 🗳️

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
pokemonas
Highly Voted 7 months, 2 weeks ago
there is no point to restrict "Resource": into instances, when you restricting action to "ec2:StopInstances". Only EC2 instance have such action. So whats the point to restrict Resource.
upvoted 5 times
...
thanhnv142
Highly Voted 7 months, 1 week ago
Selected Answer: B
B, D and E are correct: A: This allow all any lambda func to do the task, wont make any change B: This allow action only on EC2, so it is correct C: We need to allow action on Ec2 instances tagged with NonProdction only. Using this would grant permissions to other tags as well D: perfectly correct E: Only permit stop action, so it is correct F: irrelevant
upvoted 5 times
...
3f78595
Most Recent 1 week, 6 days ago
A, B, D The engineer should make the following changes to achieve a policy of least permission: A:Add a condition to ensure that the principal making the request is an AWS Lambda function. This ensures that only Lambda functions can execute this policy. B:Narrow down the resources by specifying the ARN of EC2 instances instead of allowing all resources. This ensures that the policy only affects EC2 instances. D:Add a condition to ensure that this policy only applies to EC2 instances tagged with ''Environment: NonProduction''. This ensures that production environments are not affected by this policy.
upvoted 1 times
...
GripZA
1 month ago
I'll go with BDE B - restrict resource from wildcard to only "arn:aws:ec2:*:*:instance/*" D - this condition limits to non Prod only E - limit actions to "ec2:StopInstances" and not all ec2 actions as for F, although YOU CAN allow access based on date/time. The typical format is: "Condition": { "DateGreaterThan": {"aws:CurrentTime": "2020-04-01T00:00:00Z"}, "DateLessThan": {"aws:CurrentTime": "2020-06-30T23:59:59Z"} https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_examples_aws-dates.html
upvoted 1 times
...
kiko_zhang
1 month, 3 weeks ago
DEF. when using E, there is no need for B. F: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_examples_aws-dates.html
upvoted 1 times
...
jamesf
1 month, 3 weeks ago
Selected Answer: B
BDE are correct. Option F is irrelevant and can use Amazon EventBridge Rule to execute the Lambda
upvoted 1 times
jamesf
1 month, 3 weeks ago
And in question, there is keywords: least permission So B is needed
upvoted 1 times
...
...
ericphl
1 month, 3 weeks ago
Selected Answer: D
DEF E is more prefect answer rather than B. D. restricted the ec2 using env tag as "nonproduction" F. support scope of running time which mention in the question.
upvoted 2 times
...
MalonJay
4 months, 2 weeks ago
DEF Principal condition is usually for resource policies.
upvoted 2 times
...
seetpt
4 months, 3 weeks ago
Selected Answer: B
BDE for me
upvoted 4 times
...
didek1986
5 months ago
Selected Answer: D
D we need non prod,E we need specific action,F we need dates restriction
upvoted 3 times
...
dkp
5 months, 1 week ago
Selected Answer: B
BDE seems correct
upvoted 2 times
...
soojung
7 months, 1 week ago
Why is B the correct answer?
upvoted 1 times
...
vortegon
7 months, 1 week ago
Selected Answer: A
A,D,E principalType could be a condition key https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_condition.html https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_condition-keys.html
upvoted 4 times
...
promo286
7 months, 3 weeks ago
Selected Answer: B
B, D, and E.
upvoted 2 times
...
yuliaqwerty
8 months, 1 week ago
Selected Answer: B
Vote for BDE
upvoted 3 times
...
Ola2234
8 months, 1 week ago
BDE is the correct answer.
upvoted 1 times
...
d262e67
8 months, 3 weeks ago
Selected Answer: B
B, D, and E. Principal is not for an IAM policy. And it's not possible to include weekdays in the policy.
upvoted 2 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 ...