← 返回 Skills 市场
sdk-team

Alibabacloud Waf Cname Config Export

作者 alibabacloud-skills-team · GitHub ↗ · v0.0.1 · MIT-0
cross-platform ⚠ suspicious
32
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install alibabacloud-waf-cname-config-export
功能描述
Batch export Alibaba Cloud WAF 3.0 CNAME-based domain configuration to Excel. Use when the user needs "export WAF domain config", "WAF onboarding checklist",...
使用说明 (SKILL.md)

Alibaba Cloud WAF 3.0 CNAME Domain Configuration Batch Export

Batch query all CNAME-based domain configurations under WAF 3.0 instances and generate a structured Excel file for configuration audit, delivery documentation, and inspection reports.

Architecture: WAF 3.0 InstanceCNAME Domains (DescribeDomains)Domain Config: Listen + Redirect + Cert (DescribeDomainDetail)Excel Export

Site and Instance Types

Dimension Chinese Mainland Instance Non-Chinese Mainland Instance
RegionId cn-hangzhou ap-southeast-1
Endpoint wafopenapi.cn-hangzhou.aliyuncs.com wafopenapi.ap-southeast-1.aliyuncs.com

A single account can have both instance types. Export must query both RegionIds and merge results.

Installation

Pre-check: Aliyun CLI >= 3.3.3 required

Run aliyun version to verify >= 3.3.3. If not installed, see references/cli-installation-guide.md.

Pre-check: Aliyun CLI plugin update required

aliyun configure set --auto-plugin-install true
aliyun plugin update

Python dependency (pinned version for reproducibility):

pip install openpyxl==3.1.5

Authentication

Pre-check: Alibaba Cloud Credentials Required

Security Rules:

  • NEVER read, echo, or print AK/SK values
  • NEVER ask the user to input AK/SK directly
  • NEVER use aliyun configure set with literal credential values
  • ONLY use aliyun configure list to check credential status
aliyun configure list

If no valid profile exists, STOP here.

  1. Obtain credentials from Alibaba Cloud Console
  2. Configure credentials outside of this session
  3. Return and re-run after aliyun configure list shows a valid profile

International site users must configure a separate profile (e.g., aliyun configure --profile intl). Chinese mainland and International site AKs are NOT interchangeable.

RAM Policy

Action Description
yundun-waf:DescribeInstance Query WAF instance info
yundun-waf:DescribeDomains Query domain list
yundun-waf:DescribeDomainDetail Query domain detailed config

Recommended: attach system policy AliyunYundunWAFReadOnlyAccess.

Full RAM policy list: see references/ram-policies.md

[MUST] Permission Failure Handling: When any command or API call fails due to permission errors at any point during execution, follow this process:

  1. Read references/ram-policies.md to get the full list of permissions required by this SKILL
  2. Use ram-permission-diagnose skill to guide the user through requesting the necessary permissions
  3. Pause and wait until the user confirms that the required permissions have been granted

Parameter Confirmation

IMPORTANT: Parameter Confirmation — Before executing any command or API call, ALL user-customizable parameters (e.g., RegionId, instance names, CIDR blocks, passwords, domain names, resource specifications, etc.) MUST be confirmed with the user. Do NOT assume or use default values without explicit user approval.

Parameter Required/Optional Description Default Value
RegionId Auto Query both regions (cn-hangzhou + ap-southeast-1) Both
InstanceId Auto Auto-discovered via DescribeInstance
CLI Profile Optional Uses default profile; add --profile \x3Cname> if user specifies default
Output File Auto Fixed filename with timestamp waf_cname_config_export_YYYYMMDD_HHMMSS.xlsx

Core Workflow

At the start of the Core Workflow (before any CLI invocation): [MUST] Enable AI-Mode — AI-mode is required for Agent Skill execution.

aliyun configure ai-mode enable
aliyun configure ai-mode set-user-agent --user-agent "AlibabaCloud-Agent-Skills/alibabacloud-waf-cname-config-export"

Step 1: Auto-discover WAF Instances

[MUST] Query BOTH regions unconditionally. Even if the user states they "only have domestic" / "only have overseas" / "only use one region", you MUST still execute both commands below. User assertions about instance distribution are NOT a reason to skip either region. Discovery is the only authoritative source.

aliyun waf-openapi describe-instance --region cn-hangzhou
aliyun waf-openapi describe-instance --region ap-southeast-1

If the response contains a non-empty InstanceId, the instance exists. International site users add --profile intl.

Step 2: Batch Query Domain List

aliyun waf-openapi describe-domains \
  --region cn-hangzhou \
  --instance-id \x3CInstanceId> \
  --page-number 1 \
  --page-size 50

Pagination: loop PageNumber when TotalCount > 50.

Step 3: Query Detailed Config for Each Domain

aliyun waf-openapi describe-domain-detail \
  --region cn-hangzhou \
  --instance-id \x3CInstanceId> \
  --domain \x3CDomainName>

Returns Listen (HttpPorts/HttpsPorts/TLSVersion/CipherSuite/Http2Enabled/CertId) and Redirect (BackendList/BackupBackends/Loadbalance/SniEnabled/SniHost/Timeouts).

[MUST] Always call DescribeDomainDetail at least once per discovered instance. Iterate the domain list from Step 2 and call this API for every domain. If Step 2 returns an empty list (TotalCount == 0) for a given instance, you MUST still issue one describe-domain-detail call against that instance using a placeholder domain (e.g. --domain none) to verify API reachability and permissions, then record "no domains" and continue. Do NOT skip this step based on an empty list.

Step 4: Generate Excel Export

One sheet per region ("Chinese Mainland" / "Non-Chinese Mainland"). 18 columns: Domain, CNAME, Status, HTTP Ports, HTTPS Ports, Backends, Backup Backends, Load Balancing, TLS Version, HTTP/2, Cert ID, SNI, SNI Host, Connect Timeout(s), Read Timeout(s), Write Timeout(s), Force HTTP Backend, Resource Group.

[MUST] Use the bundled script — this is the ONLY allowed execution path:

python scripts/alibabacloud_waf_cname_config_export.py

Do NOT rewrite, inline, or reimplement the export logic in your own Python code. The bundled script encapsulates the correct 18-column schema, per-region sheet layout, pagination, and field-name conventions. If the script fails, diagnose the failure (missing openpyxl==3.1.5, credential issues, etc.) and fix the root cause — do NOT fall back to ad-hoc code.

Field name notes: Load balancing is Redirect.Loadbalance (not LoadBalanceType). Backend IP list is Redirect.BackendList (string array). Cert ID is at Listen.CertId.

Step 5: Disable AI-Mode

[MUST] Disable AI-Mode at EVERY exit point — Before delivering the final response for ANY reason, always disable AI-mode first.

aliyun configure ai-mode disable

Success Verification

See references/verification-method.md for detailed verification steps.

  1. Excel file opens with one sheet per region
  2. Each sheet has 18 column headers and data intact
  3. Domain count per sheet matches WAF console display
  4. Spot-check 2-3 domains against console for CNAME and backend config accuracy

Cleanup

No resources created — no cleanup needed.

Best Practices

  1. Always query both regions to avoid missing dual-instance scenarios
  2. Set PageSize to 50 (maximum) to reduce request count
  3. Add at least 200ms delay between requests (time.sleep(0.2)) to prevent throttling
  4. Non-CNAME domains may have empty CNAME fields; label them accordingly
  5. Chinese mainland and International site CLI profiles must be configured separately

References

Topic Link
CLI Commands See references/related-commands.md
RAM Policies See references/ram-policies.md
Verification Method See references/verification-method.md
Acceptance Criteria See references/acceptance-criteria.md
CLI Installation See references/cli-installation-guide.md
DescribeDomains API https://help.aliyun.com/zh/waf/web-application-firewall-3-0/developer-reference/api-waf-openapi-2021-10-01-describedomains
DescribeDomainDetail API https://help.aliyun.com/zh/waf/web-application-firewall-3-0/developer-reference/api-waf-openapi-2021-10-01-describedomaindetail
DescribeInstance API https://help.aliyun.com/zh/waf/web-application-firewall-3-0/developer-reference/api-waf-openapi-2021-10-01-describeinstance
安全使用建议
Install only if you are comfortable granting read access to Alibaba Cloud WAF configuration. Prefer short-lived or least-privileged RAM credentials, avoid putting real access keys directly in shell commands or logs, review where the Excel export will be saved, and handle the exported file as sensitive infrastructure data.
能力标签
requires-walletrequires-sensitive-credentials
能力评估
Purpose & Capability
Exporting WAF CNAME configuration is coherent with the apparent purpose, but the exported fields can reveal domains, backend targets, certificate identifiers, ports, SNI settings, and resource groups, and the artifacts do not clearly warn users about that sensitivity before writing the spreadsheet.
Instruction Scope
The skill directs shell, Alibaba Cloud CLI, and bundled Python-script use without clear capability scoping, and the script reportedly performs a detail API call with a fake domain when there are no domains to export, which is not necessary for the stated export workflow.
Install Mechanism
No malicious installer behavior is evident, but the installation guide includes credential setup patterns that may expose or persist Alibaba Cloud access keys without placing clear warnings next to those examples.
Credentials
Alibaba Cloud API access is expected for this purpose, but the combination of cloud credentials, debug logging guidance, and local export of sensitive WAF configuration is under-disclosed for an agent-run skill.
Persistence & Privilege
There is no evidence of background persistence, privilege escalation, or destructive behavior, but credentials may be stored in the local Alibaba Cloud CLI profile and sensitive WAF data is written to a local Excel file.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install alibabacloud-waf-cname-config-export
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /alibabacloud-waf-cname-config-export 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v0.0.1
Initial release of Alibaba Cloud WAF 3.0 CNAME domain configuration batch export. - Enables batch export of all CNAME-based WAF domain configurations to a structured Excel file. - Queries and merges configurations from both Chinese Mainland (`cn-hangzhou`) and Non-Chinese Mainland (`ap-southeast-1`) WAF instances. - Automatically discovers all WAF 3.0 instances and their domains; retrieves detailed config for audit and report purposes. - Uses a bundled Python script to generate Excel files with standardized 18-column schema, one sheet per region. - Strictly enforces credential, permission, and parameter confirmation best practices before any execution. - AI-mode enable/disable steps integrated to comply with Agent Skill requirements.
元数据
Slug alibabacloud-waf-cname-config-export
版本 0.0.1
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

Alibabacloud Waf Cname Config Export 是什么?

Batch export Alibaba Cloud WAF 3.0 CNAME-based domain configuration to Excel. Use when the user needs "export WAF domain config", "WAF onboarding checklist",... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 32 次。

如何安装 Alibabacloud Waf Cname Config Export?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install alibabacloud-waf-cname-config-export」即可一键安装,无需额外配置。

Alibabacloud Waf Cname Config Export 是免费的吗?

是的,Alibabacloud Waf Cname Config Export 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Alibabacloud Waf Cname Config Export 支持哪些平台?

Alibabacloud Waf Cname Config Export 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Alibabacloud Waf Cname Config Export?

由 alibabacloud-skills-team(@sdk-team)开发并维护,当前版本 v0.0.1。

💬 留言讨论