Courseiva
Incident and Event ResponsehardMultiple ChoiceObjective-mapped

Automatically Isolate Compromised EC2 Instances with AWS Config and Systems Manager

A company uses AWS Organizations with multiple accounts. The security team needs to automatically isolate a compromised EC2 instance by removing it from its security group and attaching a quarantine security group that only allows traffic to a forensic instance. Which combination of actions should be implemented?

Quick Answer

The answer is to use AWS Config rules with Systems Manager Automation documents. This combination is correct because AWS Config continuously evaluates EC2 instance security group configurations against your compliance rules, and when a non-compliant instance is detected, it can trigger a Systems Manager Automation document as a remediation action. That automation document then executes the steps to automatically isolate the compromised EC2 instance by removing it from its current security group and attaching a quarantine security group that only allows traffic to a forensic instance. On the AWS Certified DevOps Engineer Professional DOP-C02 exam, this scenario tests your understanding of event-driven, serverless incident response workflows without custom code—a common trap is choosing Lambda functions for orchestration, but Systems Manager Automation is the native, fully managed service for this purpose. Memory tip: think "Config catches, Automation patches" to remember the detection-to-remediation pipeline.

⚠ Common exam trap

A common mix-up: candidates assume any event-driven automation (like Lambda + EventBridge) is always the best answer, but AWS Config with Systems Manager Automation is the native, fully managed, and auditable solution for compliance-driven remediation without custom code.

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 AWS Config rules with AWS Systems Manager Automation documents to automatically remove the instance from the security group and attach the quarantine group when non-compliant.

AWS Config rules can evaluate security group membership compliance, and when a non-compliant EC2 instance is detected, an AWS Systems Manager Automation document can be triggered via a remediation action. This automation document can execute the steps to remove the instance from its current security group and attach a quarantine security group, providing a fully automated, event-driven isolation workflow without requiring custom code for orchestration.

Answer analysis

Option-by-option breakdown

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

  • Use Amazon GuardDuty to automatically modify the security group membership of the instance.

    Why it's wrong here

    GuardDuty detects threats but does not perform remediation; it can trigger EventBridge to invoke a Lambda, but the option does not mention that.

  • Use AWS Shield Advanced to automatically apply the quarantine security group to the instance.

    Why it's wrong here

    Shield Advanced provides DDoS protection, not instance isolation.

  • Use AWS Lambda functions triggered by Amazon EventBridge to remove the instance from the security group and attach the quarantine group.

    Why it's wrong here

    Lambda can modify security groups, but the question asks for a combination; this option omits the triggering mechanism beyond EventBridge, which is not specific to compliance.

  • Use AWS Config rules with AWS Systems Manager Automation documents to automatically remove the instance from the security group and attach the quarantine group when non-compliant.

    Why this is correct

    AWS Config can detect non-compliant instances (e.g., missing required tags) and trigger SSM Automation to perform remediation actions.

About these practice questions

Courseiva writes every DOP-C02 question from scratch — 251 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. 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 Organizations with multiple accounts. The security team notices that an IAM user in the production account has been making changes to security group rules that are not compliant with the company's policy. The team wants to automatically revoke any non-compliant security group rules and notify the security team. What is the MOST efficient way to achieve this?

hard
  • A.Create a CloudWatch alarm on the SecurityGroupEvent metric to notify the security team.
  • B.Apply a Service Control Policy (SCP) that denies changes to security groups in the production account.
  • C.Set up a CloudTrail trail that logs security group modifications and use Amazon Detective to analyze the changes.
  • D.Use an AWS Config managed rule to detect non-compliant security group rules, and configure an automatic remediation action with AWS Systems Manager Automation.

Why D: AWS Config managed rules can continuously evaluate security group rules against a desired policy (e.g., disallowing SSH from 0.0.0.0/0). When a non-compliant change is detected, AWS Config can trigger an automatic remediation action using an AWS Systems Manager Automation document that revokes the offending rule. This provides both detection and automated correction without manual intervention, making it the most efficient solution.

Variation 2. A company uses AWS Organizations with multiple accounts. The security team needs a centralized solution to detect and respond to EC2 instances that are publicly accessible with SSH open to 0.0.0.0/0. Which combination of services provides the most automated detection and remediation?

hard
  • A.AWS CloudTrail and Amazon EventBridge
  • B.Amazon GuardDuty and AWS Lambda
  • C.AWS Config and Amazon Simple Notification Service (SNS)
  • D.AWS Config and AWS Systems Manager Automation

Why D: AWS Config rules can detect non-compliant security groups, and Systems Manager Automation can remediate by modifying the security group rules. GuardDuty detects threats but not config compliance. EventBridge alone doesn't remediate. CloudTrail is for auditing API calls.

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.