L’interface est localisée ; les présentations et documents des Skills sont traduits automatiquement par IA dans votre langue. Le code, les commandes, chemins et termes techniques restent en version originale, et le document de l’auteur fait foi.
Explorer les Skills
Productivité · SKILL.md

implementing-soar-playbook-with-palo-alto-xsoar

implementing-soar-playbook-with-palo-alto-xsoar

在 Cortex XSOAR 中实施自动化事件响应剧本,跨 SOC 工具编排安全工作流并缩短手动响应时间。

Independent GitHub snapshot · Automated classification · Original documentation governs

Documentation de la Skill

GitHub

name: implementing-soar-playbook-with-palo-alto-xsoar description: 在 Cortex XSOAR 中实施自动化事件响应剧本,跨 SOC 工具编排安全工作流并缩短手动响应时间。 domain: cybersecurity subdomain: soc-operations tags: [xsoar, soar, palo-alto, playbook, automation, incident-response, orchestration, cortex] version: "1.0" author: mahipal license: Apache-2.0

使用 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:定义事件类型

incident_type: 钓鱼攻击
playbook: 钓鱼调查 - 完整版
severity_mapping:
  - condition: 邮件包含可执行附件
    severity: high
  - condition: 外部域名邮件含链接
    severity: medium
  - condition: 用户上报邮件
    severity: low
layout: 钓鱼布局
sla: 60 分钟

步骤 2:剧本 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 自动化脚本示例

# 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 后改善幅度
钓鱼 MTTR45 分钟5 分钟降低 89%
恶意软件 MTTR60 分钟8 分钟降低 87%
账户入侵 MTTR30 分钟4 分钟降低 87%
每班处理告警量50 条200+ 条提升 300%
误报处理时间10 分钟30 秒降低 95%

参考资料

Skills enregistrées