tsh-mzz/SOAR_Playbook_Automation

GitHub: tsh-mzz/SOAR_Playbook_Automation

一款基于 Shuffle 的 SOAR 自动化剧本,解决安全告警重复分诊与多工具协同问题。

Stars: 0 | Forks: 0

# SOAR 剧本自动化 ![Python](https://img.shields.io/badge/Python-3.10+-blue?style=flat-square&logo=python) ![Shuffle](https://img.shields.io/badge/SOAR-Shuffle-orange?style=flat-square) ![VirusTotal](https://img-shields.io/badge/API-VirusTotal-blue?style=flat-square) ![Slack](https://img-shields.io/badge/Alerts-Slack-4A154B?style=flat-square&logo=slack) ## 概述 安全运营团队在重复性告警分诊上花费大量时间。本项目自动化了整个流程: | 步骤 | 操作 | 工具 | | ---- | ---- | ---- | | 1 | 通过 Webhook 接收告警 | Shuffle | | 2 | 丰富可疑 IP 信息 | VirusTotal API v3 | | 3 | 分类严重程度(HIGH / MEDIUM / LOW) | Python | | 4 | 自动创建事件工单 | TheHive / Jira | | 5 | 通知 SOC 团队 | Slack Webhook | ## 架构 ``` Alert Source (SIEM / Detection Rule) | v +-----------------+ | Shuffle SOAR | <- Webhook Trigger +--------+--------+ | +--------v--------+ | VirusTotal API | <- IP Enrichment +--------+--------+ | +--------+--------+--------+ | | | v v v TheHive Slack HIGH Slack MEDIUM/LOW (malicious (malicious > 4) (malicious 0-4 / 0) > 0) ``` ## 技术栈 | 组件 | 技术 | | ---- | ---- | | SOAR 平台 | [Shuffle](https://shuffler.io) | | IP 丰富 | [VirusTotal API v3](https://developers.virustotal.com/) | | 工单 | TheHive / Jira | | 通知 | Slack 接收式 Webhook | | 脚本 | Python 3.10+ | ## 项目结构 ``` SOAR_playbook/ ├── playbooks/ │ └── alert_triage.json # Shuffle workflow (import-ready) ├── scripts/ │ ├── enrich_ip.py # VirusTotal IP lookup + severity classification │ ├── create_ticket.py # Incident ticket auto-creation (TheHive v4) │ └── notify_slack.py # Slack webhook notification (I did notification in Shuffle UI) ├── config/ │ └── config.example.yaml # Credentials template (no secrets) ├── requirements.txt └── README.md ``` ## 快速开始 **1. 克隆并安装** ``` git clone https://github.com/tsh-mzz/SOAR_playbook.git cd SOAR_playbook python3 -m venv venv && source venv/bin/activate pip install -r requirements.txt ``` **2. 配置凭据** ``` cp config/config.example.yaml config/config.yaml # 添加您的 VirusTotal API 密钥和 Slack Webhook URL ``` **3. 测试 IP 丰富** ``` python3 scripts/enrich_ip.py 45.33.32.156 ``` 预期输出: ``` { "ip": "45.33.32.156", "malicious": 4, "suspicious": 1, "harmless": 54, "severity": "MEDIUM" } ``` **4. 设置 TheHive** ``` docker run -d --name thehive -p 9000:9000 strangebee/thehive:5.2 ``` - 打开 `http://localhost:9000` - 创建组织(例如 `SOC`) - 创建具有 `org-admin` 角色的用户 - 生成 API 密钥并将其添加到 `config/config.yaml` 测试创建工单: ``` python3 scripts/create_ticket.py ``` **5. 导入工作流到 Shuffle** - 打开 Shuffle → 工作流 → 导入 - 上传 `playbooks/alert_triage.json` - 配置 VirusTotal API 密钥、TheHive API 密钥和 Slack 接收式 Webhook URL - 启动工作流 **6. 触发测试告警** ``` curl -X POST \ -H "Content-Type: application/json" \ -d '{"ip": "45.33.32.156"}' ``` Slack 输出(MEDIUM 严重程度): ``` 🟡 MEDIUM SEVERITY ALERT IP: 45.33.32.156 Malicious: 4 Suspicious: 1 Verdict: MEDIUM - Investigation recommended ``` TheHive:会自动创建一个包含严重程度、标签和 VirusTotal 摘要的事件。 ## 严重性分类 | 恶意投票数 | 判定 | | ---------- | ---- | | 5 或更多 | HIGH | | 1 到 4,或可疑 3 个或更多 | MEDIUM | | 0 | LOW |
标签:API集成, Ask搜索, CIDR查询, FTP漏洞扫描, Incident Response, IP信誉, IP查询, Python, Shuffle, Slack告警, SOAR, TheHive, Ticketing, VirusTotal, Webhook触发, 可观测性, 告警流水线, 威胁情报, 安全事件票, 安全编排, 安全运营, 富上下文, 开发者工具, 扫描框架, 无后门, 网络威胁, 自动化响应, 逆向工具