编程

Alibabacloud Cloudfw Vpc Firewall Diagnosis

试用

Diagnose Alibaba Cloud Cloud Firewall VPC firewall provisioning failures, route policy configuration failures, and closure pre-check risks using read-only Cl...

它能做什么

Diagnose Alibaba Cloud Cloud Firewall VPC firewall provisioning failures, route policy configuration failures, and closure pre-check risks using read-only CloudFirewall, CBN, VPC, STS, and ActionTrail APIs. Use this skill when troubleshooting VPC firewall creation failures, route policy/drainage configuration failures, firewall status stuck in configuring, or assessing route and ACL impact before closing VPC firewall drainage.

技能文档

VPC Firewall Provisioning Failure Diagnosis

Prerequisites

CLI Tool

  • aliyun-cli version: >= 3.3.0.
  • Validation: aliyun version.

Python Runtime

  • Python version: Python 3.6+ for scripts/analyze_routes.py and scripts/closure_precheck.py.
  • Dependencies: Standard library only (json, subprocess, sys).

Alibaba Cloud Credentials

Configure a CLI profile with aliyun configure, then pass credentials through --profile in every command.

aliyun configure --profile 
# Enter AccessKey ID, AccessKey Secret, Region, and output format as prompted.

Never hardcode AccessKey values in commands, scripts, or documentation. See references/profile_setup_guide.md.

Required RAM Permissions

This skill is a read-only diagnostic tool. Grant only the minimum read-only actions below.

ActionPurpose
cloudfw:DescribeTrFirewallsV2ListQuery VPC firewall list and key status fields.
cloudfw:DescribeVpcFirewallListQuery VPC boundary firewall information.
cloudfw:DescribeVpcFirewallPrecheckDetailQuery precheck details. This API uses --Region, not --RegionId.
cloudfw:DescribeFirewallTaskQuery drainage task status and ErrorDetail.
cloudfw:DescribeTrFirewallPolicyBackUpAssociationListQuery the rollback target route table.
cloudfw:DescribeVpcFirewallControlPolicyQuery VPC firewall ACL policies.
actiontrail:LookupEventsQuery recent operation history.
cbn:ListTransitRoutersQuery transit routers under a CEN instance.
cbn:ListTransitRouterRouteTablesQuery transit router route tables.
cbn:ListTransitRouterRouteEntriesQuery route entries for route comparison.
cbn:ListTransitRouterVpcAttachmentsQuery VPC attachments.
vpc:DescribeVpcs / vpc:DescribeVpcAttributeQuery VPC basic attributes.
sts:GetCallerIdentityValidate profile identity.

Full permission details are documented in references/ram-policies.md.

User-Agent Requirement

All Alibaba Cloud service calls must include:

--user-agent AlibabaCloud-Agent-Skills/alibabacloud-cloudfw-vpc-firewall-diagnosis

Alibaba Cloud CLI AI-Mode and Plugin Update

Before running any Alibaba Cloud service CLI command in this skill, initialize CLI AI-Mode and refresh plugins:

aliyun configure ai-mode enable
aliyun configure ai-mode set-user-agent --user-agent AlibabaCloud-Agent-Skills/alibabacloud-cloudfw-vpc-firewall-diagnosis
aliyun plugin update

After the diagnostic workflow ends, disable AI-Mode:

aliyun configure ai-mode disable

Rules:

  • AI-Mode is enabled only for the diagnostic workflow and must be disabled after completion.
  • set-user-agent must use the full skill identifier: AlibabaCloud-Agent-Skills/alibabacloud-cloudfw-vpc-firewall-diagnosis.
  • plugin update is a local/system CLI command and must be run before service API calls to ensure lowercase-hyphenated plugin actions are current; do not add --user-agent to this system command.
  • Local-only environment commands such as aliyun version, aliyun configure list, and python3 --version do not call Alibaba Cloud service APIs and do not require the User-Agent flag.

Environment Validation

Run these read-only checks before diagnosis:

aliyun version
aliyun configure list
aliyun sts get-caller-identity --profile  --user-agent AlibabaCloud-Agent-Skills/alibabacloud-cloudfw-vpc-firewall-diagnosis
python3 --version

Mandatory Execution Rules

Before every execution:

  1. Read this complete SKILL.md.
  2. Read references/execution_standards.md.
  3. Identify the applicable scenario.
  4. Follow the scenario flow exactly; do not skip mandatory steps.

Core Principle: Read-Only Diagnosis

This skill is a read-only diagnostic assistant.

Absolutely Forbidden

  1. Never execute create, modify, delete, attach, detach, enable, disable, or any configuration-changing operation.
  2. Never provide complete executable write commands with concrete parameter values.
  3. Never modify Alibaba Cloud resources.
  4. Never hardcode credentials or profile names.

Correct Remediation Style

  • Provide text-only configuration guidance.
  • List required configuration fields and console navigation paths.
  • Explain risks, dependencies, and verification points.
  • Let the user perform all configuration changes manually in the console or their own approved workflow.

Standard Report Declaration

Every diagnostic report must start with:

Notice: This tool is a read-only diagnostic assistant. It only provides analysis and configuration guidance and will not perform any configuration changes.
Please apply all configuration changes manually in the Alibaba Cloud Console or through your own approved process.

Allowed Command Categories

  • AI-Mode setup commands: aliyun configure ai-mode enable, aliyun configure ai-mode set-user-agent, aliyun plugin update, and final aliyun configure ai-mode disable.
  • aliyun cloudfw describe-* read-only queries.
  • aliyun cbn list-* and aliyun cbn describe-* read-only queries.
  • aliyun actiontrail lookup-events read-only operation history queries.
  • aliyun sts get-caller-identity identity validation.
  • Environment checks: aliyun version, aliyun configure list, python3 --version.
  • Local read-only inspection commands such as cat, ls, grep, find, pwd, which, date, stat, and file.
  • Bundled read-only scripts: scripts/analyze_routes.py and scripts/closure_precheck.py.

Any Bash command that does not match the whitelist must return permissionDecision=ask.

Required User Inputs

Collect all information at once before diagnosis:

  1. CLI profile name, for example default.
  2. Whether the case is cross-region.
  3. CEN instance ID.
  4. Region ID when cross-region is involved, for example cn-hangzhou.
  5. Problem type: creation failure, route policy configuration failure, or closure pre-check.

Do not proceed until the required inputs are confirmed.

Closure Pre-check Iron Rules

  • Never compare routes manually.
  • Always save route table JSON outputs and run scripts/analyze_routes.py.
  • Never infer route safety from TotalCount alone.
  • Generate the final route risk conclusion from script output.

Detailed flow: references/closure_precheck_guide.md.

Scenario Quick Reference

Scenario 1: VPC Firewall Creation Failed

First query describe-tr-firewalls-v2-list, then check PrecheckStatus, ResultCode, and firewall status fields. See references/diagnosis_steps.md.

Scenario 2: Route Policy Configuration Failed

First query describe-firewall-task with --TaskType VPC and --ChildInstanceId . See references/diagnosis_steps.md.

Scenario 3: Closure Pre-check, Auto-Drainage Mode

Identify the mode, get OriginalRouteTableId, run scripts/analyze_routes.py, check ACL policies, and assess risk.

Scenario 4: Closure Pre-check, Manual-Drainage Mode

Collect current and target route table IDs, run scripts/analyze_routes.py, check ACL policies, and assess risk.

Strict Prohibitions

  • Never skip the scenario's first mandatory API.
  • Never query logs older than 24 hours unless the user explicitly requests a wider range.
  • Never use DescribeFirewallV2List; this API is invalid for this skill.
  • Never rely on precheck results alone. Use ErrorDetail and ActionTrail as final evidence.
  • Never rely on memory or external historical knowledge for diagnostic logic. This skill must be self-contained.

Key APIs and CLI Actions

APICLI actionServiceRequired parametersPurpose
DescribeTrFirewallsV2Listdescribe-tr-firewalls-v2-listcloudfw--RegionIdQuery VPC firewall list.
DescribeFirewallTaskdescribe-firewall-taskcloudfw--TaskType VPC, --ChildInstanceId Query route policy task status.
DescribeTrFirewallPolicyBackUpAssociationListdescribe-tr-firewall-policy-back-up-association-listcloudfw--FirewallId, --TrFirewallRoutePolicyIdQuery rollback target route table.
DescribeVpcFirewallControlPolicydescribe-vpc-firewall-control-policycloudfw--VpcFirewallId, --PageSize, --CurrentPageQuery ACL policies.
LookupEventslookup-eventsactiontrail--StartTime, --EndTime, --LookupAttribute.1.Key, --LookupAttribute.1.ValueQuery operation history.
ListTransitRouterRouteTableslist-transit-router-route-tablescbn--RegionId, --TransitRouterIdQuery route tables.
ListTransitRouterRouteEntrieslist-transit-router-route-entriescbn--TransitRouterRouteTableIdQuery route entries.

Critical notes:

  • DescribeVpcFirewallPrecheckDetail uses --Region, not --RegionId.
  • ListTransitRouterRouteEntries does not require --TransitRouterId.
  • LookupEvents uses dot notation: --LookupAttribute.1.Key.
  • All Alibaba Cloud service CLI commands must include --user-agent AlibabaCloud-Agent-Skills/alibabacloud-cloudfw-vpc-firewall-diagnosis.
  • Local/system commands such as aliyun version, aliyun configure list, aliyun configure ai-mode enable/disable, and aliyun plugin update must not add the User-Agent flag.
  • AI-Mode must be enabled before diagnosis, configured with the skill User-Agent, and disabled after the workflow.
  • CLI profile option is lowercase: --profile.

Output Format

For failure scenarios, report: root cause, evidence, and recommended remediation. For closure pre-check scenarios, report: route rollback risk, ACL policy risk, recommended manual actions, and verification points. Keep evidence concise and avoid exposing full resource inventories or sensitive identifiers unless needed for diagnosis.

References

  • Closure Pre-check Guide
  • Complete Diagnosis Steps
  • Diagnosis Rules
  • Full API Reference
  • Firewall Lifecycle
  • Execution Standards

相关技能

Alibaba Cloud Cloud Firewall ACL rule read-only diagnostic assistant. **Trigger Scenarios**: Diagnose ACL rules not taking effect, troubleshoot Internet/NAT/...

9 次安装

Manage Alibaba Cloud Cloud Firewall (Cloudfw) via OpenAPI/SDK. Use whenever the user requests firewall policy/resource operations, change management, status...

61 次安装

Manage Alibaba Cloud Firewall (CFW) NAT Firewall (NAT boundary firewall): query firewalls and protection status, enable/disable the protection switch, assess which NAT gateways can be protected and produce a plan, run the creation pre-check, diagnose route-entry inconsistency (route-diff), prepare manual-mode diversion assets, create a firewall (auto or manual vswitch diversion), and change engine strict mode. Deleting/releasing a firewall is NOT supported: protection can be switched off, but the resource must be released by the user in the console. Use when users mention NAT firewall, NAT boundary firewall, NAT gateway protection, protecting private-network outbound traffic, opening/closing the NAT firewall switch, assessing how to enable protection, or diagnosing creation failures from inconsistent custom route entries. 管理阿里云云防火墙(CFW)NAT边界防火墙:查询防火墙与防护状态、开启/关闭防护开关、开墙评估与开墙方案、 创建预检查、路由条目不一致诊断、手动引流准备、创建NAT防火墙、修改引擎模式。不支持删除/释放防火墙, 需用户在控制台自行操作。适用于NAT防火墙、NAT网关防护、私网出方向防护、开关NAT墙、开墙评估等场景。

Use when managing Alibaba Cloud Cloud Firewall (Cloudfw) via OpenAPI/SDK, including the user requests firewall policy/resource operations, change management,...

12 次安装

Alicloud DNS Diagnostic Skill (Read-Only). Diagnostic tool for domain unreachable, DNS resolution failure, DNS record not taking effect, NXDOMAIN, unknownhost, and other DNS-layer issues. Automatically performs WHOIS lookup, recursive tracing, OpenAPI config verification, and nationwide probing via boce to generate diagnostic reports. Covers Alibaba Cloud DNS, GTM, PrivateZone, and third-party DNS. This skill is read-only and will NOT execute any Create, Update, Delete, or other write operations. Triggers: "DNS resolution failed", "domain unreachable", "DNS not working", "NXDOMAIN", "domain ping failed", "DNS diagnose", "quick check", "快速检查", "DNS record check", "记录解析", "DNS resolution status", "解析状态", "check A/CNAME/MX/TXT record"

1 次安装