DOP-C02 practice question: Least privilege, permissions boundaries and ABAC (1 of 3)
Security and Compliance A free question from our original DOP-C02 practice exam. Try it, then open the answer to see why each option is right or wrong.
A regional bank's engineering teams run EC2 instances that are tagged with the owning team's name in a tag called team. Each team has its own IAM principals, and each principal carries a team tag that matches its owning team.
The platform team wants developers to start and stop only the instances that belong to their own team, including instances that teams create in the future. The bank wants one shared policy rather than a separate policy for each team.
Which approach meets these requirements?
Choose one answer.
AA. Create one IAM group for each team with a policy that lists the ARNs of that team's current instances, and add the group's members to the policy as each instance is created.
BB. Attach a policy that allows ec2:StartInstances and ec2:StopInstances on all instances, and add a deny statement for each team that lists the instance IDs owned by every other team.
CC. Add a resource-based policy to each EC2 instance that allows the team's principals to start and stop it, so that access follows the instance wherever it is created.
DD. Attach one policy that allows start and stop actions when the instance's team tag matches the caller's team principal tag, using aws:ResourceTag and aws:PrincipalTag.
Show the answer and explanation
Answer: D
A. Wrong: This works for current instances, but the policy changes every time an instance is created. It also needs a separate group and policy for each team, which the bank wanted to avoid.
C. Wrong: EC2 instances do not support resource-based policies for starting and stopping, so this cannot be configured. The access control has to come from identity-based policies.
Attribute-based access control uses tags to match the caller's principal tags with the resource's tags, so one policy covers every team and every future instance. Per-team groups with instance ARNs need constant upkeep, broad allows with local denies are hard to keep right, and EC2 instances do not take resource-based start and stop policies.
Want more on Least privilege, permissions boundaries and ABAC? The 5 full-length practice sets have 14 more Least privilege, permissions boundaries and ABAC questions, 375 in all, none of them in the free exam. One payment of $14.99, no subscription. See the practice sets →