alibabacloud-governance-evaluation-report
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseAlibaba Cloud Governance Center Evaluation Report
阿里云治理中心评估报告
Guide users to discover governance risks, focus on critical issues, and take remediation actions through a progressive drill-down workflow.
通过渐进式下钻工作流引导用户发现治理风险、聚焦关键问题并采取修复措施。
Scenario Description
场景说明
This skill is a problem-discovery and resolution guide — not a comprehensive audit report generator. It operates as a progressive disclosure funnel:
- Overview (quick diagnosis) — Score + pillar distribution + top critical risks → guide user to choose a direction
- Pillar analysis (focused drill-down) — All risks in a specific domain, controlled by severity → guide user to specific items
- Detail (deep dive) — Single check item with full remediation steps → guide user to related items or resources
- Resources (action) — Non-compliant resource listing for targeted remediation
Each layer focuses on the most important information and guides the user to the next level. Avoid information overload — keep output concise and actionable.
Architecture:
Governance Center API → CLI (aliyun governance) → governance_query.py (merge + cache) → JSON output → Agent report该技能是问题发现与解决指南,而非完整的审计报告生成工具。它采用渐进式信息披露的漏斗模型工作:
- 概览(快速诊断) — 得分 + 支柱分布 + 顶级关键风险 → 引导用户选择排查方向
- 支柱分析(聚焦下钻) — 特定领域的所有风险,按严重程度管控 → 引导用户定位到具体项
- 详情(深度排查) — 包含完整修复步骤的单个检测项 → 引导用户查看关联项或资源
- 资源(执行动作) — 不合规资源列表,用于定向修复
每一层都聚焦最重要的信息并引导用户进入下一层。避免信息过载,保持输出简洁且可落地。
架构:
Governance Center API → CLI (aliyun governance) → governance_query.py (合并 + 缓存) → JSON 输出 → Agent 报告How It Works
工作原理
Data Sources — Three APIs provide all data:
- — Check item definitions (name, description, pillar, level, remediation)
list-evaluation-metadata - — Actual results (status, risk, compliance rate, score)
list-evaluation-results - — Non-compliant resource details for a specific check item
list-evaluation-metric-details
Processing — The script (governance_query.py) merges data sources and caches results for 1 hour. It provides 4 query modes: , , , .
overviewpillardetailresourcesOutput — Structured JSON for Agent to generate user-friendly reports. Reports are output directly in the conversation as formatted text, NOT written to files.
数据源 — 三个API提供所有数据:
- — 检测项定义(名称、描述、支柱、等级、修复方案)
list-evaluation-metadata - — 实际检测结果(状态、风险、合规率、得分)
list-evaluation-results - — 特定检测项的不合规资源详情
list-evaluation-metric-details
处理流程 — 脚本(governance_query.py)合并多源数据并将结果缓存1小时。它提供4种查询模式:、、、。
overviewpillardetailresources输出 — 结构化JSON供Agent生成用户友好的报告。报告直接以格式化文本形式在对话中输出,不会写入文件。
Prerequisites
前提条件
Pre-check: Aliyun CLI >= 3.3.0 required Runto verify. If not installed or version too low, see references/cli-installation-guide.md for installation instructions. Then [MUST] runaliyun versionto enable automatic plugin installation.aliyun configure set --auto-plugin-install true
bash
aliyun version # >= 3.3.0
aliyun configure set --auto-plugin-install true # Enable auto plugin install
python3 --version # Python 3.x前置检查:要求 Aliyun CLI >= 3.3.0 运行验证版本。如果未安装或者版本过低,查看 references/cli-installation-guide.md 获取安装指引。 之后**[必须]** 运行aliyun version启用插件自动安装功能。aliyun configure set --auto-plugin-install true
bash
aliyun version # >= 3.3.0
aliyun configure set --auto-plugin-install true # 启用自动安装插件
python3 --version # Python 3.xAuthentication
身份认证
Configure CLI authentication (OAuth recommended):
bash
undefined配置CLI身份认证(推荐OAuth方式):
bash
undefinedOAuth mode (recommended)
OAuth 模式(推荐)
aliyun configure --mode OAuth
aliyun configure --mode OAuth
undefinedRAM Policy
RAM 策略
Requires Governance Center read permissions. See references/ram-policies.md for full policy.
Minimum required permissions:
governance:ListEvaluationMetadatagovernance:ListEvaluationResults
Or attach system policy: AliyunGovernanceReadOnlyAccess
需要治理中心的读权限。查看 references/ram-policies.md 获取完整策略。
最低所需权限:
governance:ListEvaluationMetadatagovernance:ListEvaluationResults
或者挂载系统策略:AliyunGovernanceReadOnlyAccess
Parameter Confirmation
参数确认
This skill has minimal user-specific parameters. The following may require confirmation:
| Parameter Name | Required/Optional | Description | Default Value |
|---|---|---|---|
| Optional | Aliyun CLI profile name | Default profile |
| Required (pillar mode) | Pillar category name | N/A |
| Required (detail/resources mode) | Check item metric ID | N/A |
| Optional (detail mode) | Search keyword for check items | N/A |
| Optional (resources mode) | Max results per page | 50 |
该技能的用户自定义参数非常少,可能需要确认以下参数:
| 参数名 | 必填/可选 | 描述 | 默认值 |
|---|---|---|---|
| 可选 | Aliyun CLI 配置名 | 默认配置 |
| (支柱模式下)必填 | 支柱分类名称 | 无 |
| (详情/资源模式下)必填 | 检测项指标ID | 无 |
| (详情模式下)可选 | 检测项搜索关键词 | 无 |
| (资源模式下)可选 | 每页最大返回结果数 | 50 |
Verification
验证
Verify setup before use:
bash
undefined使用前先验证配置是否正确:
bash
undefinedTest CLI connection
测试CLI连接
aliyun governance list-evaluation-results
--user-agent AlibabaCloud-Agent-Skills
--cli-query "Results.TotalScore"
--user-agent AlibabaCloud-Agent-Skills
--cli-query "Results.TotalScore"
aliyun governance list-evaluation-results
--user-agent AlibabaCloud-Agent-Skills
--cli-query "Results.TotalScore"
--user-agent AlibabaCloud-Agent-Skills
--cli-query "Results.TotalScore"
Test script
测试脚本
python3 scripts/governance_query.py overview
See [references/verification-method.md](references/verification-method.md) for detailed steps.
---python3 scripts/governance_query.py overview
查看 [references/verification-method.md](references/verification-method.md) 获取详细步骤。
---Core Workflow
核心工作流
IMPORTANT: Parameter Confirmation — Before executing any command or API call, ALL user-customizable parameters (e.g.,,--profile,--category,--id,--keyword, etc.) MUST be confirmed with the user. Do NOT assume or use default values without explicit user approval.--max-results
IMPORTANT: Output Format — Reports are format specifications for conversation output only. Always output report content directly in the chat message as formatted Markdown. Do NOT create or write report files (e.g.,,.md,.txt). No file generation is needed..html
Script location: scripts/governance_query.py
重要提示:参数确认 — 执行任何命令或者API调用前,必须与用户确认所有用户可自定义的参数(例如、--profile、--category、--id、--keyword等)。未经用户明确同意,请勿假设参数值或者使用默认值。--max-results
重要提示:输出格式 — 报告仅为对话输出的格式规范,始终直接在聊天消息中以格式化Markdown输出报告内容,请勿创建或者写入报告文件(例如、.md、.txt),不需要生成任何文件。.html
脚本位置:scripts/governance_query.py
Global Options
全局选项
| Option | Description |
|---|---|
| Force refresh cache (default: 1-hour TTL) |
| 选项 | 描述 |
|---|---|
| 强制刷新缓存(默认TTL为1小时) |
Mode 1: overview
— Overall Maturity Report
overview模式1:overview
— 整体成熟度报告
overviewWhen to use: User asks about overall account health, maturity score, or wants a summary.
bash
python3 scripts/governance_query.py overview
python3 scripts/governance_query.py overview -r Error # Only high-risk items
python3 scripts/governance_query.py overview -r Error,Warning # High + medium risk
python3 scripts/governance_query.py --refresh overview # Force fresh dataOptions:
| Option | Description |
|---|---|
| Filter RiskyItems by risk level (comma-separated: |
Output JSON fields:
- — Overall maturity score (0.0-1.0)
TotalScore - — Per-pillar statistics (checked/risky counts, always unfiltered)
PillarSummary - — Count by risk level (always unfiltered)
RiskDistribution - — Items with risk, filtered by
RiskyItemsif specified, sorted by severity--risk - — Applied risk filter values (only present when
RiskFilteris used)--risk
Report format: Read references/report-format-overview.md for the exact output format.
适用场景:用户询问账号整体健康度、成熟度得分,或者想要汇总结果时。
bash
python3 scripts/governance_query.py overview
python3 scripts/governance_query.py overview -r Error # 仅展示高风险项
python3 scripts/governance_query.py overview -r Error,Warning # 高+中风险项
python3 scripts/governance_query.py --refresh overview # 强制获取最新数据选项:
| 选项 | 描述 |
|---|---|
| 按风险等级过滤风险项(逗号分隔: |
输出JSON字段:
- — 整体成熟度得分(0.0-1.0)
TotalScore - — 各支柱统计数据(已检测/风险项数量,始终不过滤)
PillarSummary - — 按风险等级统计的数量(始终不过滤)
RiskDistribution - — 存在风险的项,若指定
RiskyItems则按规则过滤,按严重程度排序--risk - — 已应用的风险过滤值(仅当使用
RiskFilter时存在)--risk
报告格式:阅读 references/report-format-overview.md 获取准确的输出格式。
Mode 2: pillar
— Pillar-Specific Report
pillar模式2:pillar
— 指定支柱的专项报告
pillarWhen to use: User asks about a specific domain (security, reliability, cost, etc.).
bash
python3 scripts/governance_query.py pillar -c <Category> [options]Options:
| Option | Description |
|---|---|
| Required. Pillar name (see below) |
| Only show items with risk (exclude compliant) |
| Filter by recommendation level (comma-separated) |
| Filter by actual risk level (comma-separated) |
Category values:
- — 安全
Security - — 稳定
Reliability - — 成本
CostOptimization - — 效率
OperationalExcellence - — 性能
Performance
Level values: , , ,
CriticalHighMediumSuggestionRisk values: , , ,
ErrorWarningSuggestionNoneExamples:
bash
undefined适用场景:用户询问特定领域(安全、可靠性、成本等)的问题时。
bash
python3 scripts/governance_query.py pillar -c <Category> [options]选项:
| 选项 | 描述 |
|---|---|
| 必填。支柱名称(见下方列表) |
| 仅展示存在风险的项(排除合规项) |
| 按推荐等级过滤(逗号分隔) |
| 按实际风险等级过滤(逗号分隔) |
分类取值:
- — 安全
Security - — 稳定
Reliability - — 成本
CostOptimization - — 效率
OperationalExcellence - — 性能
Performance
等级取值:、、、
CriticalHighMediumSuggestion风险取值:、、、
ErrorWarningSuggestionNone示例:
bash
undefined安全支柱所有风险项
安全支柱所有风险项
python3 scripts/governance_query.py pillar -c Security --risky
python3 scripts/governance_query.py pillar -c Security --risky
仅严重和高优先级的错误/警告
仅严重和高优先级的错误/警告
python3 scripts/governance_query.py pillar -c Security -l Critical,High -r Error,Warning --risky
**Output JSON fields**:
- `Category`, `CategoryCN` — Pillar name
- `MatchedCount` — Number of matched items
- `Items` — List of check items with status
**Report format**: Read [references/report-format-pillar.md](references/report-format-pillar.md) for the exact output format.
---python3 scripts/governance_query.py pillar -c Security -l Critical,High -r Error,Warning --risky
**输出JSON字段**:
- `Category`、`CategoryCN` — 支柱名称
- `MatchedCount` — 匹配的项数量
- `Items` — 带状态的检测项列表
**报告格式**:阅读 [references/report-format-pillar.md](references/report-format-pillar.md) 获取准确的输出格式。
---Mode 3: detail
— Check Item Detail
detail模式3:detail
— 检测项详情
detailWhen to use: User asks about a specific check item or how to fix an issue.
bash
python3 scripts/governance_query.py detail --id <metric-id>
python3 scripts/governance_query.py detail --keyword <search-term>Options:
| Option | Description |
|---|---|
| Check item ID (e.g., |
| Search by name/description (if multiple matches, shows list) |
Examples:
bash
undefined适用场景:用户询问特定检测项,或者如何修复某个问题时。
bash
python3 scripts/governance_query.py detail --id <metric-id>
python3 scripts/governance_query.py detail --keyword <search-term>选项:
| 选项 | 描述 |
|---|---|
| 检测项ID(例如 |
| 按名称/描述搜索(如果匹配多个则展示列表) |
示例:
bash
undefined按 ID 查询
按 ID 查询
python3 scripts/governance_query.py detail --id apbxftkv5c
python3 scripts/governance_query.py detail --id apbxftkv5c
按关键字搜索
按关键字搜索
python3 scripts/governance_query.py detail --keyword "MFA"
**Output JSON fields**:
- Basic info: `Id`, `DisplayName`, `Description`, `Category`
- Status: `Status`, `Risk`, `Compliance`, `NonCompliant`
- `Remediation` — Fix steps (Manual/Analysis/QuickFix)
**Report format**: Read [references/report-format-detail.md](references/report-format-detail.md) for the exact output format. The detail format also covers the resources listing when needed.
---python3 scripts/governance_query.py detail --keyword "MFA"
**输出JSON字段**:
- 基础信息:`Id`、`DisplayName`、`Description`、`Category`
- 状态:`Status`、`Risk`、`Compliance`、`NonCompliant`
- `Remediation` — 修复步骤(手动/分析/快速修复)
**报告格式**:阅读 [references/report-format-detail.md](references/report-format-detail.md) 获取准确的输出格式。需要时详情格式也包含资源列表。
---Mode 4: resources
— Non-Compliant Resources
resources模式4:resources
— 不合规资源
resourcesWhen to use: User wants to see which specific resources failed a check item.
bash
python3 scripts/governance_query.py resources --id <metric-id>Options:
| Option | Description |
|---|---|
| Required. Check item ID |
| Max results per page (default: 50) |
Examples:
bash
undefined适用场景:用户想要查看某个检测项未通过的具体资源列表时。
bash
python3 scripts/governance_query.py resources --id <metric-id>选项:
| 选项 | 描述 |
|---|---|
| 必填。检测项ID |
| 每页最大返回结果数(默认:50) |
示例:
bash
undefined查询未启用 MFA 的 RAM 用户列表
查询未启用 MFA 的 RAM 用户列表
python3 scripts/governance_query.py resources --id apbxftkv5c
python3 scripts/governance_query.py resources --id apbxftkv5c
查询开放高危端口的安全组
查询开放高危端口的安全组
python3 scripts/governance_query.py resources --id a9g6pv7r5b
**Output JSON fields**:
- `MetricId` — Check item ID
- `TotalCount` — Number of non-compliant resources
- `Resources[]` — List of resources:
- `ResourceId`, `ResourceName`, `ResourceType`
- `RegionId`, `ResourceOwnerId`
- `Classification` — Risk classification
- `Properties` — Resource-specific attributes
---python3 scripts/governance_query.py resources --id a9g6pv7r5b
**输出JSON字段**:
- `MetricId` — 检测项ID
- `TotalCount` — 不合规资源数量
- `Resources[]` — 资源列表:
- `ResourceId`、`ResourceName`、`ResourceType`
- `RegionId`、`ResourceOwnerId`
- `Classification` — 风险分类
- `Properties` — 资源特定属性
---Mode Selection Guide
模式选择指南
| User says... | Use mode | Command | Report format |
|---|---|---|---|
| "查查我的账号安全吗" / "成熟度得分" / "分析下治理检测结果" | | | overview |
| "有哪些高风险项" / "看下所有高风险" | | | overview |
| "中风险以上的问题" | | | overview |
| "安全方面有哪些问题" / "XX支柱的风险" | | | pillar |
| "网络安全相关的检测项" / "数据库风险" | | | pillar |
| "高优先级的问题" | | | pillar |
| "MFA怎么修" / "XX检测项详情" | | | detail |
| "哪些用户没开MFA" / "不合规资源有哪些" | | | detail |
Default: If user doesn't specify pillar or check item, use .
overviewReport format selection: After determining the query mode, read the corresponding report format reference file before generating output. Only read the format file that matches the user's intent — do not read all format files at once.
| 用户输入... | 使用模式 | 命令 | 报告格式 |
|---|---|---|---|
| "查查我的账号安全吗" / "成熟度得分" / "分析下治理检测结果" | | | overview |
| "有哪些高风险项" / "看下所有高风险" | | | overview |
| "中风险以上的问题" | | | overview |
| "安全方面有哪些问题" / "XX支柱的风险" | | | pillar |
| "网络安全相关的检测项" / "数据库风险" | | | pillar |
| "高优先级的问题" | | | pillar |
| "MFA怎么修" / "XX检测项详情" | | | detail |
| "哪些用户没开MFA" / "不合规资源有哪些" | | | detail |
默认规则:如果用户未指定支柱或者检测项,使用模式。
overview报告格式选择:确定查询模式后,生成输出前先阅读对应的报告格式参考文件。仅读取与用户意图匹配的格式文件,请勿一次性读取所有格式文件。
Field Reference
字段参考
| Field | Values | Note |
|---|---|---|
| | Actual detected risk |
| | Recommended priority |
| | Check execution status |
| 0.0 - 1.0 | 1.0 = fully compliant |
| 字段 | 取值 | 说明 |
|---|---|---|
| | 实际检测到的风险 |
| | 推荐处理优先级 |
| | 检测执行状态 |
| 0.0 - 1.0 | 1.0 = 完全合规 |
Cache & Cleanup
缓存与清理
Only metadata (check item definitions) is cached locally — results are always fetched in real-time.
- Cache location:
~/.governance_cache/metadata.json - TTL: 24 hours (metadata rarely changes)
- and
list-evaluation-resultsare never cachedlist-evaluation-metric-details
bash
undefined仅元数据(检测项定义)会在本地缓存 — 检测结果始终实时获取。
- 缓存位置:
~/.governance_cache/metadata.json - TTL:24小时(元数据极少变更)
- 和
list-evaluation-results永远不会缓存list-evaluation-metric-details
bash
undefinedForce refresh metadata cache
强制刷新元数据缓存
python3 scripts/governance_query.py --refresh overview
python3 scripts/governance_query.py --refresh overview
Clear cache manually
手动清理缓存
rm -rf ~/.governance_cache/
undefinedrm -rf ~/.governance_cache/
undefinedBest Practices
最佳实践
- Focus, don't dump — Each report layer should highlight what matters most, not list everything. Read the corresponding report format reference for quantity control rules
- Follow the funnel — Start with , guide user to
overview, then topillar. Don't skip layers unless user explicitly asks for a specific itemdetail - Use filter for pillar mode — Reduces noise by hiding compliant items when investigating issues
--risky - Prioritize by Risk + Level — Focus on risk with
Error/Criticalrecommendation level firstHigh - Follow remediation guidance — Use mode to get actionable fix steps before modifying resources
detail - Always guide next steps — Every report must end with follow-up guidance based on actual data, helping users continue exploring
- Cache management — Only metadata is cached (24h TTL); results are always real-time. Use to force metadata refresh
--refresh
- 聚焦核心信息,不要全量堆砌 — 每个报告层都应该突出最重要的内容,而非罗列所有信息。阅读对应的报告格式参考了解数量管控规则
- 遵循漏斗模型 — 从开始,引导用户进入
overview,再到pillar。除非用户明确要求查看特定项,否则不要跳过层级detail - 支柱模式下使用过滤 — 排查问题时隐藏合规项,减少噪音
--risky - 按风险+优先级排序 — 优先关注风险等级为且推荐优先级为
Error/Critical的问题High - 遵循修复指引 — 修改资源前先使用模式获取可落地的修复步骤
detail - 始终引导下一步操作 — 每份报告的末尾都需要基于实际数据给出后续操作指引,帮助用户继续排查
- 缓存管理 — 仅元数据会被缓存(24小时TTL);检测结果始终是实时的。使用强制刷新元数据
--refresh
References
参考文档
| File | Content |
|---|---|
| report-format-overview.md | Report format: overall governance overview |
| report-format-pillar.md | Report format: pillar / keyword aggregated analysis |
| report-format-detail.md | Report format: single check item detail + resources |
| related-apis.md | CLI commands and API details |
| ram-policies.md | Required permissions |
| verification-method.md | Verification steps |
| cli-installation-guide.md | CLI installation |
| 文件 | 内容 |
|---|---|
| report-format-overview.md | 报告格式:整体治理概览 |
| report-format-pillar.md | 报告格式:支柱/关键词聚合分析 |
| report-format-detail.md | 报告格式:单个检测项详情 + 资源列表 |
| related-apis.md | CLI命令和API详情 |
| ram-policies.md | 所需权限 |
| verification-method.md | 验证步骤 |
| cli-installation-guide.md | CLI安装指引 |