Automating Incident Response with EventBridge and Runbooks
This lesson explains how automation contains threats in seconds: findings become events, rules match them, and runbooks or functions take the first containment steps consistently every time.
Learning outcomes
After completing this lesson, you will be able to:
- Describe the finding, rule and action pattern of automated response.
- Identify the supporting tools for managing and recovering from incidents.
- Decide which actions are safe to automate.
- Trigger an isolation runbook from GuardDuty findings.
Finding, rule, action
Automated response follows a pattern: a finding from GuardDuty, Security Hub or another service reaches EventBridge, a rule matches it, and the rule starts a target. The target depends on the response. Lambda suits quick, single actions, such as disabling an access key or adding an IP address to a block list. Step Functions runs multi-step workflows, including waiting for human approval before a disruptive step. SSM Automation runbooks perform operations on instances, such as isolating one, snapshotting its volumes and collecting evidence.
Config remediation fixes non-compliant resources automatically, such as re-enabling bucket encryption. Security Hub custom actions let an analyst start a runbook on demand from a finding. The following table summarises the targets.
| Action target | Typical use |
|---|---|
| Lambda | Disable a key, block an IP address |
| Step Functions | Multi-step workflows with human approval |
| SSM Automation | Isolate an instance, snapshot volumes, collect evidence |
| Config remediation | Fix non-compliant resources automatically |
| Security Hub custom actions | Start runbooks on demand from a finding |
The following diagram follows a high-severity GuardDuty finding for an EC2 instance to an automated isolation runbook and its steps.

Which response target?
Supporting tools
Beyond EventBridge rules and Lambda functions, several tools help teams manage, investigate and recover from incidents consistently. They track incidents and related work, automate repetitive forensic steps, keep investigation analyses repeatable and move traffic away from impaired infrastructure during recovery. The following list describes them.
- OpsCenter tracks incidents as OpsItems with related resources and runbooks.
- Automated Forensics Orchestrator for Amazon EC2 (an AWS Solution) isolates instances and captures disk and memory automatically.
- SageMaker AI notebooks hold repeatable investigation analyses.
- Application Recovery Controller shifts traffic away from impaired Availability Zones or Regions.
Tools that support response
What to automate
Automate frequent, well-understood and reversible actions, such as re-enabling S3 Block Public Access, revoking an exposed key or isolating an instance with a quarantine security group. Keep a person in the loop, through a Step Functions or Automation approval step, for disruptive production actions such as terminating instances or deleting resources.
Automate fully or keep a person in the loop?
An isolation runbook triggered by findings
High-severity EC2 findings should trigger isolation within a minute, without waiting for a person. An EventBridge rule matches the findings:
{
"source": ["aws.guardduty"],
"detail-type": ["GuardDuty Finding"],
"detail": {
"severity": [{ "numeric": [">=", 7] }],
"resource": { "resourceType": ["Instance"] }
}
}The rule passes the instance ID to a Systems Manager Automation runbook:
aws events put-targets --rule gd-high-ec2 --targets '[{
"Id": "isolate",
"Arn": "arn:aws:ssm:eu-west-1:111111111111:automation-definition/IR-IsolateInstance:$DEFAULT",
"RoleArn": "arn:aws:iam::111111111111:role/EventBridgeStartAutomation",
"InputTransformer": {
"InputPathsMap": { "instance": "$.detail.resource.instanceDetails.instanceId" },
"InputTemplate": "{\"InstanceId\": [<instance>], \"AutomationAssumeRole\": [\"arn:aws:iam::111111111111:role/IRAutomation\"]}"
}
}]'The runbook enables termination protection, detaches the instance from its Auto Scaling group, swaps in the isolation security group, adds a NACL deny, snapshots volumes and tags everything with the finding ID.
Where can incidents be tracked together with their runbooks?
Show answer
In Systems Manager OpsCenter.
Exam Tips
Remember for the exam
- To isolate an instance automatically on a GuardDuty finding, use EventBridge with Step Functions or SSM Automation.
- To capture forensic evidence automatically, use Automated Forensics Orchestrator for Amazon EC2.
- To track incidents with runbooks, use Systems Manager OpsCenter.
- Security Hub custom actions start runbooks from a selected finding.
- Keep human approval for disruptive production actions.