Open-source SOAR lab: webhook alert triage to automated containment with full audit trail.
🔎 Last updated · Editorial policy · Report an error
TL;DR: Shuffle is an open-source SOAR platform you can run in Docker on a lab machine to automate alert triage end-to-end. In this guide you’ll install Shuffle, expose a webhook that receives alerts, enrich attacker IPs with VirusTotal, look up users in a CSV asset list, auto-contain via a webhook, and export the full playbook JSON to reuse or modify.
Why Build a SOAR Lab?
SOC analysts spend a huge share of their day on repetitive work: looking up IPs, checking whether a hostname belongs to the company, and running containment actions. SOAR (Security Orchestration, Automation and Response) platforms automate exactly this, but commercial products like Splunk SOAR or Cortex XSOAR are expensive and hard to learn on. Shuffle is open source, runs in Docker, and uses a visual workflow editor — perfect for a home lab.
By the end of this tutorial you’ll have a working playbook that:
- Receives an alert JSON payload via a Shuffle webhook
- Extracts the source IP and username from the alert
- Enriches the IP with VirusTotal
- Checks the user against a CSV asset list
- Decides based on both results: disable the user, block the IP, or just log
- Writes an audit entry for every action taken
Authorization Note
Run everything in this tutorial against your own machines and test data only. The containment webhooks simulate actions like disabling accounts or blocking IPs — never point this playbook at infrastructure you don’t own, and don’t send real sensitive data to third-party enrichment APIs in production without a data-handling agreement. A lab VM, a spare laptop, or a small cloud instance you control is all you need.
Install Shuffle with Docker
Shuffle ships as a Docker Compose stack. You need Docker and Docker Compose installed (Docker Desktop works fine on Windows/macOS). First install the backend and frontend:
git clone https://github.com/Shuffle/Shuffle.git
cd Shuffle
docker compose up -d
Expected output — six containers should start:
[+] Running 7/7
✔ Network shuffle_shuffle-network Created
✔ Container shuffle-frontend Started
✔ Container shuffle-backend Started
✔ Container shuffle-orborus Started
✔ Container shuffle-worker Started
✔ Container shuffle-app_sdk Started
✔ Container shuffle-database Started
Wait about a minute, then confirm the backend is healthy:
docker compose ps
# STATUS column should show "Up" for backend and frontend
Open http://localhost:3001 in your browser. Create your admin account on first launch (username, password — there’s no email verification in the local build).
Set Up the VirusTotal Integration
Shuffle apps sometimes need to run in an accessible environment. To pull the VirusTotal app into your local instance, go to Apps in the left menu, search for virustotal, and click Download. If the download stalls (common in air-gapped or slow environments), you can import it manually:
curl -LO https://raw.githubusercontent.com/Shuffle/shuffle-apps/main/virustotal/1.2.0/src/app.py 2>/dev/null
# Alternatively, in the Shuffle UI: Apps -> Import App -> select the app YAML/zip
You’ll also need a free VirusTotal API key. Register at virustotal.com, go to your profile, and copy the API key (rate-limited to 4 requests/minute on the free tier — fine for a lab).
In Shuffle, go to App Authentication, click New, select the VirusTotal app, name it vt-key, and paste your API key as the value.
Create the Asset List (CSV)
This is the “does this user even exist in my org?” check. In your lab, create a small CSV of users and whether they’re privileged. We’ll host it where the playbook can read it — the simplest lab approach is a tiny Python HTTP server:
mkdir -p ~/shuffle-lab && cd ~/shuffle-lab
cat > users.csv <<'EOF'
username,department,privileged
alice,finance,no
bob,it,yes
mallory,marketing,no
svc_backup,it,yes
EOF
python3 -m http.server 8000 --directory .
# Serving HTTP on 0.0.0.0 port 8000 (http://0.0.0.0:8000/) ...
Verify it’s reachable:
curl http://localhost:8000/users.csv
# username,department,privileged
# alice,finance,no
# bob,it,yes
# ...
Build the Containment Webhook
In a real environment, containment would call your EDR, IdP, or firewall API. In the lab we’ll fake it with a small webhook listener that logs what it receives and returns success. Create contain.py:
cat > contain.py <<'EOF'
from flask import Flask, request, jsonify
import json, datetime
app = Flask(__name__)
AUDIT_LOG = "audit.log"
def audit(action, data):
ts = datetime.datetime.utcnow().isoformat()
with open(AUDIT_LOG, "a") as f:
f.write(json.dumps({"ts": ts, "action": action, "payload": data}) + "n")
@app.route("/disable_user", methods=["POST"])
def disable_user():
body = request.get_json(force=True)
print(f"[CONTAIN] Disabling user: {body}")
audit("disable_user", body)
return jsonify({"status": "success", "action": "disable_user", "user": body.get("username")})
@app.route("/block_ip", methods=["POST"])
def block_ip():
body = request.get_json(force=True)
print(f"[CONTAIN] Blocking IP: {body}")
audit("block_ip", body)
return jsonify({"status": "success", "action": "block_ip", "ip": body.get("ip")})
if __name__ == "__main__":
app.run(host="0.0.0.0", port=5000)
EOF
pip install flask && python3 contain.py
# * Running on http://0.0.0.0:5000
Build the Playbook
In Shuffle, go to Workflows → New Workflow, name it Alert Enrichment and Containment. The workflow uses these building blocks, connected left to right:
Step 1: Webhook Trigger
Drag in a Webhook trigger. Shuffle assigns a URL like http://localhost:5001/api/v1/hooks/<workflow_id>. Note the workflow ID. Test it before wiring anything else:
curl -X POST http://localhost:5001/api/v1/hooks/YOUR_WORKFLOW_ID
-H "Content-Type: application/json"
-d '{
"alert_name": "Suspicious admin login",
"source_ip": "185.220.101.5",
"username": "bob",
"severity": "high"
}'
Check the workflow’s Executions tab — you should see the execution with the full JSON under the exec node.
Step 2: Extract the IP and Username
Add a Filter JSON app (or use Shuffle’s Liquid filters directly). Configure it to output the fields we need:
source_ip→${exec.alert.source_ip}username→${exec.alert.username}
Step 3: VirusTotal Enrichment
Add the VirusTotal app, choose Get IP report, select your vt-key authentication, and set the IP to ${exec.alert.source_ip}. The free-tier response includes the malicious vote count under attributes.last_analysis_stats.malicious.
Step 4: CSV User Lookup
Add a HTTP app (or cURL action) with:
- Method:
GET - URL:
http://host.docker.internal:8000/users.csv(on Linux, use your machine’s LAN IP instead ofhost.docker.internal)
The response body is the CSV text. Shuffle supports Liquid templating with filters, so in the following branch you can check membership like:
{% assign lines = response_body | split: "n" %}
{% assign user_found = false %}
{% for line in lines %}
{% assign fields = line | split: "," %}
{% if fields[0] == username %}{% assign user_found = true %}{% assign priv = fields[2] %}{% endif %}
{% endfor %}
Step 5: Decision Gates
Add a Conditional Switch (if/else) node. Use two conditions:
- Known user + malicious IP:
${vt.data.attributes.last_analysis_stats.malicious} ≥ 3AND the CSV lookup found the user → route to Disable User - Malicious IP but unknown user: → route to Block IP
- Everything else: → route to Log only (no action)
This structure is the heart of SOAR design: enrichment feeds decision, decision gates prevent blind automation. A benign IP should never trigger containment, even if the rest of the alert looks scary.
Step 6: Containment Actions
Add two HTTP app nodes:
- Disable User: POST to
http://host.docker.internal:5000/disable_userwith body{"username": "${exec.alert.username}"} - Block IP: POST to
http://host.docker.internal:5000/block_ipwith body{"ip": "${exec.alert.source_ip}"}
Step 7: Audit Logging
Our Flask webhook already writes every containment action to audit.log. For full audit coverage, add a final HTTP node (or Shuffle’s built-in “Log” action) on every branch that POSTs a summary event — timestamp, alert fields, VT verdict, user-found flag, action taken — to a single logging endpoint. In production this would feed your SIEM or ticketing system.
Test the Full Playbook
Fire three test alerts that hit each branch:
# Branch 1: known user + malicious IP -> disable bob
curl -X POST http://localhost:5001/api/v1/hooks/YOUR_WORKFLOW_ID
-H "Content-Type: application/json"
-d '{"alert_name":"Suspicious admin login","source_ip":"185.220.101.5","username":"bob","severity":"high"}'
# Branch 2: unknown user + malicious IP -> block IP only
curl -X POST http://localhost:5001/api/v1/hooks/YOUR_WORKFLOW_ID
-H "Content-Type: application/json"
-d '{"alert_name":"Password spray","source_ip":"185.220.101.5","username":"ghost","severity":"high"}'
# Branch 3: clean IP -> log only
curl -X POST http://localhost:5001/api/v1/hooks/YOUR_WORKFLOW_ID
-H "Content-Type: application/json"
-d '{"alert_name":"Failed login","source_ip":"8.8.8.8","username":"alice","severity":"low"}'
Expected results: the first two alerts trigger containment calls (check the Flask console for [CONTAIN] Disabling user: ... and [CONTAIN] Blocking IP: ...), and the third produces no containment action. Inspect the audit log:
cat audit.log
# {"ts": "...", "action": "disable_user", "payload": {"username": "bob"}}
# {"ts": "...", "action": "block_ip", "payload": {"ip": "185.220.101.5"}}
Note: 185.220.101.5 is a known Tor exit node, so VirusTotal will reliably flag it malicious — perfect for reproducible lab tests. If the free-tier API rate limit bites (HTTP 429), wait a minute between test runs.
Playbook JSON Export
Export your workflow (Workflows → your workflow → three-dot menu → Download), or use this skeleton as a starting point and import it via Workflows → Import. Adjust the workflow ID, API keys, and host addresses after import:
{
"name": "Alert Enrichment and Containment",
"description": "Receives alert webhook, enriches IP via VirusTotal, checks user in CSV, contains via webhook, logs audit trail",
"workflow_id": "REPLACE_WITH_YOUR_WORKFLOW_ID",
"triggers": [
{
"id": "webhook_trigger",
"type": "WEBHOOK",
"status": "running",
"name": "Alert intake"
}
],
"actions": [
{
"id": "parse_alert",
"app_name": "shuffle-tools",
"app_version": "1.4.0",
"name": "Parse alert fields",
"parameters": [
{"name": "input", "value": "${exec}", "type": "text"}
]
},
{
"id": "vt_lookup",
"app_name": "virustotal",
"app_version": "1.2.0",
"name": "Enrich IP with VirusTotal",
"authentication": ["vt-key"],
"parameters": [
{"name": "ip_address", "value": "${exec.alert.source_ip}", "type": "text"}
]
},
{
"id": "csv_lookup",
"app_name": "http",
"app_version": "1.0.0",
"name": "Fetch CSV asset list",
"parameters": [
{"name": "url", "value": "http://host.docker.internal:8000/users.csv", "type": "url"},
{"name": "method", "value": "GET", "type": "select"}
]
},
{
"id": "decision_gate",
"app_name": "shuffle-tools",
"name": "Evaluate: malicious IP + known user?",
"type": "condition",
"conditions": [
{
"id": "known_user_malicious_ip",
"source": "${vt_lookup}",
"condition": "gt",
"value": "3"
},
{
"id": "unknown_user",
"source": "${csv_lookup}",
"condition": "!contains",
"value": "${exec.alert.username}"
}
]
},
{
"id": "disable_user",
"app_name": "http",
"name": "Contain: disable user",
"branch": "known_user_malicious_ip",
"parameters": [
{"name": "url", "value": "http://host.docker.internal:5000/disable_user", "type": "url"},
{"name": "method", "value": "POST", "type": "select"},
{"name": "body", "value": "{"username": "${exec.alert.username}"}", "type": "text"}
]
},
{
"id": "block_ip",
"app_name": "http",
"name": "Contain: block IP",
"branch": "unknown_user",
"parameters": [
{"name": "url", "value": "http://host.docker.internal:5000/block_ip", "type": "url"},
{"name": "method", "value": "POST", "type": "select"},
{"name": "body", "value": "{"ip": "${exec.alert.source_ip}"}", "type": "text"}
]
},
{
"id": "audit_log",
"app_name": "shuffle-tools",
"name": "Audit: log outcome",
"branches": ["known_user_malicious_ip", "unknown_user", "no_action"],
"parameters": [
{"name": "input", "value": "ts=${exec.timestamp} alert=${exec.alert.alert_name} ip=${exec.alert.source_ip} vt_malicious=${vt_lookup.data.attributes.last_analysis_stats.malicious} action=${containment_action}", "type": "text"}
]
}
],
"branches": [
{"source": "webhook_trigger", "destination": "parse_alert"},
{"source": "parse_alert", "destination": "vt_lookup"},
{"source": "
Related reading
Keep going — the structured wayThis post is one step. The learning paths chain the next ones for you, with progress tracking and no account needed.Follow a learning path →🧰 Lab filesworking files from this lab — copy or download#!/usr/bin/env bash
set -euo pipefail
# --- Install Shuffle (Docker Compose stack) ---
git clone https://github.com/Shuffle/Shuffle.git
cd Shuffle
docker compose up -d
# Wait ~1 minute, then verify all six containers are Up:
docker compose ps
# Frontend available at http://localhost:3001
cd ~
# --- Create lab directory and CSV asset list ---
mkdir -p ~/shuffle-lab && cd ~/shuffle-lab
cat > users.csv <<'EOF'
username,department,privileged
alice,finance,no
bob,it,yes
mallory,marketing,no
svc_backup,it,yes
EOF
# Serve the CSV so the playbook can fetch it
python3 -m http.server 8000 --directory . &
# Verify:
curl http://localhost:8000/users.csv
# --- Containment webhook listener (fake EDR/IdP API) ---
cat > contain.py <<'EOF'
from flask import Flask, request, jsonify
import json, datetime
app = Flask(__name__)
AUDIT_LOG = "audit.log"
def audit(action, data):
ts = datetime.datetime.utcnow().isoformat()
with open(AUDIT_LOG, "a") as f:
f.write(json.dumps({"ts": ts, "action": action, "payload": data}) + "\n")
@app.route("/disable_user", methods=["POST"])
def disable_user():
body = request.get_json(force=True)
print(f"[CONTAIN] Disabling user: {body}")
audit("disable_user", body)
return jsonify({"status": "success", "action": "disable_user", "user": body.get("username")})
@app.route("/block_ip", methods=["POST"])
def block_ip():
body = request.get_json(force=True)
print(f"[CONTAIN] Blocking IP: {body}")
audit("block_ip", body)
return jsonify({"status": "success", "action": "block_ip", "ip": body.get("ip")})
if __name__ == "__main__":
app.run(host="0.0.0.0", port=5000)
EOF
pip install flask
python3 contain.py &
echo "Lab ready: Shuffle UI :3001, users.csv :8000, containment webhook :5000"
Installs Shuffle via Docker, creates users.csv asset list, and starts the Flask containment webhook server.
Check your understanding
1. Why does the article recommend Shuffle over commercial SOAR platforms for a lab?
2. In the lab playbook, what is the purpose of the CSV asset list?
3. Why is the containment webhook (contain.py) faked in the lab instead of calling real systems?
4. Which decision logic does the completed playbook apply after enrichment and the user lookup?
Your answers stay in this browser only.

