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
- 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"
}
}
1---2name: implementing-soar-playbook-for-phishing3description: Automates phishing incident response by calling the Splunk4version: '1.0'5author: mahipal (vendored by SOCIS)6license: Apache-2.07platforms:8- linux9- macos10- windows11category: security12metadata:13 socis:14 tags:15 - soar16 - splunk-phantom17 - phishing18 - incident-response19 subdomain: security-operations20 upstream: mukul975/Anthropic-Cybersecurity-Skills21 nist_csf:22 - DE.CM-0123 - RS.MA-0124 - GV.OV-0125 - DE.AE-0226 mitre_attack:27 - T107828 - T119029 - T105930 - T156631 - T159832 mitre_f3:33 version: '1.1'34 tactics:35 - reconnaissance36 - resource-development37 - initial-access38 - stealth39 techniques:40 - id: T159841 name: Phishing for Information42 tactic: reconnaissance43 source: https://skillmd.com/skills/socisio/implementing-soar-playbook-for-phishing44 - id: T166045 name: Phishing46 tactic: initial-access47 source: attack48 - id: T167249 name: Email Spoofing50 tactic: stealth51 source: attack52 - id: F1020.00253 name: 'Create Fake Materials: Fake Website'54 tactic: resource-development55 source: f356 - id: F103257 name: Impersonate Official58 tactic: initial-access59 source: f360---61626364# Implementing SOAR Playbook for Phishing6566## Overview6768This 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.6970Splunk 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.717273## When to Use7475- When deploying or configuring implementing soar playbook for phishing capabilities in your environment76- When establishing security controls aligned to compliance requirements77- When building or improving security architecture for this domain78- When conducting security assessments that require this implementation7980## Prerequisites8182- Python 3.9 or later with `requests` and `email` modules83- Splunk SOAR instance (Cloud or On-Premises) with REST API access84- SOAR API token with permissions to create containers and trigger playbooks85- Network connectivity to SOAR instance on port 44386- A configured phishing investigation playbook in SOAR8788## Steps89901. **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.91922. **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.93943. **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.95964. **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.97985. **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.991006. **Trigger the playbook**: POST to `/rest/playbook_run` with the playbook ID or name and the container ID. This initiates the automated investigation workflow.1011027. **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).1031048. **Compile response report**: Aggregate playbook action results into a summary report with verdicts from URL reputation, domain reputation, IP geolocation, and email header analysis.105106## Expected Output107108```json109{110 "incident": {111 "container_id": 1542,112 "status": "new",113 "severity": "high",114 "artifacts_created": 5115 },116 "playbook": {117 "name": "phishing_investigate",118 "run_id": 892,119 "status": "success",120 "actions_completed": 8121 },122 "verdict": "malicious",123 "indicators": {124 "sender_domain_reputation": "malicious",125 "urls_flagged": 2,126 "spf_result": "fail",127 "dkim_result": "fail"128 }129}130```