Agent skill
implementing-soar-playbook-for-phishing
Automate phishing incident response using Splunk SOAR REST API to create containers, add artifacts, and trigger playbooks
Install this agent skill to your Project
npx add-skill https://github.com/autohandai/community-skills/tree/main/implementing-soar-playbook-for-phishing
SKILL.md
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.
Prerequisites
- Python 3.9 or later with
requestsandemailmodules - 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-tokenheader to authenticate all REST API requests to the SOAR instance. -
Create a container: POST to
/rest/containerwith 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/artifactwithcontainer_idand CEF (Common Event Format) fields containing sender address (fromAddress), recipient (toAddress), subject, originating IP (sourceAddress), and Message-ID. Setrun_automationto False for all but the last artifact. -
Add URL artifacts: For each URL extracted from the email body, create an artifact with CEF field
requestURLand typeurl. These artifacts feed into URL reputation checks in the playbook. -
Trigger the playbook: POST to
/rest/playbook_runwith the playbook ID or name and the container ID. This initiates the automated investigation workflow. -
Poll action results: GET
/rest/action_runfiltered 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"
}
}
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
mapping-mitre-attack-techniques
Maps observed adversary behaviors, security alerts, and detection rules to MITRE ATT&CK techniques and sub-techniques to quantify detection coverage and guide control prioritization. Use when building an ATT&CK-based coverage heatmap, tagging SIEM alerts with technique IDs, aligning security controls to adversary playbooks, or reporting threat exposure to executives. Activates for requests involving ATT&CK Navigator, Sigma rules, MITRE D3FEND, or coverage gap analysis.
hunting-for-spearphishing-indicators
Hunt for spearphishing campaign indicators across email logs, endpoint telemetry, and network data to detect targeted email attacks.
analyzing-malicious-url-with-urlscan
URLScan.io is a free service for scanning and analyzing suspicious URLs. It captures screenshots, DOM content, HTTP transactions, JavaScript behavior, and network connections of web pages in an isolat
implementing-zero-standing-privilege-with-cyberark
Deploy CyberArk Secure Cloud Access to eliminate standing privileges in hybrid and multi-cloud environments using just-in-time access with time, entitlement, and approval controls.
implementing-pam-for-database-access
Deploy privileged access management for database systems including Oracle, SQL Server, PostgreSQL, and MySQL. Covers session proxy configuration, credential vaulting, query auditing, dynamic credentia
detecting-t1003-credential-dumping-with-edr
Detect OS credential dumping techniques targeting LSASS memory, SAM database, NTDS.dit, and cached credentials using EDR telemetry, Sysmon process access monitoring, and Windows security event correlation.
Didn't find tool you were looking for?