| name | alibabacloud-sas-overview |
| description | Alibaba Cloud Security Center (SAS) Overview Data Query Skill.
Retrieves security score, asset status, risk governance, asset risk trends, and billing info.
Supports flexible scope: query a single data item, a specific module, or the full overview based on user intent.
阿里云云安全中心(SAS)总览数据查询技能。
可获取安全评分、资产状态、风险治理、资产风险趋势及账单信息。
支持灵活查询范围:根据用户意图查询单个数据项、特定模块或完整总览。
Triggers: "SAS overview", "security center overview", "SAS 总览", "云安全中心总览",
"security score", "安全评分", "安全分",
"vulnerability fix", "baseline risk", "handled alerts",
"host assets", "uninstalled clients",
"risk governance", "WAF blocks", "asset risk trend",
"SAS billing", "订阅状态", "账单"
Out of scope: This Skill only covers SAS overview data queries. It does not perform remediation, modify configurations, or manage non-SAS services.
|
SAS Overview Data Query
Retrieves the 5 core modules of the Security Center (SAS) overview dashboard:
- Security Overview — score, fixed vulns, baseline risk, handled alerts
- Usage Info — service days, asset scale, uninstalled clients
- Security Operations — risk governance (AI risk, CSPM, key config, system vulns), security protection (WAF blocks), security response
- Asset Risk Trend — host/container/cloud product risk ratios + trend chart
- Billing & Subscription — post-pay switches, subscription validity, bills
Execution Scope: Each module and data item can be queried independently.
Match the scope to the user's request:
- Single data item — e.g., "What is my security score?" → only command 1a
- Single module — e.g., "Show asset risk trend" → all of Module 4
- Full overview — e.g., "SAS overview" → all 5 modules
Architecture: SAS + WAF + BssOpenApi
Observability
User-Agent Template:
AlibabaCloud-Agent-Skills/alibabacloud-sas-overview/{session-id}
Session-ID Generation Rule:
- Generate a UUID v4 (e.g.,
550e8400-e29b-41d4-a716-446655440000) at the start of each skill execution session.
- The same
{session-id} MUST be used for ALL aliyun CLI commands within a single session, ensuring all requests from one execution can be correlated in logs.
- Each new skill invocation MUST generate a fresh session-id.
Usage: Pass the full UA string via the --user-agent flag on every aliyun CLI command:
SESSION_ID=$(python3 -c "import uuid; print(uuid.uuid4())")
aliyun sas describe-version-config --user-agent "AlibabaCloud-Agent-Skills/alibabacloud-sas-overview/$SESSION_ID"
Prerequisites
Pre-check: Aliyun CLI >= 3.3.1 required
Run aliyun version to verify >= 3.3.1. If not installed or version too low,
run curl -fsSL https://aliyuncli.alicdn.com/setup.sh | bash to update,
or see references/cli-installation-guide.md for installation instructions.
Pre-check: Aliyun CLI plugin update required
[MUST] run aliyun configure set --auto-plugin-install true to enable automatic plugin installation.
[MUST] run aliyun plugin update to ensure that any existing plugins are always up-to-date.
With --auto-plugin-install true set, the required plugins (sas, waf-openapi, bssopenapi) are installed automatically on first use — no manual aliyun plugin install step is needed.
Pre-check: Alibaba Cloud Credentials Required
Security Rules:
- NEVER read, echo, or print AK/SK values (e.g.,
echo $ALIBABA_CLOUD_ACCESS_KEY_ID is FORBIDDEN)
- NEVER ask the user to input AK/SK directly in the conversation or command line
- NEVER use
aliyun configure set with literal credential values
- ONLY use
aliyun configure list to check credential status
aliyun configure list
Check the output for a valid profile (AK, STS, or OAuth identity).
If no valid profile exists, STOP here.
- Obtain credentials from Alibaba Cloud Console
- Configure credentials outside of this session (via
aliyun configure in terminal or environment variables in shell profile)
- Return and re-run after
aliyun configure list shows a valid profile
Parameters
IMPORTANT: Parameter Confirmation — Before executing any command or API call,
ALL user-customizable parameters (e.g., RegionId, WAF InstanceId, BillingCycle, etc.)
MUST be confirmed with the user. Do NOT assume or use default values without explicit user approval.
| Parameter | Required | Description | Default |
|---|
| Regions | Yes | SAS regions to aggregate data from | cn-shanghai, ap-southeast-1 |
| WAF Instance ID | Auto-fetched | Auto-fetched via WAF DescribeInstance for DescribeFlowChart | Auto |
| Billing Cycle | Only for billing | Billing month in YYYY-MM format | Current month |
| Time Range | No | Days of history for score/trend queries | 7 (last 7 days) |
RAM Permissions
See references/ram-policies.md for the full RAM policy JSON.
Required: AliyunYundunSASReadOnlyAccess, AliyunWAFReadOnlyAccess, AliyunBSSReadOnlyAccess.
Core Workflow
Based on the user's query, execute the relevant module(s) below. Each module — and each data item within a module — can be executed independently. For APIs marked multi-region, always query both cn-shanghai and ap-southeast-1, then sum the results.
Module 1: Security Overview
aliyun sas describe-secure-suggestion --cal-type home_security_score --user-agent AlibabaCloud-Agent-Skills/alibabacloud-sas-overview/{session-id}
aliyun sas describe-vul-fix-statistics --region cn-shanghai --user-agent AlibabaCloud-Agent-Skills/alibabacloud-sas-overview/{session-id}
aliyun sas describe-vul-fix-statistics --region ap-southeast-1 --user-agent AlibabaCloud-Agent-Skills/alibabacloud-sas-overview/{session-id}
aliyun sas get-check-risk-statistics --region cn-shanghai --user-agent AlibabaCloud-Agent-Skills/alibabacloud-sas-overview/{session-id}
aliyun sas get-check-risk-statistics --region ap-southeast-1 --user-agent AlibabaCloud-Agent-Skills/alibabacloud-sas-overview/{session-id}
aliyun sas get-defence-count --region cn-shanghai --user-agent AlibabaCloud-Agent-Skills/alibabacloud-sas-overview/{session-id}
aliyun sas get-defence-count --region ap-southeast-1 --user-agent AlibabaCloud-Agent-Skills/alibabacloud-sas-overview/{session-id}
Module 2: Usage Info
aliyun sas describe-version-config --user-agent AlibabaCloud-Agent-Skills/alibabacloud-sas-overview/{session-id}
aliyun sas describe-cloud-center-instances \
--region cn-shanghai --machine-types ecs --current-page 1 --page-size 20 \
--user-agent AlibabaCloud-Agent-Skills/alibabacloud-sas-overview/{session-id}
aliyun sas describe-cloud-center-instances \
--region ap-southeast-1 --machine-types ecs --current-page 1 --page-size 20 \
--user-agent AlibabaCloud-Agent-Skills/alibabacloud-sas-overview/{session-id}
aliyun sas list-uninstall-aegis-machines --region cn-shanghai --current-page 1 --page-size 1 --user-agent AlibabaCloud-Agent-Skills/alibabacloud-sas-overview/{session-id}
aliyun sas list-uninstall-aegis-machines --region ap-southeast-1 --current-page 1 --page-size 1 --user-agent AlibabaCloud-Agent-Skills/alibabacloud-sas-overview/{session-id}
Module 3: Security Operations
3a. Risk Governance (region-agnostic, single API call)
aliyun sas describe-secure-suggestion --cal-type home_security_score --user-agent AlibabaCloud-Agent-Skills/alibabacloud-sas-overview/{session-id}
3b. Security Protection — WAF Blocks (multi-region, two-step, WAF 3.0 only)
WAF Version Requirement: This module uses WAF 3.0 API (Product: waf-openapi, Version: 2021-10-01). WAF 2.0 instances (Version 2019-09-10) are NOT compatible — fields such as InstanceId and WafBlockSum may be missing or structured differently. If the user's WAF instance is 2.0, inform them that this module is not supported for their instance version.
Region note: waf-openapi (WAF 3.0) is a centralized-endpoint product — the China-site RegionId is cn-hangzhou (do NOT use cn-shanghai). Also do NOT pass --version on these commands: it forces the Location-service endpoint resolver, which only knows cn-hangzhou/ap-southeast-1 and would fail on other RegionIds.
aliyun waf-openapi describe-instance --region cn-hangzhou --user-agent AlibabaCloud-Agent-Skills/alibabacloud-sas-overview/{session-id}
aliyun waf-openapi describe-instance --region ap-southeast-1 --user-agent AlibabaCloud-Agent-Skills/alibabacloud-sas-overview/{session-id}
START_SEC=$(python3 -c "import time; print(int(time.time()-86400*7))")
aliyun waf-openapi describe-flow-chart \
--region cn-hangzhou \
--instance-id "<InstanceId from cn-hangzhou>" \
--start-timestamp "$START_SEC" \
--interval 3600 \
--user-agent AlibabaCloud-Agent-Skills/alibabacloud-sas-overview/{session-id}
aliyun waf-openapi describe-flow-chart \
--region ap-southeast-1 \
--instance-id "<InstanceId from ap-southeast-1>" \
--start-timestamp "$START_SEC" \
--interval 3600 \
--user-agent AlibabaCloud-Agent-Skills/alibabacloud-sas-overview/{session-id}
3c. Security Response (region-agnostic, same API as 3a)
aliyun sas describe-secure-suggestion --cal-type home_security_score --user-agent AlibabaCloud-Agent-Skills/alibabacloud-sas-overview/{session-id}
Module 4: Asset Risk Trend
aliyun sas describe-cloud-center-instances \
--region cn-shanghai --machine-types ecs --current-page 1 --page-size 1 \
--user-agent AlibabaCloud-Agent-Skills/alibabacloud-sas-overview/{session-id}
aliyun sas describe-field-statistics \
--region cn-shanghai \
--user-agent AlibabaCloud-Agent-Skills/alibabacloud-sas-overview/{session-id}
aliyun sas describe-container-field-statistics \
--region cn-shanghai \
--user-agent AlibabaCloud-Agent-Skills/alibabacloud-sas-overview/{session-id}
aliyun sas get-cloud-asset-summary \
--region cn-shanghai \
--user-agent AlibabaCloud-Agent-Skills/alibabacloud-sas-overview/{session-id}
START_MS=$(python3 -c "import time; print(int((time.time()-86400*7)*1000))")
END_MS=$(python3 -c "import time; print(int(time.time()*1000))")
aliyun sas describe-chart-data \
--region cn-shanghai \
--chart-id CID_ASSET_RISK_TREND \
--report-id -1 \
--time-start "$START_MS" --time-end "$END_MS" \
--user-agent AlibabaCloud-Agent-Skills/alibabacloud-sas-overview/{session-id}
Module 5: Billing & Subscription
aliyun sas describe-version-config --user-agent AlibabaCloud-Agent-Skills/alibabacloud-sas-overview/{session-id}
BILLING_CYCLE=$(date +%Y-%m)
aliyun bssopenapi query-bill \
--region cn-shanghai \
--billing-cycle "$BILLING_CYCLE" --product-code sas \
--user-agent AlibabaCloud-Agent-Skills/alibabacloud-sas-overview/{session-id}
aliyun bssopenapi query-bill \
--region ap-southeast-1 \
--billing-cycle "$BILLING_CYCLE" --product-code sas \
--user-agent AlibabaCloud-Agent-Skills/alibabacloud-sas-overview/{session-id}
Product Code Mapping
| Product Name | Code | Status Values |
|---|
| Host and Container Security | POST_HOST | 1: Enabled, 0: Disabled |
| Vulnerability Fixing | VUL | 1: Enabled, 0: Disabled |
| CSPM | CSPM | 1: Enabled, 0: Disabled |
| Agentic SOC | CTDR | 1: Enabled, 0: Disabled |
| Agentless Detection | AGENTLESS | 1: Enabled, 0: Disabled |
| Serverless Asset Protection | SERVERLESS | 1: Enabled, 0: Disabled |
| Application Protection | RASP | 1: Enabled, 0: Disabled |
| Malicious File Detection | SDK | 1: Enabled, 0: Disabled |
| Log Management | CTDR_STORAGE | 1: Enabled, 0: Disabled |
| Anti-ransomware | ANTI_RANSOMWARE | 1: Enabled, 0: Disabled |
Data Processing Rules
- Multi-region aggregation: APIs requiring regions must query
cn-shanghai + ap-southeast-1 separately, then sum the numeric results.
- Permission error handling: If a region returns a permission error (e.g.,
Forbidden or NoPermission), do NOT silently skip it. You MUST explicitly inform the user which regions succeeded and which failed, including the missing permission. Example: "Data retrieved from cn-shanghai, but ap-southeast-1 returned permission denied (missing sas:DescribeSecureSuggestion). Results only reflect cn-shanghai."
- Timestamps: SAS APIs use millisecond timestamps. WAF APIs use second timestamps.
- PostPayModuleSwitch: Is a JSON string — must
JSON.parse() / json.loads() before reading.
- Score extraction: Use
Score field from DescribeSecureSuggestion response as current score. Note: Score is returned as a string (e.g., "90.0"), not a number — cast to float before comparison or display. Note: DescribeScreenScoreThread is currently unavailable (CalType not supported); once supported, switch to using the last element of Data.SocreThread[] as current score and the full list as historical trend.
- Security Response: Extracted from
DescribeSecureSuggestion where SuggestType == "SS_SAS_ALARM". SubTypes: SSI_SAS_ALARM_HIGH (emergency), SSI_SAS_ALARM_MEDIUM (suspicious), SSI_SAS_ALARM_LOW (reminder).
- Timestamp formatting: Convert ms timestamps to
YYYY-MM-DD HH:mm:ss for display.
Success Verification
See references/verification-method.md for step-by-step verification commands.
Cleanup
This skill is read-only (query operations only). No resources are created, so no cleanup is needed.
Best Practices
- Always query both
cn-shanghai and ap-southeast-1 for multi-region APIs before aggregating.
- Cache the
DescribeVersionConfig response — it is used by both Module 2 and Module 5.
- Use
--cli-query (JMESPath) to extract specific fields and reduce output noise.
- Set
--page-size 1 when only TotalCount is needed (e.g., ListUninstallAegisMachines).
- WAF
DescribeFlowChart requires a valid WAF instance ID — auto-fetch via DescribeInstance first; query both cn-shanghai and ap-southeast-1.
- Billing queries (
QueryBill) require --region — try each region (cn-shanghai, ap-southeast-1) in turn; skip any region that returns a permission error.
- All timestamps returned by SAS are in milliseconds — divide by 1000 for human-readable conversion.
Reference Links