Loading...
Loading...
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. 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.
npx skill4agent add aliyun/alibabacloud-aiops-skills alibabacloud-sas-overviewExecution 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
SAS + WAF + BssOpenApiPre-check: Aliyun CLI >= 3.3.1 required Runto verify >= 3.3.1. If not installed or version too low, seealiyun versionfor installation instructions. Then runreferences/cli-installation-guide.mdto enable automatic plugin installation.aliyun configure set --auto-plugin-install true
aliyun plugin install --names aliyun-cli-sas aliyun-cli-waf-openapi aliyun-cli-bssopenapiPre-check: Alibaba Cloud Credentials RequiredSecurity Rules:
- NEVER read, echo, or print AK/SK values (e.g.,
is FORBIDDEN)echo $ALIBABA_CLOUD_ACCESS_KEY_ID- NEVER ask the user to input AK/SK directly in the conversation or command line
- NEVER use
with literal credential valuesaliyun configure set- ONLY use
to check credential statusaliyun configure listbashaliyun configure listCheck 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
in terminal or environment variables in shell profile)aliyun configure- Return and re-run after
shows a valid profilealiyun configure list
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 | |
| WAF Instance ID | Auto-fetched | Auto-fetched via WAF | Auto |
| Billing Cycle | Only for billing | Billing month in | Current month |
| Time Range | No | Days of history for score/trend queries | |
AliyunYundunSASReadOnlyAccessAliyunWAFReadOnlyAccessAliyunBSSReadOnlyAccesscn-shanghaiap-southeast-1# 1a. Security Score (region-agnostic)
aliyun sas describe-secure-suggestion --cal-type home_security_score --user-agent AlibabaCloud-Agent-Skills
# Extract: Score field from response as current security score
#
# NOTE: DescribeScreenScoreThread is currently unavailable (CalType not supported).
# Once supported, switch to the command below for score + historical trend:
# START=$(python3 -c "import time; print(int((time.time()-86400*7)*1000))")
# END=$(python3 -c "import time; print(int(time.time()*1000))")
# aliyun sas describe-screen-score-thread \
# --cal-type home_security_score \
# --start-time "$START" --end-time "$END" \
# --user-agent AlibabaCloud-Agent-Skills
# Extract: Data.SocreThread[-1] = current score, full SocreThread list = historical trend
# 1b. Fixed Vulnerabilities (multi-region: sum FixTotal)
aliyun sas describe-vul-fix-statistics --region cn-shanghai --user-agent AlibabaCloud-Agent-Skills
aliyun sas describe-vul-fix-statistics --region ap-southeast-1 --user-agent AlibabaCloud-Agent-Skills
# 1c. Baseline Risk Statistics (multi-region: sum each Summary field)
aliyun sas get-check-risk-statistics --region cn-shanghai --user-agent AlibabaCloud-Agent-Skills
aliyun sas get-check-risk-statistics --region ap-southeast-1 --user-agent AlibabaCloud-Agent-Skills
# Extract: Summary.RiskCheckCnt, Summary.RiskWarningCnt,
# Summary.HandledCheckTotal, Summary.HandledCheckToday
# Sum each field across regions
# 1d. Handled Alerts (multi-region: sum SuspiciousDealtCount)
aliyun sas get-defence-count --region cn-shanghai --user-agent AlibabaCloud-Agent-Skills
aliyun sas get-defence-count --region ap-southeast-1 --user-agent AlibabaCloud-Agent-Skills# 2a. Service Duration + Subscription (region-agnostic)
aliyun sas describe-version-config --user-agent AlibabaCloud-Agent-Skills
# Check IsPaidUser first:
# IsPaidUser == true → Extract CreateTime, calculate (now - CreateTime) as days
# IsPaidUser == false → Service duration not applicable, display N/A
# Extract: ReleaseTime → subscription expiry (pre-pay only)
# 2b. Host Asset Info (multi-region: sum TotalCount and Cores)
aliyun sas describe-cloud-center-instances \
--region cn-shanghai --machine-types ecs --current-page 1 --page-size 20 \
--user-agent AlibabaCloud-Agent-Skills
aliyun sas describe-cloud-center-instances \
--region ap-southeast-1 --machine-types ecs --current-page 1 --page-size 20 \
--user-agent AlibabaCloud-Agent-Skills
# Extract: PageInfo.TotalCount (sum across regions) for host count
# Extract: Sum all instances' Cores field for total core count
# Optionally list host details if user requests
# 2c. Uninstalled Clients (multi-region: sum TotalCount)
aliyun sas list-uninstall-aegis-machines --region cn-shanghai --current-page 1 --page-size 1 --user-agent AlibabaCloud-Agent-Skills
aliyun sas list-uninstall-aegis-machines --region ap-southeast-1 --current-page 1 --page-size 1 --user-agent AlibabaCloud-Agent-Skillsaliyun sas describe-secure-suggestion --cal-type home_security_score --user-agent AlibabaCloud-Agent-Skills
# Process Suggestions[] by SuggestType:
# SS_AI_RISK → AI Risk (SubType not fixed, e.g. SSI_AISPM_RISK; analyze Description for unknown SubTypes)
# Aggregate riskCount by region
# SS_SAS_CLOUD_HC → CSPM risks (aggregate by HIGH/MEDIUM/LOW and region)
# Cloud: SSI_SAS_CLOUD_HC_HIGH / MEDIUM / LOW
# Host: SSI_SAS_HOST_HC_HIGH / MEDIUM / LOW
# SS_KEY_CONFIG → Key Config (SubType not fixed; analyze Description for unknown SubTypes)
# Aggregate RiskCount by region
# SS_SAS_SYS_VUL → System Vulns (aggregate by HIGH/MEDIUM/LOW and region)
# SSI_SAS_SYS_VUL_HIGH / SSI_SAS_SYS_VUL_MEDIUM / SSI_SAS_SYS_VUL_LOW# Step 1: Get WAF Instance ID (per region)
aliyun waf-openapi describe-instance --region cn-shanghai --user-agent AlibabaCloud-Agent-Skills
aliyun waf-openapi describe-instance --region ap-southeast-1 --user-agent AlibabaCloud-Agent-Skills
# Extract: InstanceId from each region's response
# Step 2: Query WAF flow chart using each region's InstanceId
START_SEC=$(python3 -c "import time; print(int(time.time()-86400*7))")
aliyun waf-openapi describe-flow-chart \
--region cn-shanghai \
--instance-id "<InstanceId from cn-shanghai>" \
--start-timestamp "$START_SEC" \
--interval 3600 \
--user-agent AlibabaCloud-Agent-Skills
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
# Sum all WafBlockSum values from both regions# Currently no data (N/A)# 4a. Host Assets (multi-region)
aliyun sas describe-cloud-center-instances \
--region cn-shanghai --machine-types ecs --current-page 1 --page-size 1 \
--user-agent AlibabaCloud-Agent-Skills
# Extract: PageInfo.TotalCount
aliyun sas describe-field-statistics \
--region cn-shanghai \
--user-agent AlibabaCloud-Agent-Skills
# Extract: GroupedFields.RiskInstanceCount
# Repeat for ap-southeast-1, sum both
# 4b. Container Assets (multi-region)
aliyun sas describe-container-field-statistics \
--region cn-shanghai \
--user-agent AlibabaCloud-Agent-Skills
# Extract: ClusterCount, RiskClusterCount
# Repeat for ap-southeast-1, sum both
# 4c. Cloud Product Assets (multi-region)
aliyun sas get-cloud-asset-summary \
--region cn-shanghai \
--user-agent AlibabaCloud-Agent-Skills
# Extract: GroupedFields.InstanceCountTotal, GroupedFields.InstanceRiskCountTotal
# Repeat for ap-southeast-1, sum both
# 4d. Trend Chart Data (multi-region)
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
# Returns time series: host / container / cloud risk counts# 5a. Query billing mode (from Module 2a response, can reuse cached result)
aliyun sas describe-version-config --user-agent AlibabaCloud-Agent-Skills
# Check IsPaidUser field to determine billing mode:
#
# If IsPaidUser == true → Pre-pay (subscription) user:
# Extract CreateTime → purchase date (convert ms timestamp to YYYY-MM-DD)
# Extract ReleaseTime → expiry date (convert ms timestamp to YYYY-MM-DD)
#
# If IsPaidUser == false → Post-pay user:
# Extract PostPayModuleSwitch (JSON string — must parse)
# Map codes to product names using the table below:
# POST_HOST → Host and Container Security
# VUL → Vulnerability Fixing
# CSPM → CSPM
# CTDR → Agentic SOC
# AGENTLESS → Agentless Detection
# SERVERLESS → Serverless Asset Protection
# RASP → Application Protection
# SDK → Malicious File Detection
# CTDR_STORAGE → Log Management
# ANTI_RANSOMWARE → Anti-ransomware
# Value 1 = Enabled, 0 = Disabled
# 5c. Billing Details (try each region, skip on permission error)
BILLING_CYCLE=$(date +%Y-%m)
aliyun bssopenapi query-bill \
--region cn-shanghai \
--billing-cycle "$BILLING_CYCLE" --product-code sas \
--user-agent AlibabaCloud-Agent-Skills
# If the above returns a permission error, skip cn-shanghai and continue
aliyun bssopenapi query-bill \
--region ap-southeast-1 \
--billing-cycle "$BILLING_CYCLE" --product-code sas \
--user-agent AlibabaCloud-Agent-Skills
# If the above returns a permission error, skip ap-southeast-1 and continue
# Aggregate results from whichever regions succeeded| Product Name | Code | Status Values |
|---|---|---|
| Host and Container Security | | |
| Vulnerability Fixing | | |
| CSPM | | |
| Agentic SOC | | |
| Agentless Detection | | |
| Serverless Asset Protection | | |
| Application Protection | | |
| Malicious File Detection | | |
| Log Management | | |
| Anti-ransomware | | |
cn-shanghaiap-southeast-1JSON.parse()json.loads()ScoreDescribeSecureSuggestionDescribeScreenScoreThreadData.SocreThread[]YYYY-MM-DD HH:mm:sscn-shanghaiap-southeast-1DescribeVersionConfig--cli-query--page-size 1TotalCountListUninstallAegisMachinesDescribeFlowChartDescribeInstancecn-shanghaiap-southeast-1QueryBill--regioncn-shanghaiap-southeast-1| Document | Content |
|---|---|
| references/related-apis.md | Full API and CLI command reference table |
| references/ram-policies.md | Required RAM permissions and policies |
| references/verification-method.md | Step-by-step verification commands |
| references/acceptance-criteria.md | Correct/incorrect CLI patterns |
| references/cli-installation-guide.md | CLI installation guide |
| overview-sop.md | Original SOP document with full data mapping |