← Back to Insights

Security Incident Response Automation with SOAR

Metasphere Engineering 10 min read

It is 3:14 AM. A high-confidence alert fires: an IAM access key associated with a production service just made sts:AssumeRole calls against 14 different roles in rapid succession, from an IP address in a country where you have no employees. Your SIEM scored it at 92/100 confidence. The clock starts now. What happens in the next five minutes determines whether this is a contained incident or a breach.

At Company A, the on-call security analyst gets paged, opens the SOAR platform, and the automated playbook has already done the work. Revoked the compromised key. Quarantined the originating instance by swapping its security group. Snapshotted the instance volume for forensics. Exported the last 72 hours of CloudTrail logs to immutable storage. The analyst reviews the automated actions, confirms the incident, and starts root cause investigation. Total time from alert to containment: 4 minutes.

At Company B, the on-call analyst gets paged, opens Slack, asks “does anyone have the runbook for credential compromise?”, waits for a response, finds a Google Doc from 2023 that references an account structure that no longer exists, manually logs into the AWS console, searches for the right IAM user, and starts figuring out the revocation steps. Total time from alert to containment: 47 minutes. In those 43 extra minutes, the attacker has already attempted lateral movement to three additional accounts. Forty-three minutes. That is the cost of treating incident response as documentation instead of software.

The difference between those two outcomes was not budget or headcount. It was whether the team had built response as software or documented it as prose. A PDF on SharePoint does not stop a breach.

Automated vs Manual Incident ResponseSide-by-side comparison of automated SOAR-based incident response completing containment in 4 minutes versus manual response taking 47 minutes. The automated side finishes while the manual side is still on step 3.Incident Response: Automated vs ManualHIGH ALERT: Credential CompromiseUnknown IP. Confidence: 92/100AUTOMATED (SOAR)MANUALRevoke compromised IAM key30sQuarantine instance (swap SG)45sSnapshot volume for forensics1mExport CloudTrail to immutable S31.5mCONTAINEDTotal: 4 minutesEngineer paged, wakes up5 minOpens Slack, asks for runbook8 minFinds outdated Google Doc (2023)12 minAutomated side already containedLogs into AWS, finds IAM user10 minFigures out revocation steps...12 min...still working (47 min total)Automated4 minManual47 min43 extra minutes = lateral movement to 3 additional accounts

Detection: Where Most Programs Are Weakest

You cannot respond to incidents you do not detect. And here is the uncomfortable reality: median attacker dwell time in enterprise environments (time between initial compromise and detection) remains approximately 10 days for organizations with dedicated SOC teams. For organizations relying on external notification (a customer reports suspicious activity, law enforcement contacts you), it exceeds 200 days. Not hours. Not weeks. Months of undetected access. Someone else is in your systems right now and you might not know it.

Most organizations have detection gaps they are not aware of because the gaps look like silence. No alerts does not mean no incidents. It means your detection rules are not covering the attack techniques actually being used against you. Silence is not safety. It is blindness.

Out-of-the-box SIEM rules generate enormous volumes. A typical deployment produces 500-2,000 alerts per day, and the vast majority are false positives from normal operational activity. Security teams that do not tune rules develop alert fatigue within weeks. When everything is an alert, nothing is. The effective outcome is identical to having no detection at all. Your analysts close tickets mechanically and stop reading the details.

The fix is not more rules. It is smarter rules.

Building the Context Enrichment Layer

Context enrichment transforms raw events into actionable signals.

A single failed authentication attempt is noise. Two hundred failed attempts from the same IP against 15 different accounts in 5 minutes is a credential stuffing attack. The raw events look identical. The difference is context: rate, distribution, and source reputation. Without that context, your analysts are drowning in noise that all looks the same.

Three types of enrichment matter most. Identity context: is this a service account (which should never log in interactively) or a human? What permissions does this identity have? Asset context: is the target a production server handling customer data or a developer sandbox? Behavioral baseline: is this volume of API calls normal for this identity at this time of day, measured against a 30-day pattern?

Building this context layer is real engineering work. Your cloud security tools provide the raw telemetry. CloudTrail provides API-level audit logging. VPC flow logs provide network-level visibility. GuardDuty provides ML-based anomaly detection. But correlating those sources, enriching events with asset and identity context, and tuning detection rules to your environment’s specific patterns requires engineering effort that no SIEM vendor can do for you. This is your environment. You have to teach the system what “normal” looks like.

The investment pays off measurably. Teams that implement enrichment-based detection rules typically reduce false positive rates from 90%+ to under 15%, while simultaneously catching threat patterns that generic rules miss entirely. That means your analysts spend their time investigating real threats instead of closing noise. And that is when detection actually starts working.

With detection producing real signals, the next question is what happens when those signals fire.

Automated Containment Playbooks

Manual containment during an active incident is slow by design. Your analyst needs to look up the API call to revoke an IAM credential, find the correct AWS account, navigate the console, and coordinate with stakeholders simultaneously. Every minute of that process is a gift to the attacker. Every additional minute is lateral movement opportunity.

SOAR platforms (Tines, Torq, Splunk SOAR, PagerDuty) execute response playbooks automatically on alert trigger. When a high-confidence credential compromise fires, the playbook executes in seconds what would take an analyst 20-40 minutes manually:

  1. Revoke the suspected credential (disable IAM access key or delete temporary session)
  2. Quarantine the affected instance (swap its security group to an isolation group with no egress)
  3. Snapshot the instance volume (preserve forensic evidence before any state changes)
  4. Export CloudTrail logs for the past 72 hours to immutable S3 with Object Lock
  5. Open an incident ticket with pre-populated context (affected resource, alert details, automated actions taken)
  6. Page the on-call security engineer with the ticket link

Playbook quality determines whether automation helps or creates new problems. A playbook that quarantines the wrong instance, pages the wrong team, or fails silently on an API error is worse than no automation at all. It happens. Treat these playbooks with the same discipline as production software: version control, testing in staging environments, regular game day exercises, and post-incident updates when something goes wrong. The automated remediation patterns used in reliability engineering apply directly to SOAR playbook development.

Containment stops the bleeding. But you need to preserve the evidence before you stop the bleeding, or you lose the ability to understand what happened.

Forensic Evidence Preservation

Cloud infrastructure is designed to be ephemeral. Auto-scaling groups terminate instances. Logs rotate. Object versions expire. The very properties that make cloud operations efficient actively destroy forensic evidence if you have not prepared in advance.

Configure these prerequisites before you need them. Not during the incident. Before. CloudTrail enabled in all regions with S3 log archiving and Object Lock to prevent tampering. VPC flow logs retained for at least 90 days (180 recommended for compliance-heavy environments). GuardDuty or equivalent runtime threat detection active. DNS query logging enabled. Container runtime logging for Kubernetes workloads.

When an incident is confirmed, the evidence preservation sequence must happen before any containment action that alters state:

This sequence should be automated in your SOAR playbook, not documented in a runbook that someone reads during the incident. The whole point of automation is that it executes the right steps in the right order under pressure. Humans under stress skip steps, reorder actions, and make judgment calls that destroy evidence. Machines do not. At 3 AM with an active attacker in your infrastructure, you want the machine making the evidence preservation decisions.

With evidence preserved and the attacker contained, the real investigative work begins.

Timeline Reconstruction

After containment, the critical forensic artifact is a unified timeline correlating events across all log sources. The timeline establishes: when the attacker first gained access (initial compromise), what they did first (initial actions on objective), how long they had undetected access (dwell time), what systems and data they touched, what persistence mechanisms they installed, and when you detected and contained them.

The sources: CloudTrail for API calls, VPC flow logs for network connections, application logs for data access, DNS query logs for external communications, endpoint detection for process execution and file activity. Correlating these sources depends entirely on clock synchronization across all systems. NTP drift of even a few seconds makes cross-source correlation unreliable and will cause you to misorder events in the timeline. If you cannot trust your timestamps, you cannot trust your timeline.

Most incident management tools support timeline construction from multiple log sources. The key is having all sources flowing into a centralized, queryable store before the incident occurs. Building log pipelines during an incident guarantees you will miss evidence. The time to build observability is always before you need it.

The timeline tells you what happened. The post-incident work determines whether it happens again.

Post-Incident Work That Prevents Recurrence

A post-incident review that concludes with “we will improve security awareness training” has told you nothing actionable. That is not a finding. That is a way of saying “we do not know what to fix.” The findings that actually reduce future risk are specific engineering changes: a detection rule that would have caught the initial compromise 6 hours earlier, a containment playbook step that failed because the API call timed out, a credential that should have been federated instead of key-based, a network path that should have been closed months ago.

The integration between security and DevOps is direct: incident findings feed into the engineering backlog as detection improvements, playbook updates, and infrastructure hardening work with clear priority and measurable success criteria. Did the new detection rule fire on the next tabletop exercise? Did the playbook fix reduce containment time in the next game day? These are testable questions. Teams that close this loop consistently reduce their MTTD and MTTC by 15-25% per quarter across successive improvement cycles.

Teams that treat post-mortems as compliance documents repeat the same incidents. Teams that treat them as engineering inputs build cumulative defense capability that compounds over time. After two years of consistent post-incident improvement work, the difference between those approaches is not incremental. It is the difference between an organization that gets breached the same way twice and one that never gets breached the same way twice.

Build Incident Response Capability Before You Need It

A response plan in a PDF does not stop a breach. Metasphere builds the detection pipelines, automated containment playbooks, and forensic preservation infrastructure that make incident response work when it matters.

Strengthen Your Response

Frequently Asked Questions

What is the difference between SIEM and SOAR?

+

A SIEM collects, normalizes, and correlates security events to generate alerts. A SOAR platform automates the response actions those alerts trigger: isolating hosts, revoking credentials, capturing forensic evidence, and paging the on-call team. Organizations running both typically reduce Mean Time to Contain by 60-80%, cutting containment from hours to under 10 minutes for common incident types.

How do you reduce SIEM false positives without losing detection coverage?

+

Build context into detection rules rather than lowering sensitivity. A single failed login is noise; 200 failed logins from one IP against multiple accounts in 5 minutes is a signal. Context enrichment with asset classification, identity type, and behavioral baselines transforms raw events into actionable alerts. Teams that implement enrichment typically reduce false positives by 70-85% while maintaining or improving detection coverage.

How do you preserve forensic evidence in cloud before containment destroys it?

+

Act before containment. Immediately snapshot affected EBS volumes, export CloudTrail logs for the past 72 hours to S3 with Object Lock, capture VPC flow logs for affected subnets, and take memory dumps from running instances if tooling supports it. All of this must happen before security group changes or instance termination that would destroy volatile evidence.

What should a post-incident timeline reconstruction include?

+

A complete timeline establishes: initial compromise method and timestamp, dwell time (undetected access duration), systems and data accessed, persistence mechanisms installed, data exfiltrated, and detection and containment timestamps. Sources include CloudTrail, VPC flow logs, application logs, endpoint detection, and DNS query logs. Industry median dwell time is roughly 10 days with mature detection, but exceeds 200 days without.

What metrics should we track for incident response capability?

+

Mean Time to Detect is the most critical metric. Target under 24 hours for Severity 1 incidents. Mean Time to Contain should be under 1 hour for Severity 1 and under 4 hours for Severity 2. Track both by severity tier and review quarterly. Teams that measure and review these metrics consistently reduce MTTD and MTTC by 15-25% per quarter over successive improvement cycles.