DOP-C02 Incident and Event Response Practice Question
A company uses AWS Config to track resource changes. They want to automatically remediate non-compliant security group rules that allow public SSH access. What is the MOST effective approach?
⚠ Common exam trap
A common mix-up: candidates assume a custom Lambda function (Option A) is the most flexible or effective approach, but AWS Config's native remediation with Systems Manager Automation is the recommended, fully managed, and less error-prone solution for automatic compliance enforcement.
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
✓
Create an AWS Config rule with an automatic remediation action using AWS Systems Manager Automation.
AWS Config can directly associate an AWS Systems Manager Automation document as a remediation action for a non-compliant rule. This approach provides a fully managed, idempotent, and auditable remediation workflow without requiring custom Lambda code or external event orchestration. The automation document can be configured to automatically remove the SSH ingress rule (port 22) from the security group when the Config rule detects non-compliance.
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 up an AWS Config rule that triggers a Lambda function to remove the SSH rule.
Why it's wrong here
While AWS Config can trigger a Lambda function upon detecting a non-compliant rule, it only evaluates resources at the time of the configuration change or periodic scan, not continuously blocking the SSH rule from being re-added. This approach is tempting because Lambda remediation is commonly used for one-off fixes, but it fails to prevent future re-creation of the rule, unlike a service control policy or a proactive guard. It would be correct if the requirement were only to remove existing non-compliant rules on detection, without needing ongoing prevention.
- ✗
Use Amazon CloudWatch Events to detect the change and invoke a Lambda function.
Why it's wrong here
Amazon CloudWatch Events (now part of Amazon EventBridge) captures AWS API events, but this approach is inherently reactive—it only fires after the AuthorizeSecurityGroupIngress call has already modified the security group. A Lambda function invoked by the event would then have to parse the event to find the specific ingress rule and revoke it, and if multiple rules are added in quick succession, asynchronous invocations can race or miss rules. This lacks the continuous, retrying compliance enforcement that AWS Config remediation provides, and it does nothing to prevent the rule from being added again.
- ✗
Use AWS Service Catalog to enforce security group templates.
Why it's wrong here
AWS Service Catalog is designed to govern the creation of new resources by forcing users to launch approved products from curated CloudFormation templates—it is not a compliance enforcement engine for existing resources. Even if you embed a 'security group template' into a Service Catalog product, it only controls how security groups are originally provisioned via the catalog; it cannot inspect or modify pre-existing security groups or block API calls that bypass Service Catalog. Therefore it cannot detect or remove an unauthorized SSH ingress rule that was added directly to an existing group.
- ✓
Create an AWS Config rule with an automatic remediation action using AWS Systems Manager Automation.
Why this is correct
This is the correct approach because AWS Config rules continually evaluate resources against a desired policy, and when they detect non-compliance they can trigger an automatic remediation action—a Systems Manager Automation document—to fix the resource. In this case the rule (such as the managed RESTRICTED_SSH rule) would flag any security group with port 22 open to 0.0.0.0/0, and the associated SSM Automation document (for example, AWS-RevokeSecurityGroupIngress) would revoke the offending rule automatically. AWS Config tracks the remediation status and retries until the resource becomes compliant, providing a closed-loop, auditable remediation process without manual involvement.
Quick reference
Cloud Service Model Comparison
| Model | You Manage | Provider Manages | Examples |
|---|---|---|---|
| IaaS | OS, runtime, apps, data | Hardware, hypervisor, networking | EC2, Azure VMs, GCP Compute Engine |
| PaaS | Apps and data | OS, runtime, middleware, hardware | Elastic Beanstalk, Azure App Service |
| SaaS | Data and settings only | Everything else | Microsoft 365, Salesforce, Workday |
| FaaS / Serverless | Function code only | Infra, scaling, runtime | Lambda, Azure Functions, Cloud Run |
| CaaS | Containers and apps | Kubernetes, OS, hardware | EKS, AKS, GKE |
Go deeper
Related to this question
About these practice questions
This DOP-C02 question is part of Courseiva's 251-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
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.