Question 723 of 1,750
SDLC AutomationhardMultiple ChoiceObjective-mapped

Enforce GPG Signed Commits in AWS CodeCommit

This DOP-C02 practice question tests your understanding of sdlc automation. This is a configuration task: choose the command set that satisfies every stated requirement. Small differences — like 'secret' vs 'password' or 'transport input ssh' vs 'all' — change whether the answer is correct. After answering, compare your reasoning against the explanation and wrong-answer breakdown below. Once you have made your selection, read the full explanation to reinforce the concept and understand why each distractor is designed to mislead on exam day.

A company uses AWS CodeCommit for source control and wants to enforce that all commits to the main branch are signed. The DevOps team has configured Git commit signing using GPG keys. However, some developers are able to push unsigned commits to main. What should the engineer do to enforce signed commits?

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

Use an AWS CodeCommit trigger with an AWS Lambda function that validates commit signatures and rejects unsigned commits.

Option C is correct because AWS CodeCommit does not natively support a 'require signed commits' setting like GitHub or GitLab. To enforce signed commits, you must use a CodeCommit trigger that invokes an AWS Lambda function to validate the GPG signature of each commit pushed to the main branch. The Lambda function can parse the commit object, verify the signature using the developer's public key, and reject the push by returning an error if the commit is unsigned or the signature is invalid.

Key principle: Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • Set the 'requireSignedCommits' parameter in the repository configuration to 'true'.

    Why it's wrong here

    This parameter does not exist in CodeCommit.

  • Configure branch protection rules in IAM to deny push access to main unless the commit is signed.

    Why it's wrong here

    IAM cannot inspect commit signatures.

  • Use an AWS CodeCommit trigger with an AWS Lambda function that validates commit signatures and rejects unsigned commits.

    Why this is correct

    Lambda can validate signatures and reject pushes via CodeCommit's ability to reject triggers.

    Related concept

    Read the scenario before looking for a memorised answer.

  • Create a repository policy that denies git push actions unless the condition 'codecommit:References' and 'codecommit:SourceIp' match.

    Why it's wrong here

    This does not check signatures.

Common exam traps

Common exam trap: answer the scenario, not the keyword

The trap here is that candidates assume AWS CodeCommit has a built-in 'require signed commits' toggle like GitHub or GitLab, but AWS CodeCommit requires a custom serverless solution (Lambda trigger) to enforce this, and the exam tests your ability to recognize when native features are absent.

Detailed technical explanation

How to think about this question

Under the hood, CodeCommit triggers are configured to invoke a Lambda function synchronously on push events. The Lambda function receives a JSON payload containing commit details, including the commit ID and branch reference. The function can use the AWS SDK to call GetCommit and retrieve the commit object, which includes the 'committer' field with the GPG signature key ID if present. If the signature is missing or invalid, the Lambda function can throw an exception to reject the push, effectively enforcing signed commits at the repository level.

KKey Concepts to Remember

  • Read the scenario before looking for a memorised answer.
  • Find the constraint that changes the correct option.
  • Eliminate answers that are true in general but not in this case.

TExam Day Tips

  • Watch for words such as best, first, most likely and least administrative effort.
  • Review why wrong options are wrong, not only why the correct option is correct.

Key takeaway

Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.

Real-world example

How this comes up in practice

A media company stores terabytes of video archives that are accessed once a year for audit purposes. Moving these objects to a cold storage tier (Azure Archive, S3 Glacier, or Google Nearline) costs a fraction of hot storage. Questions like this test whether you understand storage tiers, access frequency tradeoffs, and retrieval latency requirements.

Quick reference

Cloud Service Model Comparison

ModelYou ManageProvider ManagesExamples
IaaSOS, runtime, apps, dataHardware, hypervisor, networkingEC2, Azure VMs, GCP Compute Engine
PaaSApps and dataOS, runtime, middleware, hardwareElastic Beanstalk, Azure App Service
SaaSData and settings onlyEverything elseMicrosoft 365, Salesforce, Workday
FaaS / ServerlessFunction code onlyInfra, scaling, runtimeLambda, Azure Functions, Cloud Run
CaaSContainers and appsKubernetes, OS, hardwareEKS, AKS, GKE

What to study next

Got this wrong? Here's your next step.

Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.

Related practice questions

Related DOP-C02 practice-question pages

Use these pages to review the topic behind this question. This is how one missed question becomes focused revision.

Practice this exam

Start a free DOP-C02 practice session

Short sessions build daily habit. Longer sessions build exam-day stamina. Try a timed session to simulate real conditions.

FAQ

Questions learners often ask

What does this DOP-C02 question test?

SDLC Automation — This question tests SDLC Automation — Read the scenario before looking for a memorised answer..

What is the correct answer to this question?

The correct answer is: Use an AWS CodeCommit trigger with an AWS Lambda function that validates commit signatures and rejects unsigned commits. — Option C is correct because AWS CodeCommit does not natively support a 'require signed commits' setting like GitHub or GitLab. To enforce signed commits, you must use a CodeCommit trigger that invokes an AWS Lambda function to validate the GPG signature of each commit pushed to the main branch. The Lambda function can parse the commit object, verify the signature using the developer's public key, and reject the push by returning an error if the commit is unsigned or the signature is invalid.

What should I do if I get this DOP-C02 question wrong?

Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.

What is the key concept behind this question?

Read the scenario before looking for a memorised answer.

About these practice questions

Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

Same concept, more angles

2 more ways this is tested on DOP-C02

These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.

Variation 1. A company uses AWS CodeCommit as a Git repository. Developers want to enforce that all commits are signed with GPG keys. How can this be achieved?

medium
  • A.Configure a Git hook in the repository to reject unsigned commits.
  • B.Use an IAM policy condition to deny pushes if the commit is not signed.
  • C.Enable the 'Require GPG signatures' option in the CodeCommit repository settings.
  • D.Ask developers to sign commits locally and use a pre-commit hook.

Why D: AWS CodeCommit does not natively support server-side GPG signature verification or a repository-level setting to require signed commits. The most practical way to enforce signed commits is through client-side Git hooks. Option D describes this approach: developers sign commits locally and a pre-commit hook ensures that every commit is signed before it is created. While not foolproof (developers can bypass the hook), it is the only viable method among the options that aligns with CodeCommit's capabilities. Option A misinterprets 'Git hook in the repository' as a server-side hook, which CodeCommit does not support. Option B is incorrect because IAM policies cannot evaluate commit signature status. Option C is incorrect because CodeCommit lacks such a native setting.

Variation 2. A team is using AWS CodeCommit as their version control system. They want to ensure that all commits are signed with a GPG key. What is the simplest way to enforce this?

easy
  • A.Use AWS CloudTrail to monitor unsigned commits and automatically revert them.
  • B.Use a pre-commit hook in the local repository to enforce signing.
  • C.Configure an IAM policy that denies PutFile if the commit is not signed.
  • D.Enable the 'Require signed commits' option in the CodeCommit repository settings.

Why D: Option D is correct because AWS CodeCommit provides a built-in repository setting called 'Require signed commits' that, when enabled, rejects any push containing unsigned commits at the server side. This is the simplest and most reliable enforcement mechanism because it does not rely on client-side configurations or custom scripts, and it leverages CodeCommit's native integration with GPG signature verification.

Keep practising

More DOP-C02 practice questions

Last reviewed: Jul 4, 2026

Question Discussion

Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.

Loading comments…

Sign in to join the discussion.

This DOP-C02 practice question is part of Courseiva's free Amazon Web Services certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the DOP-C02 exam.