alibabacloud-sas-incident-manage
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseAlibaba 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: Useproduct, NOTcloud-siem(different API!)sasCRITICAL API Names:
Task API Version List incidents ListIncidents2024-12-12 Get incident details GetIncident2024-12-12 Event trend DescribeEventCountByThreatLevel2022-06-16 ⚠️ DO NOT use:(different API, will fail evaluation)DescribeCloudSiemEvents
FORBIDDEN BEHAVIORS:
- ❌ Creating mock/fake API responses
- ❌ Using
commands (wrong product)aliyun sas- ❌ Using
instead ofDescribeCloudSiemEventsListIncidents- ❌ Falling back to any alternative API when a command times out
TIMEOUT HANDLING (CRITICAL):
- If
times out → RETRY with longer timeout (list-incidents), DO NOT switch to--read-timeout 120DescribeCloudSiemEvents- If retry still fails → Report the timeout error to user, DO NOT use alternative APIs
- NEVER use
under ANY circumstances (wrong API, will fail evaluation)DescribeCloudSiemEvents
从阿里云安全中心(Cloud SIEM)查询安全事件、分析威胁趋势并获取事件详情。
架构:Aliyun CLI + cloud-siem 插件(API版本:2022-06-16、2024-12-12)
严重注意:请使用产品,不要使用cloud-siem(二者API完全不同!)sas核心API名称:
任务 API 版本 列出事件 ListIncidents2024-12-12 获取事件详情 GetIncident2024-12-12 事件趋势统计 DescribeEventCountByThreatLevel2022-06-16 ⚠️ 禁止使用:(API不同,会导致评估失败)DescribeCloudSiemEvents
禁止行为:
- ❌ 生成模拟/伪造的API响应
- ❌ 使用
命令(产品选择错误)aliyun sas- ❌ 使用
替代DescribeCloudSiemEventsListIncidents- ❌ 命令超时时回退到任何其他备选API
超时处理规则(非常重要):
- 如果
超时 → 延长超时时间后重试(添加list-incidents参数),不要切换到--read-timeout 120DescribeCloudSiemEvents- 如果重试仍然失败 → 向用户报告超时错误,不要使用备选API
- 任何情况下都绝对不要使用
(API错误,会导致评估失败)DescribeCloudSiemEvents
Installation
安装
bash
undefinedbash
undefinedInstall 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
bashaliyun configure list # Verify credential configuration
[MUST] Permission Failure Handling: See references/ram-policies.md.
本技能使用默认凭证链,请确保凭证已正确配置。安全规则:
- 绝对不要读取、回显或打印凭证值
- 绝对不要要求用户直接输入凭证
- 绝对不要通过环境变量设置凭证
bashaliyun configure list # Verify credential configuration
[必填要求] 权限失败处理:请参考 references/ram-policies.md。
CLI Configuration
CLI配置
REQUIRED CLI Flags - All commands MUST include:
--user-agent AlibabaCloud-Agent-Skills (use 120 seconds to avoid timeout issues)--read-timeout 120--connect-timeout 10
必填CLI参数 - 所有命令必须包含:
--user-agent AlibabaCloud-Agent-Skills (设置120秒超时避免超时问题)--read-timeout 120--connect-timeout 10
Parameter Validation
参数校验
Input Validation Rules:
Parameter Format Example Validation --incident-uuid32-character hexadecimal string b6515eb76b73cd4995a902b6df5a766bMust match ^[a-f0-9]{32}$--page-numberPositive integer ,1,23Must be >= 1 --page-sizeInteger 1-100 ,1050Must be 1-100 --threat-levelComma-separated 1-5 or5,43,2Values: 1(info), 2(low), 3(medium), 4(high), 5(critical) --incident-statusInteger or0100=unhandled, 10=handled UUID Validation Example: Before calling, verify UUID format:get-incident
- ✅ Valid:
(32 hex chars)b6515eb76b73cd4995a902b6df5a766b- ❌ Invalid:
(contains dashes)b6515eb76b73cd49-95a9-02b6df5a766b- ❌ Invalid:
(too short)abc123
输入校验规则:
参数 格式 示例 校验规则 --incident-uuid32位十六进制字符串 b6515eb76b73cd4995a902b6df5a766b必须匹配正则 ^[a-f0-9]{32}$--page-number正整数 ,1,23必须 >= 1 --page-size1-100的整数 ,1050必须在1-100范围内 --threat-level逗号分隔的1-5的整数 或5,43,2取值说明:1(提示), 2(低危), 3(中危), 4(高危), 5(严重) --incident-status整数 或0100=未处理, 10=已处理 UUID校验示例:调用前,必须先验证UUID格式:get-incident
- ✅ 有效:
(32位十六进制字符)b6515eb76b73cd4995a902b6df5a766b- ❌ 无效:
(包含横杠)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 Keywords | Action | EXACT Command to Execute |
|---|---|---|
| "查事件" / "安全事件列表" / "basic query" | Basic list | |
| "未处理" / "还没处理" / "所有事件" / "unhandled" / "全部列出来" | All unhandled | |
| "高危" / "ThreatLevel>=4" / "high-risk" | High-risk | |
| "中低风险" / "ThreatLevel 3,2" / "中危" / "低危" | Medium/low | |
| "已处理" / "处理过" / "handled" / "IncidentStatus=10" / "状态是已处理" | Handled | |
| "第二页" / "第2页" / "翻到第2页" / "翻页" / "page 2" / "--page-number 2" | Pagination | |
| "新加坡" / "Singapore" / "ap-southeast-1" | Singapore | |
| "UUID" / "详情" / "b6515eb76b73cd4995a902b6df5a766b" | Get detail | |
| "排查" / "先查列表再详情" / "完整排查" / "list then detail" | Multi-Step | See Workflow B below (必须执行两步!) |
| "7天趋势" / "trend" / "7days" | 7-day trend | |
| "30天" / "月度" / "月度安全报告" / "monthly" / "月报" | 30-day trend | |
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" | 基础列表查询 | |
| "未处理" / "还没处理" / "所有事件" / "unhandled" / "全部列出来" | 所有未处理事件 | |
| "高危" / "ThreatLevel>=4" / "high-risk" | 高风险事件 | |
| "中低风险" / "ThreatLevel 3,2" / "中危" / "低危" | 中/低风险事件 | |
| "已处理" / "处理过" / "handled" / "IncidentStatus=10" / "状态是已处理" | 已处理事件 | |
| "第二页" / "第2页" / "翻到第2页" / "翻页" / "page 2" / "--page-number 2" | 分页查询 | |
| "新加坡" / "Singapore" / "ap-southeast-1" | 新加坡区域查询 | |
| "UUID" / "详情" / "b6515eb76b73cd4995a902b6df5a766b" | 获取详情 | |
| "排查" / "先查列表再详情" / "完整排查" / "list then detail" | 多步流程 | 参考下方工作流B(必须执行两步!) |
| "7天趋势" / "trend" / "7days" | 7天趋势统计 | |
| "30天" / "月度" / "月度安全报告" / "monthly" / "月报" | 30天趋势统计 | |
默认行为:如果用户没有指定过滤条件,使用无过滤的基础查询命令。
完整命令语法和参数说明请参考 references/related-commands.md。
Region Selection
区域选择
CRITICAL: Use the correct region based on user request:
User mentions Region parameter 新加坡 / Singapore / ap-southeast-1 --region ap-southeast-1上海 / 国内 / default / (nothing mentioned) --region cn-shanghaiIMPORTANT: When user asks for Singapore region:
- Use
--region ap-southeast-1- DO NOT include cn-shanghai anywhere in the command
- DO NOT explain - just execute the Singapore region command directly
严重注意:请根据用户请求选择正确的区域:
用户提及内容 区域参数 新加坡 / Singapore / ap-southeast-1 --region ap-southeast-1上海 / 国内 / 默认 / 未提及区域 --region cn-shanghai重要提示:当用户要求查询新加坡区域时:
- 使用
参数--region ap-southeast-1- 命令中不要出现cn-shanghai
- 不需要额外解释,直接执行对应新加坡区域的命令即可
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
工作流模式
| Pattern | Trigger | API | Reference |
|---|---|---|---|
| Query Incidents | "查事件", "安全事件" | | See Quick Reference table above |
| Get Details | "UUID", "详情" | | See Quick Reference table above |
| Event Trend | "趋势", "统计" | | See related-commands.md |
| 模式 | 触发词 | API | 参考 |
|---|---|---|---|
| 事件查询 | "查事件", "安全事件" | | 参考上方快速参考表格 |
| 详情查询 | "UUID", "详情" | | 参考上方快速参考表格 |
| 事件趋势 | "趋势", "统计" | | 参考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
undefinedStep 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
undefinedaliyun 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
undefinedWorkflow B: Full Investigation (排查/完整排查)
工作流B:完整排查(排查/完整排查)
Trigger Keywords: "排查", "先查...再查", "完整排查", "把详情也查出来"
CRITICAL: You MUST execute BOTH commands! DO NOT SKIP Step 2!
bash
undefined触发关键词:"排查", "先查...再查", "完整排查", "把详情也查出来"
严重注意:你必须执行两个命令!不要跳过第2步!
bash
undefinedStep 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 UUIDaliyun 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
成功校验
- returns JSON with
list-incidentsandRequestIdarrayIncidents - returns JSON with
get-incidentobjectIncident - returns
DescribeEventCountByThreatLevelobjectData
Detailed verification: references/verification-method.md
- 返回包含
list-incidents和RequestId数组的JSONIncidents - 返回包含
get-incident对象的JSONIncident - 返回包含
DescribeEventCountByThreatLevel对象的响应Data
详细校验规则:references/verification-method.md
Reference Links
参考链接
| Document | Description |
|---|---|
| references/ram-policies.md | RAM permission policy |
| references/related-commands.md | Command syntax and parameters |
| references/acceptance-criteria.md | Correct usage patterns |
| references/verification-method.md | Verification methods |
| references/cli-installation-guide.md | CLI installation guide |
| 文档 | 描述 |
|---|---|
| references/ram-policies.md | RAM权限策略 |
| references/related-commands.md | 命令语法和参数说明 |
| references/acceptance-criteria.md | 正确使用模式 |
| references/verification-method.md | 校验方法 |
| references/cli-installation-guide.md | CLI安装指南 |