Study guide
3.3 Automated Incident Remediation with EventBridge & Step Functions
AWS Certified Security – Specialty SCS-C03
Track your progress as you read
Finished sections get a check mark.
1 Chapter 0: Getting Started with the SCS-C03 Exam
0.1 SCS-C03 Exam Format, Domains & Study Strategy
2 Chapter 1: Security Monitoring, Alerting & Threat Detection Services
1.1 Workload Monitoring & Health Check Strategies 1.2 Amazon GuardDuty Architecture & Finding Types 1.3 AWS Security Hub & Automated Conformance Assessment 1.4 Amazon Macie & Automated Data Classification
3 Chapter 2: Enterprise Logging Architecture & Analysis
2.1 Multi-Account CloudTrail & Organization Trails 2.2 Amazon Security Lake & OCSF Log Normalization 2.3 Network Telemetry: VPC Flow Logs & Route 53 Resolver Logs 2.4 Troubleshooting Security Telemetry & Log Ingestion 2.5 Analyzing, Normalizing & Correlating Security Logs
4 Chapter 3: Incident Readiness, Response Planning & Automated Runbooks
3.1 Incident Response Planning & Blast Radius Mitigation 3.2 Testing & Validating Incident Response Plans 3.3 Automated Incident Remediation with EventBridge & Step Functions 3.4 Systems Manager OpsCenter & Incident Manager Runbooks
5 Chapter 4: Digital Forensics, Evidence Preservation & Root Cause Analysis
4.1 Forensic Artifact Capture & Chain of Custody 4.2 Threat Containment & Network Quarantine Techniques 4.3 Correlating Events & Root Cause Analysis with Amazon Detective
6 Chapter 5: Edge Protection, WAF & DDoS Mitigation
5.1 CloudFront Security Headers & Origin Access Control 5.2 AWS WAF Architecture & Advanced Rule Sets 5.3 AWS Shield Advanced & DDoS Defense Architectures 5.4 Edge Integrations: Managed Rule Groups, OCSF Ingestion, IoT Policies & CORS
7 Chapter 6: Compute Workload Hardening, Vulnerability Management & GenAI Security
6.1 Golden AMIs & Container Image Hardening Pipelines 6.2 Amazon Inspector Vulnerability Management & Patch Automation 6.3 Generative AI Security: Amazon Bedrock Guardrails & Model Protection 6.4 Instance Profiles, Service Roles & Execution Roles for Compute 6.5 Secure Administrative Access: Session Manager & EC2 Instance Connect
8 Chapter 7: Network Security, Segmentation, Private Connectivity & Encryption in Transit
7.1 Layered Traffic Filtering: SGs, NACLs & AWS Network Firewall 7.2 Hybrid Connectivity Security: VPN, Direct Connect & MACsec 7.3 Zero-Trust Access & Network Access Analysis 7.4 Enforcing Encryption in Transit: ELB Security Policies, TLS & HTTPS-Only Access 7.5 Private Access: VPC Endpoints, PrivateLink, Client VPN & Verified Access 7.6 Inter-Resource Encryption in Transit: Nitro, EMR, EKS & SageMaker AI
9 Chapter 8: Enterprise Authentication, Federation & Directory Services
8.1 AWS IAM Identity Center & Enterprise IdP Integration 8.2 Amazon Cognito User Pools & Identity Pools 8.3 AWS Security Token Service (STS) & Temporary Credential Workflows 8.4 Troubleshooting Identity & Authentication Failures
10 Chapter 9: Advanced Authorization Architecture & Policy Evaluation
9.1 Complete AWS Policy Evaluation Logic & Decision Flow 9.2 Permission Boundaries & Safe Admin Delegation 9.3 Attribute-Based Access Control (ABAC) with IAM Tags
11 Chapter 10: Least Privilege, Policy Validation & External Access Auditing
10.1 IAM Roles Anywhere & Amazon Verified Permissions 10.2 Auditing External & Unused Access with IAM Access Analyzer 10.3 Analyzing Authorization Failures & Policy Simulation
12 Chapter 11: Cryptographic Services: KMS Architecture & Key Governance
11.1 AWS KMS Architecture, Key Policies & Key Types 11.2 KMS Grants, Encryption Context & Multi-Region Keys 11.3 Imported Key Material (BYOK) & CloudHSM Key Stores
13 Chapter 12: Secrets Management, Sensitive Data Masking & PKI
12.1 AWS Secrets Manager & Systems Manager Parameter Store 12.2 Sensitive Data Masking in Telemetry & Messaging 12.3 AWS Certificate Manager (ACM) & Private CA Architecture
14 Chapter 13: Storage Encryption, Integrity, Lifecycle & Backup Protection
13.1 S3 Encryption Modes & S3 Bucket Keys 13.2 Data Integrity Protection: Object Lock, Vault Lock & Code Signing 13.3 Secure Data Lifecycle, Cross-Account Replication & Backup Vault Lock 13.4 Lifecycle, Backup & Secure Replication Beyond S3: EFS, FSx, DLM, DataSync & Air-Gapped Vaults
15 Chapter 14: Multi-Account Architecture, Organizations & Control Tower Governance
14.1 AWS Organizations Structure, Hierarchy & Resource Control 14.2 AWS Control Tower Landing Zone & Guardrail Framework 14.3 Delegated Administrator Architecture & Root User Governance 14.4 Centralized Resource Sharing with RAM & Service Catalog
16 Chapter 15: Compliance Automation, Infrastructure as Code Security & Auditing
15.1 Infrastructure as Code Security & Multi-Account Deployment 15.2 AWS Config, Conformance Packs & Automated Remediation 15.3 Audit Evidence Collection & Well-Architected Security Reviews
3.3 Automated Incident Remediation with EventBridge & Step Functions
Key Takeaways Explain This Topic AI
Event-driven remediation matches high-severity GuardDuty findings and Security Hub CSPM findings (ASFF) with Amazon EventBridge rules to achieve sub-minute automated response.
AWS Step Functions state machines coordinate multi-step, distributed remediation workflows with visual branching logic, deterministic retry policies, exponential backoff, and error-handling Catch blocks.
Systems Manager Automation runbooks such as AWS-QuarantineEC2Instance, AWSSupport-ContainEC2Instance, AWS-CreateSnapshot, and AWSConfigRemediation-ConfigureS3BucketPublicAccessBlock are auditable remediation building blocks that run across accounts.
AWS Lambda runs targeted response logic, such as revoking an IAM role's active sessions with an inline deny conditioned on aws:TokenIssueTime being earlier than the revocation time.
Enterprise remediation workflows must incorporate safety guardrails: dry-run mode verification, idempotency, automated rollback routines, and human-in-the-loop approval gates using Step Functions .waitForTaskToken callback patterns.
Last updated: September 2026
Automated Incident Remediation with EventBridge & Step Functions
When an adversary breaches a cloud workload, automated script execution operates in seconds, while human security analysts require minutes or hours to detect, investigate, and manually contain the threat. This disparity in operational velocity is known as adversary dwell time . To eliminate dwell time and mitigate potential damage, cloud security architectures must incorporate event-driven automated remediation . By coupling real-time security telemetry with serverless orchestration engines, organizations can detect an intrusion, quarantine compromised resources, revoke leaked credentials, and capture forensic evidence in sub-minute timeframes.
Event-Driven Security Remediation Architecture
In AWS, automated security remediation follows an event-driven architecture centered on Amazon EventBridge , which acts as the universal serverless event bus: +-------------------------------------------------------------+
- | 1. Threat Detection Engine: |
- | • Amazon GuardDuty (e.g., UnauthorizedAccess:EC2) |
- | • AWS Security Hub (ASFF finding: Compliance FAILED) |
- +-------------------------------------------------------------+
- |
- v
- +-------------------------------------------------------------+
- | 2. Event Routing (Amazon EventBridge): |
- | Matches JSON Event Pattern (Severity >= 7.0) |
- +-------------------------------------------------------------+
- |
- v
- +-------------------------------------------------------------+
- | 3. Workflow Orchestration (AWS Step Functions): |
- | Evaluates Resource Type -> Enforces Safety Guardrails |
- +-------------------------------------------------------------+
- |
- +----------------------+----------------------+
- | |
- v v
- +-------------------------------+ +---------------------------------+
- | 4a. AWS SSM Automation: | | 4b. AWS Lambda: |
- | • AWS-StopEC2Instance | | • Revoke Active STS Sessions |
- | • AWS-CreateSnapshot | | • Disable IAM Access Keys |
- | • S3 Block Public Access | | • Quarantine Network Interface |
- +-------------------------------+ +---------------------------------+
- Ingesting Normalized Findings: The AWS Security Finding Format (ASFF)
Different security services historically produced divergent alert formats. AWS Security Hub resolves this by normalizing all findings—whether originating from native services like GuardDuty, Macie, and Inspector, or from third-party firewalls—into the standardized AWS Security Finding Format (ASFF) . Key ASFF JSON fields evaluated by automated remediation rules include:
Id : The unique identifier for the specific finding.
ProductArn : Identifies the emitting tool (e.g., arn:aws:securityhub:us-east-1::product/aws/guardduty ).
AwsAccountId : The account where the incident occurred.
Types : An array classifying the threat (e.g., ["TTPs/Initial Access/UnauthorizedAccess:EC2-TorIP"] ).
Severity.Label : The normalized severity string ( INFORMATIONAL , LOW , MEDIUM , HIGH , CRITICAL ).
Severity.Normalized : A numerical score from 0 to 100, where scores 70.0 to 89.9 represent HIGH and 90.0 to 100.0 represent CRITICAL .
Resources : Detailed metadata describing affected EC2 instances, S3 buckets, IAM roles, or Lambda functions.
Compliance.Status : In compliance checks, indicates PASSED , WARNING , FAILED , or NOT_AVAILABLE .
Constructing EventBridge Rule Event Patterns
Amazon EventBridge evaluates incoming JSON events against declarative filter patterns. To trigger remediation only for high-priority threats and avoid flooding automation runners with informational noise, security teams construct specific event patterns:
- Example: EventBridge Pattern Matching High-Severity GuardDuty Findings {
- "source": ["aws.guardduty"],
- "detail-type": ["GuardDuty Finding"],
- "detail": {
- "severity": [
- { "numeric": [">=", 7.0] }
- ],
- "type": [
- { "prefix": "UnauthorizedAccess:EC2" },
- { "prefix": "Recon:IAMUser" },
- { "prefix": "CryptoCurrency:EC2" }
- ]
- }
- }
- Example: EventBridge Pattern Matching Failed Security Hub S3 Compliance Findings {
- "source": ["aws.securityhub"],
- "detail-type": ["Security Hub Findings - Imported"],
- "detail": {
- "findings": {
- "Compliance": {
- "Status": ["FAILED"]
- },
- "GeneratorId": [
- { "prefix": "aws-foundational-security-best-practices/v/1.0.0/S3." }
- ],
- "Severity": {
- "Label": ["CRITICAL", "HIGH"]
- }
- }
- }
- }
- Cross-Account Event Aggregation
In multi-account environments, findings emitted in spoke workload accounts should not trigger uncoordinated local remediation. Instead, spoke accounts configure EventBridge rules that forward all security events to a centralized Security Event Bus hosted in the Security Tooling account. Remediation workflows execute centrally, maintaining unified audit logging and centralized control.
AWS Step Functions: Multi-Step Remediation Orchestration
While a single AWS Lambda function can execute a basic script, real-world incident containment requires multi-step, sequential, and parallel coordination across multiple systems. Relying on a single monolithic Lambda script introduces severe fragility: if one API call times out or fails, the entire script may crash mid-execution, leaving resources partially modified in an undefined state.
AWS Step Functions state machines provide the ideal enterprise remediation orchestrator:
Visual Workflow Management: Every state transition, execution path, and error is recorded graphically in real time.
Built-in Error Handling & Retries: Native Retry blocks support exponential backoff, jitter, and error-specific handling without writing custom code.
Catch Blocks & Fallback States: If a primary remediation step fails, a Catch block routes execution to an alert state that pages the on-call engineer.
Choice States: The state machine dynamically evaluates the finding metadata to branch between production and non-production accounts or between compute, storage, and identity remediation paths.
Standard vs. Express Workflows for Incident Response
Step Functions provides two distinct workflow types:
- Feature Standard Workflows Express Workflows
- Execution Semantics Exactly-once execution At-least-once execution
- Maximum Duration Up to 1 year Up to 5 minutes
Execution History Full visual history inspected via console/API for 90 days Execution logs pushed to CloudWatch Logs
Human Approval Support Supported via .waitForTaskToken callback pattern Not supported
Throughput / Pricing Billed per state transition; moderate throughput Billed per GB-second; ultra-high throughput (100k+/sec)
Primary IR Use Case Complex multi-account containment, approval gates, forensics High-frequency log scrubbing, rapid alert triage
For security remediation involving human approval gates, EBS snapshot creation, and deep forensic capture, Standard Workflows are required.
AWS Systems Manager Automation Documents
AWS Systems Manager (SSM) Automation allows engineers to safely execute standardized operational and security runbooks at scale. Instead of reinventing custom remediation scripts, security teams leverage pre-built, AWS-managed SSM documents:
1. AWSConfigRemediation-ConfigureS3BucketPublicAccessBlock
When an S3 bucket is inadvertently made public, this runbook turns on the bucket-level S3 Block Public Access settings ( BlockPublicAcls , IgnorePublicAcls , BlockPublicPolicy , RestrictPublicBuckets ). The older AWS-DisableS3BucketPublicReadWrite runbook serves the same purpose for a single bucket.
2. AWS-StopEC2Instance
Gracefully stops a target EC2 instance. In an automated containment workflow, this action is typically sequenced after EBS snapshot creation and volatile memory capture to freeze persistent block storage.
3. AWS-CreateSnapshot
Creates a point-in-time snapshot of one EBS volume (you pass the volume ID). Loop over each attached volume, or call the EC2 CreateSnapshots API to capture all of an instance's volumes at one crash-consistent point. These snapshots are tagged with incident identifiers and can be automatically shared with the isolated Forensics account.
4. AWS-QuarantineEC2Instance and AWSSupport-ContainEC2Instance
AWS-QuarantineEC2Instance assigns a security group that allows no inbound or outbound traffic; AWSSupport-ContainEC2Instance is a broader containment runbook for an instance. Detaching the IAM instance profile (the EC2 DisassociateIamInstanceProfile API, typically called from Lambda or a custom Automation step) stops IMDS from serving new role credentials, but credentials already stolen stay valid until you revoke the role's active sessions.
Cross-Account SSM Automation Execution
To execute SSM runbooks across member accounts from the centralized Security Tooling account:
The centralized Step Functions state machine calls the SSM StartAutomationExecution API.
The call specifies the AutomationAssumeRole parameter pointing to a pre-provisioned role in the spoke account (e.g., arn:aws:iam::444455556666:role/SSMAutomationSpokeExecutionRole ).
The spoke role executes the document locally, ensuring the security account does not require broad direct permissions inside the spoke account.
AWS Lambda for High-Speed Targeted Remediation
For microsecond-level execution speeds and custom containment logic, AWS Lambda complements SSM Automation. A prime example is instantly revoking compromised IAM user credentials .
The Critical Nuance of Active STS Session Invalidation
When an IAM user's long-term access keys are leaked, junior engineers often make the mistake of simply calling iam:DeleteAccessKey or changing the user's password. This does not terminate an active attack.
If the adversary used the compromised access key to generate temporary security credentials via AWS STS (such as calling sts:GetSessionToken or sts:AssumeRole ), those temporary session tokens remain valid until their expiration time (which can be up to 12 or 36 hours). The attacker continues executing API calls unimpeded.
To immediately and completely invalidate all existing temporary STS sessions, the remediation Lambda function must attach an inline session revocation policy to the user or role. The policy uses an explicit Deny with an aws:TokenIssueTime condition: {
- "Version": "2012-10-17",
- "Statement": [
- {
- "Sid": "ImmediatelyRevokeAllActiveSessions",
- "Effect": "Deny",
- "Action": "*",
- "Resource": "*",
- "Condition": {
- "DateLessThan": {
- "aws:TokenIssueTime": "2026-09-29T12:00:00Z"
- }
- }
- }
- ]
- }
How it works: aws:TokenIssueTime is the time the temporary credential was issued. Any request signed with a credential issued before 2026-09-29T12:00:00Z satisfies DateLessThan , so the explicit Deny blocks it, while credentials issued afterward work normally. Do not use aws:CurrentTime here: that key is the time of the request, so the deny would block everyone until the timestamp passes and then stop protecting you. Requests signed directly with long-term access keys carry no aws:TokenIssueTime , so deactivate or delete those keys as well. For roles, the IAM console's Revoke active sessions action attaches this exact pattern as the AWSRevokeOlderSessions inline policy.
Safety Guardrails, Approval Gates & Rollback Mechanisms
Uncontrolled automated remediation is dangerous. If an automated script encounters a false-positive alert and aggressively shuts down a core production database or revokes the credentials of an enterprise application role, the remediation script causes more damage than the threat it was designed to contain. Enterprise remediation workflows must incorporate strict safety guardrails: +-------------------------------------------------------------+
- | EventBridge Trigger: High-Severity Finding Received |
- +-------------------------------------------------------------+
- |
- v
- +-------------------------------------------------------------+
- | Step Functions Choice State: Is this a Production Workload? |
- +-------------------------------------------------------------+
- | |
- [YES] | | [NO / Staging]
- v v
- +---------------------------+ +---------------------------+
- | Human Approval Gate: | | Immediate Execution: |
- | • Pause via Task Token | | • Isolate Instance |
- | • Send Email / Slack Link | | • Revoke Credentials |
- +---------------------------+ +---------------------------+
- | |
- [Approved by SecOps] |
- v |
- +-----------------------------------------------+ |
- | Execute Containment with Dry-Run Validation | <-----------+
- +-----------------------------------------------+
- |
- v
- +-------------------------------------------------------------+
- | Verify Finding Status -> Update Security Hub to RESOLVED |
- +-------------------------------------------------------------+
- 1. Human-in-the-Loop Approval Gates ( .waitForTaskToken )
For production environments or destructive remediation actions (such as terminating compute or modifying public databases), Step Functions provides the Task Token Callback pattern :
The state machine reaches a Task state that publishes an approval request to an Amazon SNS topic or Slack channel using arn:aws:states:::sns:publish.waitForTaskToken .
Step Functions pauses execution and generates a unique, cryptographically signed TaskToken .
The notification contains two URLs (e.g., pointing to an Amazon API Gateway endpoint with query parameters): one for Approve and one for Reject , embedding the task token.
When a verified security engineer clicks "Approve", API Gateway triggers a Lambda function that calls sfn:SendTaskSuccess(taskToken) . If clicked "Reject", it calls sfn:SendTaskFailure(taskToken) .
Upon receiving SendTaskSuccess , Step Functions unpauses and proceeds with the automated remediation steps.
2. Idempotency and Dry-Run Verification
Automated remediation scripts must be idempotent : executing the script multiple times against the same resource must produce the exact same final state without generating errors or corrupting infrastructure. Furthermore, scripts interacting with EC2 should execute API calls with --dry-run to verify that IAM execution roles have the necessary permissions and that target resource IDs exist before executing state alterations.
3. Automated Rollback and Finding Closure
If a containment step fails midway through execution, Step Functions Catch blocks trigger rollback actions (such as restoring original security groups or alerting the primary on-call engineer through the paging tool). Upon successful containment, the workflow calls securityhub:BatchUpdateFindings to update the finding's Workflow.Status to RESOLVED , documenting the automated remediation audit trail in Security Hub.
Restoring Availability with Amazon Application Recovery Controller (ARC)
Skill 2.1.4 also names Amazon Application Recovery Controller (ARC) , because recovery is part of remediation. ARC provides:
Zonal shift : temporarily moves traffic for a supported resource (for example, an Application Load Balancer or Network Load Balancer with cross-zone settings) away from one Availability Zone. A shift is manual, temporary, and carries an expiration of up to three days that you can extend. Zonal autoshift lets AWS start the shift automatically when it detects an AZ impairment.
Routing control and Region switch : multi-Region recovery controls that move traffic between Regional replicas of an application, backed by readiness checks that confirm the standby is actually able to take load.
In an incident, zonal shift is a fast containment-plus-recovery lever: if every compromised instance sits in one AZ, shifting traffic away keeps customers served while responders snapshot and rebuild that capacity. Automate it the same way as other remediations: an EventBridge rule or Step Functions state calls the ARC API, and CloudTrail records who started the shift.
Comparison of Incident Remediation Technologies
Feature AWS Systems Manager Automation AWS Step Functions AWS Lambda
Primary Strength Pre-built, AWS-managed operational runbooks Multi-step orchestration, visual branching, human approvals Custom, high-speed microsecond containment logic
Execution Model Document-based declarative runbook State machine workflow (Standard or Express) Serverless event-driven code execution
Max Duration Long-running; steps can pause for approval Up to 1 year (Standard) / 5 minutes (Express) 15 minutes max per execution
Human Approval Supported with the aws:approve action Supported natively via .waitForTaskToken Must be implemented manually via custom databases
Multi-Account Native via AutomationAssumeRole Orchestrates multi-account calls via SDK integration Requires cross-account STS assume role in code
Best Used For Standard instance/S3 tasks (e.g. S3 Block Public Access) End-to-end incident response pipelines Immediate session revocation, custom API calls
Exam Tips & Common Traps
Important
Session Token Revocation Mechanics: The SCS-C03 exam regularly tests how to neutralize compromised IAM credentials. Remember: Deleting an IAM access key or changing a console password does NOT revoke active STS session tokens. If the question asks for immediate invalidation of all temporary security credentials, the correct answer must include attaching an explicit deny policy with an aws:TokenIssueTime condition (what the console's Revoke active sessions action does for roles), plus deactivating any leaked long-term keys.
Warning
Common Trap on Step Functions Workflow Types: If an exam scenario requires an automated remediation pipeline that includes human-in-the-loop approvals (such as requiring a manager to approve deleting a resource or isolating a production server) or tasks that wait for extended periods, do not select Express Workflows . Express Workflows have a 5-minute execution limit and do NOT support the .waitForTaskToken callback pattern. You must select Standard Workflows .
Tip
ASFF Finding Severity Enums: In EventBridge pattern matching, remember that AWS Security Hub findings use capitalized strings for the Severity.Label field ( INFORMATIONAL , LOW , MEDIUM , HIGH , CRITICAL ), whereas raw Amazon GuardDuty findings use numerical floats ( severity: [{ numeric: [">=", 7.0] }] ). Ensure your rule matches the schema of the emitting service.