Implementing SOAR Playbook for Phishing
Overview
This skill implements a phishing incident response workflow using the Splunk SOAR (formerly Phantom) REST API. When a suspected phishing email is reported, the agent parses email headers and body, creates a SOAR container representing the incident, attaches artifacts containing indicators of compromise (sender address, URLs, IP addresses, file hashes), triggers an automated investigation playbook, and polls for action results.
Splunk SOAR orchestrates and automates security operations through playbooks that chain together investigative and response actions. The REST API at /rest/container, /rest/artifact, and /rest/playbook_run enables programmatic incident creation and automation triggering from external tools, email gateways, and SIEM alerts.
When to Use
Trigger phrases:
"implementing soar playbook for phishing"
"Use when working with implementing soar playbook for phishing"
When deploying or configuring implementing soar playbook for phishing capabilities in your environment
When establishing security controls aligned to compliance requirements
When building or improving security architecture for this domain
When conducting security assessments that require this implementation
Prerequisites
- Python 3.9 or later with
requests and email modules
- Splunk SOAR instance (Cloud or On-Premises) with REST API access
- SOAR API token with permissions to create containers and trigger playbooks
- Network connectivity to SOAR instance on port 443
- A configured phishing investigation playbook in SOAR
Steps
Parse the phishing email: Read the email file (.eml format) and extract headers including From, To, Subject, Reply-To, Return-Path, Received, Message-ID, X-Mailer, and authentication results (SPF, DKIM, DMARC). Extract URLs and IP addresses from the email body.
Authenticate to SOAR REST API: Use the API token in the ph-auth-token header to authenticate all REST API requests to the SOAR instance.
Create a container: POST to /rest/container with the incident label, name, description, severity, and status. The container represents the phishing incident and receives a container ID in the response.
Add email header artifacts: POST to /rest/artifact with container_id and CEF (Common Event Format) fields containing sender address (fromAddress), recipient (toAddress), subject, originating IP (sourceAddress), and Message-ID. Set run_automation to False for all but the last artifact.
Add URL artifacts: For each URL extracted from the email body, create an artifact with CEF field requestURL and type url. These artifacts feed into URL reputation checks in the playbook.
Trigger the playbook: POST to /rest/playbook_run with the playbook ID or name and the container ID. This initiates the automated investigation workflow.
Poll action results: GET /rest/action_run filtered by container ID to monitor playbook progress. Poll until all actions reach a terminal state (success, failed, or cancelled).
Compile response report: Aggregate playbook action results into a summary report with verdicts from URL reputation, domain reputation, IP geolocation, and email header analysis.
Expected Output
{
"incident": {
"container_id": 1542,
"status": "new",
"severity": "high",
"artifacts_created": 5
},
"playbook": {
"name": "phishing_investigate",
"run_id": 892,
"status": "success",
"actions_completed": 8
},
"verdict": "malicious",
"indicators": {
"sender_domain_reputation": "malicious",
"urls_flagged": 2,
"spf_result": "fail",
"dkim_result": "fail"
}
}
When NOT to Use
- You need to test the implementation (use performing-* skills)
- Task is about configuring existing tools (use configuring-* skills)
- You need to analyze security events (use analyzing-* skills)
- Task is about building detection rules (use building-* skills)
- You don't have access to the target environment
- Task requires vendor-specific expertise (consult vendor docs)
Red Flags
- Performing actions without explicit written authorization from the asset owner
- Testing against production systems without a defined scope and rules of engagement
- Modifying cloud IAM policies or security groups without approval
- Exposing cloud credentials or secrets in logs or reports
- Running scans that generate excessive API calls and trigger billing alerts
Process
- Reconnaissance — Gather target information, identify attack surface, enumerate services
- Analysis/Exploitation — Execute the technique, analyze results, document findings
- Reporting — Document IOCs, write findings, provide remediation recommendations
Verification
- All steps executed successfully against a test environment before production use
- Output documented with screenshots or logs demonstrating expected behavior
- Cloud resource changes reverted or documented as intentional
- IAM policies reviewed for least-privilege compliance after testing
- No residual test resources left running (cost and security check)
Anti-Rationalization Table
| Rationalization |
Reality |
| "We are too small to be targeted" |
Automated attacks target everyone. Size does not matter. |
| "Security slows us down" |
A breach slows you down 100x more. Build security in from the start. |
| "We will fix it after launch" |
Vulnerabilities in production are exploited within hours. Fix before deploy. |
1---2name: implementing-soar-playbook-for-phishing3description: Use when automating phishing incident response using Splunk SOAR REST4 API to create containers, add artifacts, and trigger playbooks5domain: cybersecurity6subdomain: security-operations7tags:8- soar9- splunk-phantom10- phishing11- incident-response12version: '1.0'13author: oyi7714license: Apache-2.015nist_csf:16- DE.CM-0117- RS.MA-0118- GV.OV-0119- DE.AE-0220category: cybersecurity21metadata:22 source: https://skillmd.com/skills/oyi77/implementing-soar-playbook-for-phishing23---24252627# Implementing SOAR Playbook for Phishing2829## Overview3031This skill implements a phishing incident response workflow using the Splunk SOAR (formerly Phantom) REST API. When a suspected phishing email is reported, the agent parses email headers and body, creates a SOAR container representing the incident, attaches artifacts containing indicators of compromise (sender address, URLs, IP addresses, file hashes), triggers an automated investigation playbook, and polls for action results.3233Splunk SOAR orchestrates and automates security operations through playbooks that chain together investigative and response actions. The REST API at `/rest/container`, `/rest/artifact`, and `/rest/playbook_run` enables programmatic incident creation and automation triggering from external tools, email gateways, and SIEM alerts.343536## When to Use3738**Trigger phrases:**39- "implementing soar playbook for phishing"40- "Use when working with implementing soar playbook for phishing"414243- When deploying or configuring implementing soar playbook for phishing capabilities in your environment44- When establishing security controls aligned to compliance requirements45- When building or improving security architecture for this domain46- When conducting security assessments that require this implementation4748## Prerequisites4950- Python 3.9 or later with `requests` and `email` modules51- Splunk SOAR instance (Cloud or On-Premises) with REST API access52- SOAR API token with permissions to create containers and trigger playbooks53- Network connectivity to SOAR instance on port 44354- A configured phishing investigation playbook in SOAR5556## Steps57581. **Parse the phishing email**: Read the email file (.eml format) and extract headers including From, To, Subject, Reply-To, Return-Path, Received, Message-ID, X-Mailer, and authentication results (SPF, DKIM, DMARC). Extract URLs and IP addresses from the email body.59602. **Authenticate to SOAR REST API**: Use the API token in the `ph-auth-token` header to authenticate all REST API requests to the SOAR instance.61623. **Create a container**: POST to `/rest/container` with the incident label, name, description, severity, and status. The container represents the phishing incident and receives a container ID in the response.63644. **Add email header artifacts**: POST to `/rest/artifact` with `container_id` and CEF (Common Event Format) fields containing sender address (`fromAddress`), recipient (`toAddress`), subject, originating IP (`sourceAddress`), and Message-ID. Set `run_automation` to False for all but the last artifact.65665. **Add URL artifacts**: For each URL extracted from the email body, create an artifact with CEF field `requestURL` and type `url`. These artifacts feed into URL reputation checks in the playbook.67686. **Trigger the playbook**: POST to `/rest/playbook_run` with the playbook ID or name and the container ID. This initiates the automated investigation workflow.69707. **Poll action results**: GET `/rest/action_run` filtered by container ID to monitor playbook progress. Poll until all actions reach a terminal state (success, failed, or cancelled).71728. **Compile response report**: Aggregate playbook action results into a summary report with verdicts from URL reputation, domain reputation, IP geolocation, and email header analysis.7374## Expected Output7576```json77{78 "incident": {79 "container_id": 1542,80 "status": "new",81 "severity": "high",82 "artifacts_created": 583 },84 "playbook": {85 "name": "phishing_investigate",86 "run_id": 892,87 "status": "success",88 "actions_completed": 889 },90 "verdict": "malicious",91 "indicators": {92 "sender_domain_reputation": "malicious",93 "urls_flagged": 2,94 "spf_result": "fail",95 "dkim_result": "fail"96 }97}98```99## When NOT to Use100101- You need to test the implementation (use performing-* skills)102- Task is about configuring existing tools (use configuring-* skills)103- You need to analyze security events (use analyzing-* skills)104- Task is about building detection rules (use building-* skills)105- You don't have access to the target environment106- Task requires vendor-specific expertise (consult vendor docs)107108109## Red Flags110111- Performing actions without explicit written authorization from the asset owner112- Testing against production systems without a defined scope and rules of engagement113- Modifying cloud IAM policies or security groups without approval114- Exposing cloud credentials or secrets in logs or reports115- Running scans that generate excessive API calls and trigger billing alerts116117## Process1181191. **Reconnaissance** — Gather target information, identify attack surface, enumerate services1201. **Analysis/Exploitation** — Execute the technique, analyze results, document findings1211. **Reporting** — Document IOCs, write findings, provide remediation recommendations122123## Verification124125- All steps executed successfully against a test environment before production use126- Output documented with screenshots or logs demonstrating expected behavior127- Cloud resource changes reverted or documented as intentional128- IAM policies reviewed for least-privilege compliance after testing129- No residual test resources left running (cost and security check)130131## Anti-Rationalization Table132133| Rationalization | Reality |134|---|---|135| "We are too small to be targeted" | Automated attacks target everyone. Size does not matter. |136| "Security slows us down" | A breach slows you down 100x more. Build security in from the start. |137| "We will fix it after launch" | Vulnerabilities in production are exploited within hours. Fix before deploy. |