Skip to content
Tutorials Center
My learning

Topics

Lesson 28 of 37 ยท Playbooks and Automation

SOAR and Playbook Design

Learn what SOAR platforms do, how to design a security playbook with decision points and approvals, and what to automate first, with a runnable playbook engine.

Analysts repeat the same steps all day: look up an address, check a user, query the endpoint tool, open a ticket, message the owner. Security Orchestration, Automation and Response (SOAR) platforms let a team write those steps once as a playbook and run them automatically or semi-automatically. Done well, SOAR cuts response time and frees people for judgment work. Done badly, it automates mistakes at machine speed.

This lesson covers the concepts and the design rules. The program examples are a tiny teaching stand-in written in Python; they are not a real SOAR product and call no external systems.

What SOAR means

  • Orchestration: connecting tools (SIEM, EDR, email gateway, identity provider, ticketing, firewall) through their APIs so one workflow can use all of them.
  • Automation: running steps without a human, such as enrichment lookups.
  • Response: taking actions such as disabling an account, isolating a host or deleting a phishing email.

A playbook (also called a runbook when it is mostly human steps) is a defined sequence of steps with decisions, inputs and outputs.

What a playbook contains

Trigger Which alert starts it
Enrich Gather context
Decide Branch on the evidence
Act Contain, notify, ticket

Every playbook follows the same four-part shape.

1 / 2

Choosing what to automate

Score a candidate task on three questions: how often does it happen, how clear are the rules, and how bad is a wrong action? High frequency with clear rules and low blast radius (enrichment, ticket creation, notifications) is the sweet spot. Actions with high impact and ambiguity (disabling an executive's account, isolating a production server) should keep a human approval step.

Action Frequency Clarity Risk if wrong Automation level
Look up reputation of an IP Very high High None Fully automatic
Create a ticket with context High High Low Fully automatic
Quarantine a known-bad attachment Medium High Low Automatic with log
Disable a user account Medium Medium Medium Approval required
Isolate a production server Low Low High Approval by incident commander

Playbook design rules

  1. Start from the manual process. Write what analysts do today; automate only what you understand.
  2. One playbook, one purpose. Small playbooks are easier to test and reuse as sub-playbooks.
  3. Make decisions explicit. Show every branch and what data decides it.
  4. Add approvals for risky actions, with timeouts and a safe default when nobody answers.
  5. Fail safely. If an API is down, escalate to a human instead of silently skipping a step.
  6. Log everything: inputs, decisions, actions and results, for audit and debugging.
  7. Make actions reversible where you can (quarantine rather than delete) and record how to undo.
  8. Test with safe data and a dry-run mode that prints what would happen.
  9. Version and review playbooks like code.

An example flow

flowchart TD
    A["Alert: suspicious login"] --> B["Enrich: user, location, device"]
    B --> C{"Known device and normal location?"}
    C -- "Yes" --> D["Close with note"]
    C -- "No" --> E{"Privileged account?"}
    E -- "No" --> F["Force sign-out and notify user"]
    E -- "Yes" --> G["Page on-call analyst"]
    G --> H{"Analyst approves containment?"}
    H -- "Yes" --> I["Disable account, revoke sessions, open incident"]
    H -- "No" --> J["Monitor, add note"]

Low-risk branches finish automatically; the high-risk branch waits for a person.

Try it: a minimal playbook engine

A playbook is data: a list of steps, each a function that reads and writes a shared context. This engine runs steps in order, supports a dry-run, and records every action in an audit log. All "integrations" are fake functions.

Python Tiny playbook engine with dry-run

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Try it: approval with a safe default

Risky steps should never hang forever or default to a dangerous action. This example models an approval request with a timeout and a safe fallback.

Python Approval gate with timeout

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The safe default after a timeout is to escalate, not to disable the account and not to ignore the alert.

Measuring a playbook

Track how many times it ran, how often analysts overrode or reversed it, how much time it saved, and how many errors it hit. A playbook that analysts constantly undo is a bad playbook; fix or retire it. Review quarterly. See SOC metrics.

Common mistakes

  • Automating a poorly understood process, which only makes bad decisions faster.
  • Giving the platform broad credentials. Use least-privilege service accounts for each integration and protect their keys.
  • No kill switch. Provide a way to pause all automated response instantly.
  • Trusting input blindly: an attacker can craft usernames, subjects and file names to trick a playbook, so validate and quote data before using it in actions.
  • Never testing failure paths such as API timeouts.

Treat automation credentials as crown jewels. A SOAR account that can disable users and isolate hosts is a powerful target; restrict who can edit playbooks and log every change.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. Which task is the best first candidate for full automation?

    Enrichment is frequent, clear and harmless if wrong; destructive actions need approvals.
  2. 2. What should a playbook do when nobody answers an approval request within the time limit?

    A safe default keeps a human in charge without stalling the response.
  3. 3. Why include a dry-run mode?

    Dry runs let you validate playbooks safely before they act.
  4. 4. Which is a risk specific to automation?

    Untrusted input must be validated and escaped before it is used in an action or command.

Summary

  • SOAR connects tools and runs playbooks: trigger, enrich, decide, act.
  • Automate frequent, well-defined, low-risk steps first; keep approvals on risky ones.
  • Design for safety: explicit branches, timeouts, fail-safe escalation, audit logs, reversibility, dry runs.
  • Protect automation credentials and measure whether playbooks actually help.

Next: A Phishing Response Playbook