nerdexam
Amazon

DOP-C02 · Question #121

A company uses AWS CodeCommit for source code control. Developers apply their changes to various feature branches and create pull requests to move those changes to the main branch when the changes…

The correct answer is A. Create an additional policy to include a Deny rule for the GitPush and PutFile actions. Include a. AWSCodeCommitPowerUser is an AWS-managed policy. So you need to add an additional policy to deny push to the main branch directly.

Submitted by alyssa_d· Mar 6, 2026Security and Compliance

Question

A company uses AWS CodeCommit for source code control. Developers apply their changes to various feature branches and create pull requests to move those changes to the main branch when the changes are ready for production. The developers should not be able to push changes directly to the main branch. The company applied the AWSCodeCommitPowerUser managed policy to the developers' IAM role, and now these developers can push changes to the main branch directly on every repository in the AWS account. What should the company do to restrict the developers' ability to push changes to the main branch directly?

Options

  • ACreate an additional policy to include a Deny rule for the GitPush and PutFile actions. Include a
  • BRemove the IAM policy, and add an AWSCodeCommitReadOnly managed policy. Add an Allow rule
  • CModify the IAM policy. Include a Deny rule for the GitPush and PutFile actions for the specific
  • DCreate an additional policy to include an Allow rule for the GitPush and PutFile actions. Include a

How the community answered

(31 responses)
  • A
    77% (24)
  • B
    6% (2)
  • C
    3% (1)
  • D
    13% (4)

Explanation

AWSCodeCommitPowerUser is an AWS-managed policy. So you need to add an additional policy to deny push to the main branch directly.

Topics

#IAM Policies#CodeCommit#Git Branch Protection#Explicit Deny

Community Discussion

No community discussion yet for this question.

Full DOP-C02 Practice