implementing-soar-playbook-with-palo-alto-xsoar
在 Cortex XSOAR 中实施自动化事件响应剧本,跨 SOC 工具编排安全工作流并缩短手动响应时间。
Best use case
implementing-soar-playbook-with-palo-alto-xsoar is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
在 Cortex XSOAR 中实施自动化事件响应剧本,跨 SOC 工具编排安全工作流并缩短手动响应时间。
Teams using implementing-soar-playbook-with-palo-alto-xsoar should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/implementing-soar-playbook-with-palo-alto-xsoar/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How implementing-soar-playbook-with-palo-alto-xsoar Compares
| Feature / Agent | implementing-soar-playbook-with-palo-alto-xsoar | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
在 Cortex XSOAR 中实施自动化事件响应剧本,跨 SOC 工具编排安全工作流并缩短手动响应时间。
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# 使用 Palo Alto XSOAR 实施 SOAR 剧本
## 概述
Cortex XSOAR(原 Demisto)是 Palo Alto Networks 的安全编排(Security Orchestration)、自动化和响应平台。剧本是 XSOAR 的核心自动化引擎,使 SOC 团队能够自动化重复性的事件响应任务。XSOAR 提供 900+ 预建集成包、87 个通用剧本和可视化拖拽编辑器用于构建自定义工作流。使用 SOAR 自动化的组织平均将平均响应时间(MTTR)缩短 80%。
## 前置条件
- 已部署 Cortex XSOAR(8.x 版本或更高,或 XSOAR 托管版)
- 剧本创建的管理员权限
- 已为相关安全工具安装集成包
- 已配置事件类型和布局
- 外部工具的 API 访问(SIEM、EDR、TI 平台、工单系统)
## 剧本架构
### XSOAR 组件层级
```
事件类型(如:钓鱼攻击)
|
v
事件布局(UI 显示配置)
|
v
预处理规则(自动分类、去重)
|
v
剧本(自动化逻辑)
|-- 子剧本(模块化可复用工作流)
|-- 任务(单个自动化步骤)
|-- 条件任务(决策分支)
|-- 脚本(自定义 Python/JavaScript)
|-- 集成(外部工具命令)
|
v
作战室(调查时间线)
|
v
结案报告
```
### 剧本任务类型
| 任务类型 | 用途 | 示例 |
|----------|------|------|
| 标准 | 执行命令 | `!ip ip=8.8.8.8` |
| 条件 | 分支逻辑 | 如果严重性 > 高,则升级 |
| 手动 | 需要分析师输入 | 批准遏制动作 |
| 章节标题 | 组织工作流 | "富化阶段" |
| 数据收集 | 收集外部数据 | 询问用户更多详情 |
| 计时器 | 等待条件/时间 | 等待 5 分钟然后检查 |
## 构建钓鱼响应剧本
### 步骤 1:定义事件类型
```yaml
incident_type: 钓鱼攻击
playbook: 钓鱼调查 - 完整版
severity_mapping:
- condition: 邮件包含可执行附件
severity: high
- condition: 外部域名邮件含链接
severity: medium
- condition: 用户上报邮件
severity: low
layout: 钓鱼布局
sla: 60 分钟
```
### 步骤 2:剧本 YAML 结构
```yaml
id: phishing-investigation-full
version: -1
name: 钓鱼调查 - 完整版
description: 自动化钓鱼邮件调查,包含富化、分析和响应
starttaskid: "0"
tasks:
"0":
id: "0"
taskid: start
type: start
nexttasks:
'#none#':
- "1"
"1":
id: "1"
taskid: extract-indicators
type: regular
task:
name: 从邮件提取指标
script: ParseEmailFiles
nexttasks:
'#none#':
- "2"
- "3"
- "4"
"2":
id: "2"
taskid: enrich-urls
type: playbook
task:
name: URL 富化
playbookName: URL Enrichment - Generic v2
"3":
id: "3"
taskid: enrich-files
type: playbook
task:
name: 文件富化
playbookName: File Enrichment - Generic v2
"4":
id: "4"
taskid: enrich-ips
type: playbook
task:
name: IP 富化
playbookName: IP Enrichment - Generic v2
"5":
id: "5"
taskid: determine-verdict
type: condition
task:
name: 邮件是否为恶意?
conditions:
- label: "yes"
condition:
- - operator: isEqualString
left: DBotScore.Score
right: "3"
- label: "no"
nexttasks:
"yes":
- "6"
"no":
- "9"
"6":
id: "6"
taskid: block-sender
type: regular
task:
name: 封锁发件人域名
script: '|||o365-mail-block-sender'
scriptarguments:
sender_address: ${incident.emailfrom}
"7":
id: "7"
taskid: search-mailboxes
type: regular
task:
name: 搜索并从所有邮箱删除
script: '|||o365-mail-purge-compliance-search'
scriptarguments:
query: "from:${incident.emailfrom} subject:${incident.emailsubject}"
"8":
id: "8"
taskid: notify-user
type: regular
task:
name: 通知上报用户
script: '|||send-mail'
scriptarguments:
to: ${incident.reporter}
subject: "钓鱼报告已确认 - 已采取措施"
body: "您上报的邮件已被确认为恶意邮件并已删除。"
"9":
id: "9"
taskid: close-incident
type: regular
task:
name: 关闭事件
script: closeInvestigation
```
### 步骤 3:集成命令
#### 邮件分析
```
!ParseEmailFiles entryid=${File.EntryID}
!rasterize url=${URL.Data} type=png
```
#### 威胁情报富化
```
!url url=${URL.Data}
!file file=${File.SHA256}
!ip ip=${IP.Address}
!domain domain=${Domain.Name}
```
#### 遏制动作
```
!o365-mail-block-sender sender=${incident.emailfrom}
!o365-mail-purge-compliance-search query="from:${incident.emailfrom}"
!pan-os-block-ip ip=${IP.Address} log_forwarding="default"
!cortex-xdr-isolate-endpoint endpoint_id=${Endpoint.ID}
```
#### 工单集成
```
!jira-create-issue summary="钓鱼事件 - ${incident.id}" type="Incident" priority="High"
!servicenow-create-ticket short_description="安全事件" urgency="2"
```
## 常见 SOC 剧本模板
### 1. 恶意软件调查剧本
```
触发条件:来自 EDR 的恶意软件告警
步骤:
1. 提取文件哈希、进程详情、主机信息
2. 通过 VirusTotal、Hybrid Analysis 富化哈希
3. 检查文件是否在白名单中
4. 如果恶意:
a. 通过 EDR 隔离端点
b. 在所有端点封锁哈希
c. 跨环境搜索该哈希
d. 创建事件工单
5. 如果干净:关闭为误报
```
### 2. 账户入侵剧本
```
触发条件:不可能的旅行或可疑登录告警
步骤:
1. 从 Active Directory 获取用户详情
2. 获取过去 30 天的登录历史
3. 检查不可能的旅行(地理距离与时间比较)
4. 检查是否为已知 VPN/代理 IP
5. 如果已入侵:
a. 禁用 AD 账户
b. 撤销所有 OAuth Token
c. 重置 MFA
d. 通知用户经理
e. 搜索横向移动迹象
6. 如果误报:记录并关闭
```
### 3. DDoS 缓解剧本
```
触发条件:网络异常告警
步骤:
1. 从网络监控确认流量突增
2. 识别源 IP 和地理位置
3. 检查源 IP 是否为已知僵尸网络
4. 在 WAF 上实施速率限制
5. 如果持续攻击:
a. 启用上游 DDoS 防护
b. 激活 CDN 清洗
c. 如有必要通知 ISP
6. 监控并记录
```
## 自定义 XSOAR 脚本
### Python 自动化脚本示例
```python
# XSOAR 自动化脚本:CalculateRiskScore
def calculate_risk_score():
"""为事件计算综合风险分数。"""
severity = demisto.incident().get('severity', 0)
indicator_count = len(demisto.get(demisto.context(), 'DBotScore', []))
malicious_count = len([
i for i in demisto.get(demisto.context(), 'DBotScore', [])
if i.get('Score', 0) == 3
])
base_score = severity * 20
indicator_boost = min(indicator_count * 5, 25)
malicious_boost = malicious_count * 15
risk_score = min(100, base_score + indicator_boost + malicious_boost)
return_results(CommandResults(
outputs_prefix='RiskScore',
outputs={'Score': risk_score, 'Level': '严重' if risk_score > 80 else '高' if risk_score > 60 else '中'},
readable_output=f'风险分数:{risk_score}/100'
))
calculate_risk_score()
```
## 剧本性能指标
| 指标 | SOAR 前 | SOAR 后 | 改善幅度 |
|------|---------|---------|----------|
| 钓鱼 MTTR | 45 分钟 | 5 分钟 | 降低 89% |
| 恶意软件 MTTR | 60 分钟 | 8 分钟 | 降低 87% |
| 账户入侵 MTTR | 30 分钟 | 4 分钟 | 降低 87% |
| 每班处理告警量 | 50 条 | 200+ 条 | 提升 300% |
| 误报处理时间 | 10 分钟 | 30 秒 | 降低 95% |
## 参考资料
- [Cortex XSOAR 剧本概述](https://xsoar.pan.dev/docs/playbooks/playbooks-overview)
- [从零到流程再到 XSOAR 剧本](https://live.paloaltonetworks.com/t5/community-blogs/from-zero-to-process-to-xsoar-playbook/ba-p/564568)
- [XSOAR 通用剧本包](https://www.paloaltonetworks.com/blog/security-operations/playbook-of-the-week-xsoar-common-playbook/)
- [Cortex XSOAR 产品页面](https://www.paloaltonetworks.com/cortex/cortex-xsoar)Related Skills
triaging-security-incident-with-ir-playbook
使用结构化 IR Playbook 对安全事件进行分类和优先排序,确定严重性、分配响应团队并启动适当的响应程序。
implementing-zero-trust-with-hashicorp-boundary
使用 HashiCorp Boundary 实现具备动态凭据代理、会话录制和 Vault 集成的身份感知零信任基础设施访问管理。
implementing-zero-trust-with-beyondcorp
使用身份感知代理(IAP,Identity-Aware Proxy)、上下文感知访问策略、设备信任验证和 Access Context Manager,部署 Google BeyondCorp Enterprise 零信任访问控制,对 GCP 资源和内部应用强制执行基于身份和安全态势的访问。
implementing-zero-trust-network-access
通过配置身份感知代理、微分段、基于条件访问策略的持续验证,以及在 AWS、Azure 和 GCP 环境中以 BeyondCorp 风格的架构替代传统 VPN 访问,在云环境中实施零信任网络访问(ZTNA)。
implementing-zero-trust-network-access-with-zscaler
使用 Zscaler 实施零信任网络访问(Zero Trust Network Access,ZTNA),通过 Zscaler Private Access(ZPA)配置应用分段、访问策略和连接器,替代传统 VPN 架构
implementing-zero-trust-in-cloud
本技能指导组织按照 NIST SP 800-207 和 Google BeyondCorp 原则在云环境中实施零信任(Zero Trust)架构,涵盖以身份为中心的访问控制、微分段(Micro-Segmentation)、持续验证、设备信任评估,以及部署身份感知代理(Identity-Aware Proxy)以消除 AWS、Azure 和 GCP 环境中的隐式网络信任。
implementing-zero-trust-for-saas-applications
使用 CASB、SSPM、条件访问策略、OAuth 应用治理和会话控制,为 SaaS 应用实施零信任访问控制, 对云托管服务强制执行身份验证、设备合规性检查和数据保护。
implementing-zero-trust-dns-with-nextdns
将 NextDNS 实施为零信任 DNS 过滤层,提供加密解析、威胁情报阻断、隐私保护,以及跨所有端点的组织策略执行。
implementing-zero-standing-privilege-with-cyberark
部署 CyberArk Secure Cloud Access,通过基于时间、权限和审批控制的即时访问,在混合云和多云环境中消除常设权限。
implementing-zero-knowledge-proof-for-authentication
零知识证明(ZKP)允许证明者在不泄露秘密本身的情况下证明对某个秘密(如密码或私钥)的了解。本技能实现 Schnorr 身份识别协议和使用离散对数问题的简化 ZKPP,使服务器永远不需要获取用户密码即可完成认证。
implementing-web-application-logging-with-modsecurity
配置带有 OWASP 核心规则集(CRS)的 ModSecurity WAF,实现 Web 应用程序日志记录, 调整规则以减少误报,分析审计日志进行攻击检测,并为应用程序特定威胁实现自定义 SecRules。 分析师配置 SecRuleEngine、SecAuditEngine 和 CRS 偏执级别,以在安全覆盖范围和运营稳定性之间取得平衡。 适用于涉及 WAF 配置、ModSecurity 规则调整、Web 应用审计日志或 CRS 部署的场景。
implementing-vulnerability-sla-breach-alerting
为漏洞修复 SLA 违规构建自动化告警,包含基于严重程度的时间线、升级工作流和合规性报告仪表板。