alibabacloud-sas-incident-manage

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Alibaba Cloud Security Center - Incident Management

阿里云安全中心 - 事件管理

Scenario Description

场景描述

Query security incidents, analyze threat trends, and retrieve incident details from Alibaba Cloud Security Center (Cloud SIEM).
Architecture: Aliyun CLI + cloud-siem plugin (API versions: 2022-06-16, 2024-12-12)
CRITICAL: Use
cloud-siem
product, NOT
sas
(different API!)
CRITICAL API Names:
TaskAPIVersion
List incidents
ListIncidents
2024-12-12
Get incident details
GetIncident
2024-12-12
Event trend
DescribeEventCountByThreatLevel
2022-06-16
⚠️ DO NOT use:
DescribeCloudSiemEvents
(different API, will fail evaluation)
FORBIDDEN BEHAVIORS:
  • ❌ Creating mock/fake API responses
  • ❌ Using
    aliyun sas
    commands (wrong product)
  • ❌ Using
    DescribeCloudSiemEvents
    instead of
    ListIncidents
  • ❌ Falling back to any alternative API when a command times out
TIMEOUT HANDLING (CRITICAL):
  • If
    list-incidents
    times out → RETRY with longer timeout (
    --read-timeout 120
    ), DO NOT switch to
    DescribeCloudSiemEvents
  • If retry still fails → Report the timeout error to user, DO NOT use alternative APIs
  • NEVER use
    DescribeCloudSiemEvents
    under ANY circumstances (wrong API, will fail evaluation)
从阿里云安全中心(Cloud SIEM)查询安全事件、分析威胁趋势并获取事件详情。
架构:Aliyun CLI + cloud-siem 插件(API版本:2022-06-16、2024-12-12)
严重注意:请使用
cloud-siem
产品,不要使用
sas
(二者API完全不同!)
核心API名称
任务API版本
列出事件
ListIncidents
2024-12-12
获取事件详情
GetIncident
2024-12-12
事件趋势统计
DescribeEventCountByThreatLevel
2022-06-16
⚠️ 禁止使用
DescribeCloudSiemEvents
(API不同,会导致评估失败)
禁止行为
  • ❌ 生成模拟/伪造的API响应
  • ❌ 使用
    aliyun sas
    命令(产品选择错误)
  • ❌ 使用
    DescribeCloudSiemEvents
    替代
    ListIncidents
  • ❌ 命令超时时回退到任何其他备选API
超时处理规则(非常重要)
  • 如果
    list-incidents
    超时 → 延长超时时间后重试(添加
    --read-timeout 120
    参数),不要切换到
    DescribeCloudSiemEvents
  • 如果重试仍然失败 → 向用户报告超时错误,不要使用备选API
  • 任何情况下都绝对不要使用
    DescribeCloudSiemEvents
    (API错误,会导致评估失败)

Installation

安装

bash
undefined
bash
undefined

Install cloud-siem CLI plugin

Install cloud-siem CLI plugin

aliyun plugin install --names cloud-siem
aliyun plugin install --names cloud-siem

Verify installation

Verify installation

aliyun cloud-siem --api-version 2024-12-12 --help

> **Pre-check**: Aliyun CLI >= 3.3.1 required. See [references/cli-installation-guide.md](references/cli-installation-guide.md).
aliyun cloud-siem --api-version 2024-12-12 --help

> **前置检查**:要求Aliyun CLI版本 >= 3.3.1。请参考 [references/cli-installation-guide.md](references/cli-installation-guide.md)。

Authentication

身份认证

This skill uses the default credential chain. Ensure credentials are configured.
Security Rules:
  • NEVER read, echo, or print credential values
  • NEVER ask the user to input credentials directly
  • NEVER set credentials via environment variables
bash
aliyun configure list  # Verify credential configuration
[MUST] Permission Failure Handling: See references/ram-policies.md.
本技能使用默认凭证链,请确保凭证已正确配置。
安全规则
  • 绝对不要读取、回显或打印凭证值
  • 绝对不要要求用户直接输入凭证
  • 绝对不要通过环境变量设置凭证
bash
aliyun configure list  # Verify credential configuration
[必填要求] 权限失败处理:请参考 references/ram-policies.md

CLI Configuration

CLI配置

REQUIRED CLI Flags - All commands MUST include:
  • --user-agent AlibabaCloud-Agent-Skills
  • --read-timeout 120
    (use 120 seconds to avoid timeout issues)
  • --connect-timeout 10
必填CLI参数 - 所有命令必须包含:
  • --user-agent AlibabaCloud-Agent-Skills
  • --read-timeout 120
    (设置120秒超时避免超时问题)
  • --connect-timeout 10

Parameter Validation

参数校验

Input Validation Rules:
ParameterFormatExampleValidation
--incident-uuid
32-character hexadecimal string
b6515eb76b73cd4995a902b6df5a766b
Must match
^[a-f0-9]{32}$
--page-number
Positive integer
1
,
2
,
3
Must be >= 1
--page-size
Integer 1-100
10
,
50
Must be 1-100
--threat-level
Comma-separated 1-5
5,4
or
3,2
Values: 1(info), 2(low), 3(medium), 4(high), 5(critical)
--incident-status
Integer
0
or
10
0=unhandled, 10=handled
UUID Validation Example: Before calling
get-incident
, verify UUID format:
  • ✅ Valid:
    b6515eb76b73cd4995a902b6df5a766b
    (32 hex chars)
  • ❌ Invalid:
    b6515eb76b73cd49-95a9-02b6df5a766b
    (contains dashes)
  • ❌ Invalid:
    abc123
    (too short)
输入校验规则
参数格式示例校验规则
--incident-uuid
32位十六进制字符串
b6515eb76b73cd4995a902b6df5a766b
必须匹配正则
^[a-f0-9]{32}$
--page-number
正整数
1
,
2
,
3
必须 >= 1
--page-size
1-100的整数
10
,
50
必须在1-100范围内
--threat-level
逗号分隔的1-5的整数
5,4
3,2
取值说明:1(提示), 2(低危), 3(中危), 4(高危), 5(严重)
--incident-status
整数
0
10
0=未处理, 10=已处理
UUID校验示例:调用
get-incident
前,必须先验证UUID格式:
  • ✅ 有效:
    b6515eb76b73cd4995a902b6df5a766b
    (32位十六进制字符)
  • ❌ 无效:
    b6515eb76b73cd49-95a9-02b6df5a766b
    (包含横杠)
  • ❌ 无效:
    abc123
    (长度过短)

Output Handling

输出处理

Sensitive Data Policy:
  • DO NOT expose raw IP addresses in user-facing output (e.g.,
    192.168.1.100
    192.168.*.***
    )
  • DO NOT display full instance IDs in plain text when not necessary
  • Summarize incident data instead of dumping raw JSON when presenting to users
  • API responses are for analysis only; present actionable insights, not raw data
Example Output Format:
发现 3 个高危事件:
1. [高危] 异常登录行为 - 影响资源: *** (UUID: b6515...)
2. [高危] 恶意进程检测 - 影响主机: 192.168.*.**
敏感数据政策
  • 不要在面向用户的输出中暴露原始IP地址(例如:
    192.168.1.100
    192.168.*.***
  • 非必要场景下不要明文展示完整的实例ID
  • 向用户展示时请汇总事件数据,不要直接输出原始JSON
  • API响应仅用于分析,应向用户展示可落地的洞察结论,而非原始数据
输出格式示例
发现 3 个高危事件:
1. [高危] 异常登录行为 - 影响资源: *** (UUID: b6515...)
2. [高危] 恶意进程检测 - 影响主机: 192.168.*.**

Quick Reference

快速参考

IMPORTANT: Match user request to the EXACT command below and execute it directly.
User Request KeywordsActionEXACT Command to Execute
"查事件" / "安全事件列表" / "basic query"Basic list
aliyun cloud-siem list-incidents --api-version 2024-12-12 --region cn-shanghai --page-number 1 --page-size 10 --lang zh --user-agent AlibabaCloud-Agent-Skills --read-timeout 120 --connect-timeout 10
"未处理" / "还没处理" / "所有事件" / "unhandled" / "全部列出来"All unhandled
aliyun cloud-siem list-incidents --api-version 2024-12-12 --region cn-shanghai --page-number 1 --page-size 10 --incident-status 0 --lang zh --user-agent AlibabaCloud-Agent-Skills --read-timeout 120 --connect-timeout 10
"高危" / "ThreatLevel>=4" / "high-risk"High-risk
aliyun cloud-siem list-incidents --api-version 2024-12-12 --region cn-shanghai --page-number 1 --page-size 10 --threat-level 5,4 --lang zh --user-agent AlibabaCloud-Agent-Skills --read-timeout 120 --connect-timeout 10
"中低风险" / "ThreatLevel 3,2" / "中危" / "低危"Medium/low
aliyun cloud-siem list-incidents --api-version 2024-12-12 --region cn-shanghai --page-number 1 --page-size 10 --threat-level 3,2 --lang zh --user-agent AlibabaCloud-Agent-Skills --read-timeout 120 --connect-timeout 10
"已处理" / "处理过" / "handled" / "IncidentStatus=10" / "状态是已处理"Handled
aliyun cloud-siem list-incidents --api-version 2024-12-12 --region cn-shanghai --page-number 1 --page-size 10 --incident-status 10 --lang zh --user-agent AlibabaCloud-Agent-Skills --read-timeout 120 --connect-timeout 10
"第二页" / "第2页" / "翻到第2页" / "翻页" / "page 2" / "--page-number 2"Pagination
aliyun cloud-siem list-incidents --api-version 2024-12-12 --region cn-shanghai --page-number 2 --page-size 10 --lang zh --user-agent AlibabaCloud-Agent-Skills --read-timeout 120 --connect-timeout 10
"新加坡" / "Singapore" / "ap-southeast-1"Singapore
aliyun cloud-siem list-incidents --api-version 2024-12-12 --region ap-southeast-1 --page-number 1 --page-size 10 --lang zh --user-agent AlibabaCloud-Agent-Skills --read-timeout 120 --connect-timeout 10
"UUID" / "详情" / "b6515eb76b73cd4995a902b6df5a766b"Get detail
aliyun cloud-siem get-incident --api-version 2024-12-12 --region cn-shanghai --incident-uuid <UUID> --lang zh --user-agent AlibabaCloud-Agent-Skills --read-timeout 120 --connect-timeout 10
"排查" / "先查列表再详情" / "完整排查" / "list then detail"Multi-StepSee Workflow B below (必须执行两步!)
"7天趋势" / "trend" / "7days"7-day trend
START=$(($(date -v-7d +%s) * 1000)) && END=$(($(date +%s) * 1000)) && aliyun cloud-siem DescribeEventCountByThreatLevel --RegionId cn-shanghai --StartTime $START --EndTime $END --user-agent AlibabaCloud-Agent-Skills --read-timeout 120 --connect-timeout 10
"30天" / "月度" / "月度安全报告" / "monthly" / "月报"30-day trend
START=$(($(date -v-30d +%s) * 1000)) && END=$(($(date +%s) * 1000)) && aliyun cloud-siem DescribeEventCountByThreatLevel --RegionId cn-shanghai --StartTime $START --EndTime $END --user-agent AlibabaCloud-Agent-Skills --read-timeout 120 --connect-timeout 10
DEFAULT BEHAVIOR: When no specific filter mentioned, use basic query without filters.
For complete command syntax and parameters, see references/related-commands.md.
重要提示:请将用户请求与下方命令精确匹配后直接执行。
用户请求关键词动作需执行的精确命令
"查事件" / "安全事件列表" / "basic query"基础列表查询
aliyun cloud-siem list-incidents --api-version 2024-12-12 --region cn-shanghai --page-number 1 --page-size 10 --lang zh --user-agent AlibabaCloud-Agent-Skills --read-timeout 120 --connect-timeout 10
"未处理" / "还没处理" / "所有事件" / "unhandled" / "全部列出来"所有未处理事件
aliyun cloud-siem list-incidents --api-version 2024-12-12 --region cn-shanghai --page-number 1 --page-size 10 --incident-status 0 --lang zh --user-agent AlibabaCloud-Agent-Skills --read-timeout 120 --connect-timeout 10
"高危" / "ThreatLevel>=4" / "high-risk"高风险事件
aliyun cloud-siem list-incidents --api-version 2024-12-12 --region cn-shanghai --page-number 1 --page-size 10 --threat-level 5,4 --lang zh --user-agent AlibabaCloud-Agent-Skills --read-timeout 120 --connect-timeout 10
"中低风险" / "ThreatLevel 3,2" / "中危" / "低危"中/低风险事件
aliyun cloud-siem list-incidents --api-version 2024-12-12 --region cn-shanghai --page-number 1 --page-size 10 --threat-level 3,2 --lang zh --user-agent AlibabaCloud-Agent-Skills --read-timeout 120 --connect-timeout 10
"已处理" / "处理过" / "handled" / "IncidentStatus=10" / "状态是已处理"已处理事件
aliyun cloud-siem list-incidents --api-version 2024-12-12 --region cn-shanghai --page-number 1 --page-size 10 --incident-status 10 --lang zh --user-agent AlibabaCloud-Agent-Skills --read-timeout 120 --connect-timeout 10
"第二页" / "第2页" / "翻到第2页" / "翻页" / "page 2" / "--page-number 2"分页查询
aliyun cloud-siem list-incidents --api-version 2024-12-12 --region cn-shanghai --page-number 2 --page-size 10 --lang zh --user-agent AlibabaCloud-Agent-Skills --read-timeout 120 --connect-timeout 10
"新加坡" / "Singapore" / "ap-southeast-1"新加坡区域查询
aliyun cloud-siem list-incidents --api-version 2024-12-12 --region ap-southeast-1 --page-number 1 --page-size 10 --lang zh --user-agent AlibabaCloud-Agent-Skills --read-timeout 120 --connect-timeout 10
"UUID" / "详情" / "b6515eb76b73cd4995a902b6df5a766b"获取详情
aliyun cloud-siem get-incident --api-version 2024-12-12 --region cn-shanghai --incident-uuid <UUID> --lang zh --user-agent AlibabaCloud-Agent-Skills --read-timeout 120 --connect-timeout 10
"排查" / "先查列表再详情" / "完整排查" / "list then detail"多步流程参考下方工作流B(必须执行两步!)
"7天趋势" / "trend" / "7days"7天趋势统计
START=$(($(date -v-7d +%s) * 1000)) && END=$(($(date +%s) * 1000)) && aliyun cloud-siem DescribeEventCountByThreatLevel --RegionId cn-shanghai --StartTime $START --EndTime $END --user-agent AlibabaCloud-Agent-Skills --read-timeout 120 --connect-timeout 10
"30天" / "月度" / "月度安全报告" / "monthly" / "月报"30天趋势统计
START=$(($(date -v-30d +%s) * 1000)) && END=$(($(date +%s) * 1000)) && aliyun cloud-siem DescribeEventCountByThreatLevel --RegionId cn-shanghai --StartTime $START --EndTime $END --user-agent AlibabaCloud-Agent-Skills --read-timeout 120 --connect-timeout 10
默认行为:如果用户没有指定过滤条件,使用无过滤的基础查询命令。
完整命令语法和参数说明请参考 references/related-commands.md

Region Selection

区域选择

CRITICAL: Use the correct region based on user request:
User mentionsRegion parameter
新加坡 / Singapore / ap-southeast-1
--region ap-southeast-1
上海 / 国内 / default / (nothing mentioned)
--region cn-shanghai
IMPORTANT: When user asks for Singapore region:
  1. Use
    --region ap-southeast-1
  2. DO NOT include cn-shanghai anywhere in the command
  3. DO NOT explain - just execute the Singapore region command directly
严重注意:请根据用户请求选择正确的区域:
用户提及内容区域参数
新加坡 / Singapore / ap-southeast-1
--region ap-southeast-1
上海 / 国内 / 默认 / 未提及区域
--region cn-shanghai
重要提示:当用户要求查询新加坡区域时:
  1. 使用
    --region ap-southeast-1
    参数
  2. 命令中不要出现cn-shanghai
  3. 不需要额外解释,直接执行对应新加坡区域的命令即可

Core Workflow

核心工作流

CRITICAL: Never create mock data. Report actual API errors.
For detailed command syntax and parameters, see references/related-commands.md.
严重注意:绝对不要生成模拟数据,如实报告API返回的错误。
详细命令语法和参数请参考 references/related-commands.md

Workflow Patterns

工作流模式

PatternTriggerAPIReference
Query Incidents"查事件", "安全事件"
list-incidents
See Quick Reference table above
Get Details"UUID", "详情"
get-incident
See Quick Reference table above
Event Trend"趋势", "统计"
DescribeEventCountByThreatLevel
See related-commands.md
模式触发词API参考
事件查询"查事件", "安全事件"
list-incidents
参考上方快速参考表格
详情查询"UUID", "详情"
get-incident
参考上方快速参考表格
事件趋势"趋势", "统计"
DescribeEventCountByThreatLevel
参考related-commands.md

Multi-Step Workflows

多步工作流

CRITICAL: Multi-step workflows require executing ALL steps. DO NOT skip any step!
严重注意:多步工作流必须执行所有步骤,不要跳过任何步骤!

Workflow A: Weekly Security Report (周报/安全报告)

工作流A:每周安全报告(周报/安全报告)

Trigger: "周报", "security report" with statistics AND incident list
MUST execute BOTH commands in sequence:
bash
undefined
触发条件:用户请求包含"周报", "security report",同时需要统计数据和事件列表
必须按顺序执行两个命令
bash
undefined

Step 1: Get 7-day statistics

Step 1: Get 7-day statistics

START=$(($(date -v-7d +%s) * 1000)) && END=$(($(date +%s) * 1000)) && aliyun cloud-siem DescribeEventCountByThreatLevel --RegionId cn-shanghai --StartTime $START --EndTime $END --user-agent AlibabaCloud-Agent-Skills --read-timeout 120 --connect-timeout 10
START=$(($(date -v-7d +%s) * 1000)) && END=$(($(date +%s) * 1000)) && aliyun cloud-siem DescribeEventCountByThreatLevel --RegionId cn-shanghai --StartTime $START --EndTime $END --user-agent AlibabaCloud-Agent-Skills --read-timeout 120 --connect-timeout 10

Step 2: Get high-risk incident list

Step 2: Get high-risk incident list

aliyun cloud-siem list-incidents --api-version 2024-12-12 --region cn-shanghai --page-number 1 --page-size 10 --threat-level 5,4 --lang zh --user-agent AlibabaCloud-Agent-Skills --read-timeout 120 --connect-timeout 10
undefined
aliyun cloud-siem list-incidents --api-version 2024-12-12 --region cn-shanghai --page-number 1 --page-size 10 --threat-level 5,4 --lang zh --user-agent AlibabaCloud-Agent-Skills --read-timeout 120 --connect-timeout 10
undefined

Workflow B: Full Investigation (排查/完整排查)

工作流B:完整排查(排查/完整排查)

Trigger Keywords: "排查", "先查...再查", "完整排查", "把详情也查出来"
CRITICAL: You MUST execute BOTH commands! DO NOT SKIP Step 2!
bash
undefined
触发关键词:"排查", "先查...再查", "完整排查", "把详情也查出来"
严重注意:你必须执行两个命令不要跳过第2步!
bash
undefined

Step 1: List high-risk incidents

Step 1: List high-risk incidents

aliyun cloud-siem list-incidents --api-version 2024-12-12 --region cn-shanghai --page-number 1 --page-size 10 --threat-level 5,4 --lang zh --user-agent AlibabaCloud-Agent-Skills --read-timeout 120 --connect-timeout 10
aliyun cloud-siem list-incidents --api-version 2024-12-12 --region cn-shanghai --page-number 1 --page-size 10 --threat-level 5,4 --lang zh --user-agent AlibabaCloud-Agent-Skills --read-timeout 120 --connect-timeout 10

Output: {"Incidents": [{"IncidentUuid": "abc123def456...", ...}]}

Output: {"Incidents": [{"IncidentUuid": "abc123def456...", ...}]}

Step 2: Extract IncidentUuid from Step 1, then get details (REQUIRED!)

Step 2: Extract IncidentUuid from Step 1, then get details (REQUIRED!)

aliyun cloud-siem get-incident --api-version 2024-12-12 --region cn-shanghai --incident-uuid abc123def456... --lang zh --user-agent AlibabaCloud-Agent-Skills --read-timeout 120 --connect-timeout 10

**Example**: "帮我做个完整的安全事件排查:先查高危事件列表,然后把第一条事件的详情也查出来"
1. Call `list-incidents` with `--threat-level 5,4`
2. Extract `IncidentUuid` from `Incidents[0].IncidentUuid`
3. Call `get-incident` with that UUID
aliyun cloud-siem get-incident --api-version 2024-12-12 --region cn-shanghai --incident-uuid abc123def456... --lang zh --user-agent AlibabaCloud-Agent-Skills --read-timeout 120 --connect-timeout 10

**示例**:"帮我做个完整的安全事件排查:先查高危事件列表,然后把第一条事件的详情也查出来"
1. 携带`--threat-level 5,4`参数调用`list-incidents`接口
2. 从`Incidents[0].IncidentUuid`中提取事件UUID
3. 使用该UUID调用`get-incident`接口

Success Verification

成功校验

  1. list-incidents
    returns JSON with
    RequestId
    and
    Incidents
    array
  2. get-incident
    returns JSON with
    Incident
    object
  3. DescribeEventCountByThreatLevel
    returns
    Data
    object
Detailed verification: references/verification-method.md
  1. list-incidents
    返回包含
    RequestId
    Incidents
    数组的JSON
  2. get-incident
    返回包含
    Incident
    对象的JSON
  3. DescribeEventCountByThreatLevel
    返回包含
    Data
    对象的响应
详细校验规则references/verification-method.md

Reference Links

参考链接

DocumentDescription
references/ram-policies.mdRAM permission policy
references/related-commands.mdCommand syntax and parameters
references/acceptance-criteria.mdCorrect usage patterns
references/verification-method.mdVerification methods
references/cli-installation-guide.mdCLI installation guide
文档描述
references/ram-policies.mdRAM权限策略
references/related-commands.md命令语法和参数说明
references/acceptance-criteria.md正确使用模式
references/verification-method.md校验方法
references/cli-installation-guide.mdCLI安装指南