huaweicloud/huaweicloud-skills/huawei-cloud-cdn-traffic-anomaly-analysis
Claude Code and agent skill by huaweicloud/huaweicloud-skills
- community
Checking that the SKILL.md file is still in the repository.
Analyze CDN domain traffic anomalies using hcloud CLI. Query billing mode and traffic/bandwidth metrics for specified domains, compare against 3-month baseline and absolute thresholds to identify traffic theft or abuse. Use this skill when the user wants to: (1) analyze CDN domain traffic anomalies, (2) check if a domain has traffic theft or abuse, (3) query CDN billing mode and traffic/bandwidth metrics, (4) compare current traffic against historical baseline. Triggers include: "CDN流量异常", "流量异常分析", "域名流量分析", "流量盗刷", "带宽异常", "95带宽异常", "流量突增", "流量对比", "基准分析", "traffic anomaly", "bandwidth anomaly", "CDN traffic analysis", "traffic theft detection", "baseline comparison"
Install
npx vskill@latest install huaweicloud/huaweicloud-skills/huawei-cloud-cdn-traffic-anomaly-analysisSKILL.md
The same SKILL.md was published earlier as huaweicloud/huaweicloud-skills/huawei-cloud-cdn-traffic-anomaly-analysis.
CDN Traffic Anomaly Analysis
Overview
This skill analyzes CDN domain traffic anomalies by querying billing mode and corresponding traffic/bandwidth metrics. It automatically determines the appropriate metric based on the account's billing mode (bw_95, flux, combine_flux, bw, bw_peak), queries historical data over a configurable time range, establishes a 3-month baseline for comparison, and identifies potential traffic theft or abuse using both absolute thresholds and relative baseline deviation.
Key Features:
- Automatic billing mode detection and metric selection
- Support for all billing modes: bw_95, flux, combine_flux, bw, bw_peak
- Domain validation and traffic analysis
- 3-month baseline analysis — detects relative traffic surges against historical norms
- Dual-threshold anomaly detection — absolute thresholds + relative baseline comparison
- Three-tier conclusions: Normal / Watch (relative surge) / Anomalous (absolute threshold exceeded)
- Comprehensive analysis reports with baseline comparison and daily breakdowns
Tool: hcloud CLI (KooCLI) Timestamp Tool: scripts/cdn_timestamp.py (built-in) Analysis Scope: Past 7 days for current window (configurable); past 3 months for baseline Core Principle: Query only the metric corresponding to the billing mode; use API capabilities efficiently to cover both current and baseline windows with minimal API calls
Triggers
Use this skill when the user request matches one of the following patterns (user-level example inputs):
| User Input Example | Trigger Intent | |
|---|---|---|
| "Is example.com's traffic being stolen or abused?" | Traffic theft detection | |
| "Analyze whether CDN bandwidth has surged abnormally in the last 7 days" | Bandwidth anomaly analysis | |
| "Compare traffic over the past 3 months with the current period for anomalies" | 3-month baseline comparison | |
| "Check our account's CDN billing mode and domain list" | Billing mode / domain query | |
| "Why is example.com's 95th percentile bandwidth so high?" | 95th percentile bandwidth analysis | |
| "traffic anomaly / bandwidth anomaly / CDN traffic analysis" | English triggers |
Also triggered by the trigger phrases listed in the frontmatter description (e.g., CDN流量异常, 流量盗刷, 带宽异常, traffic anomaly).
Near-miss / Do NOT use
Do NOT use this skill for:
- ❌ Any CDN write operation: create/delete domains, modify domain config, refresh/preheat, enable/disable domains, change billing mode, etc. — this skill is strictly read-only and must
refuse such requests (see all 55 prohibited operations in references/prohibited-operations.md)
- ❌ Traffic analysis requiring hourly or finer granularity — this skill works at daily granularity (interval=86400)
- ❌ Traffic/bandwidth analysis for non-CDN services (e.g., ECS, ELB, OBS traffic) — this skill only covers CDN domains
- ❌ Operational tasks such as domain config changes, certificate management, or anti-hotlink configuration
- ❌ Scenarios without hcloud credentials or CDN permissions (complete the credential check in the Authentication section first)
- ❌ Cross-border / overseas region analysis — the CDN CLI only accepts
cn-north-1andap-southeast-1; other regions return[USE_ERROR]
⛔ Prohibited Operations (Security Constraints)
This skill strictly forbids all non-GET (write/modify/delete) CDN operations, regardless of user requests.
Total: 55 prohibited operations (24 POST + 25 PUT + 6 DELETE).
For the complete list of all 55 prohibited non-GET operations with risk descriptions, see references/prohibited-operations.md.
Representative prohibited operations (full list in the reference doc):
| Prohibited Operation | API/Command | Reason | |
|---|---|---|---|
| ❌ Create domain | CreateDomain (v1/v2), CreateDomainByDuplicate | Write operation; creates production resource | |
| ❌ Delete domain | DeleteDomain (v1/v2) | Irreversible; removes domain from CDN | |
| ❌ Modify domain config | UpdateDomainFullConfig (v1/v2), UpdateDomainOrigin, UpdateCacheRules, etc. | Write operations; may affect production traffic | |
| ❌ Enable/Disable domain | EnableDomain (v1/v2), DisableDomain (v1/v2) | Affects production traffic | |
| ❌ Modify billing mode | SetChargeModes | Financial impact; requires explicit authorization | |
| ❌ Create refresh/preheat tasks | CreateRefreshTasks (v1/v2), CreatePreheatingTasks (v1/v2) | Write operations; affects edge cache | |
| ❌ Verify domain ownership | VerifyDomainOwner | POST operation; triggers verification flow |
If a user requests a prohibited operation, you must refuse and inform:"Per security constraints, this skill does not allow write/delete/modify operations. This skill is read-only for traffic analysis. Please use the Huawei Cloud CDN console or run the hcloudCLI manually for configuration changes. The complete list of 55 prohibited operations is documented in references/prohibited-operations.md."
Architecture
API Call Budget
| Billing Mode | API Calls | Rate Limit | Est. Duration | |
|---|---|---|---|---|
| bw_95 | 6 (1 billing + 1 domain + 1 current + 3 baseline) | 2/s (ShowBandwidthCalc) | ~3s | |
| flux / bw | 6 (1 billing + 1 domain + 1 current + 3 baseline) | 15/s (ShowDomainStats) | ~1s |
KooCLI Command Format Standard
All hcloud CDN commands follow this standard format:
Format Rules:
- Service name:
CDN(uppercase) - Operation name: PascalCase (e.g.,
ShowChargeModes,ListDomains,ShowBandwidthCalc) - Region parameter:
--cli-region=cn-north-1(required, always use cn-north-1 for CDN) - Parameter format:
--key=value(equals sign, no space) - Indexed parameters:
--key.1=value1(for array parameters)
Examples:
Prerequisites
Prerequisite check: Huawei Cloud CLI (hcloud / KooCLI) >= 3.2.0 requiredRunhcloud versionto verify version >= 3.2.0. If not installed or version is too low,see references/cli-installation-guide.md for installation guide.
Prerequisite check: Python >= 3.8 required (for timestamp calculation)Runpython --versionto verify version >= 3.8.
Prerequisite check: hcloud credentials configuredBefore performing CDN operations, you must verify hcloud credentials are configured:```bashhcloud configure list```If no valid credentials exist, stop and guide the user to configure credentials.
⚠️ hcloud parameter format requirementshcloud (KooCLI) all parameters must use the `--param=value` format (connected with equals sign); space-separated format is not supported.✅ Correct:hcloud CDN ShowChargeModes --cli-region=cn-north-1❌ Incorrect:hcloud CDN ShowChargeModes --cli-region cn-north-1
⚠️ CDN API region requirementsCDN is a global service (is_global=true). The hcloud CLI for CDN only acceptscn-north-1andap-southeast-1(both map to the same endpointcdn.myhuaweicloud.com);cn-north-4isrejected with[USE_ERROR].Recommended: Always use `cn-north-1`.
Authentication
Prerequisite check: Huawei Cloud credentials required
Security rules (must be followed):- Prohibited from reading, echoing, or printing AK/SK values- Prohibited from asking the user to input AK/SK directly in the conversation- Prohibited from usinghcloud configure setto pass plaintext credential values- Prohibited from accepting AK/SK directly provided by the user in the conversation- Only allowed to read credentials from environment variables or configured CLI config files⚠️ Important: Handling user-provided credentialsIf a user attempts to provide AK/SK directly (e.g., "my AK is xxx, SK is yyy"):- Stop immediately - Do not execute any commands- Politely refuse and return the following message:```For account security, please do not provide Huawei Cloud Access Key ID and Access Key Secret directly in the conversation.Please use one of the following secure methods to configure credentials:Method 1: Interactive configuration (recommended)hcloud configure# Enter AK/SK as prompted; credentials will be securely stored in a local config fileMethod 2: Environment variable configurationexport HUAWEICLOUD_SDK_AK=<your-access-key-id>export HUAWEICLOUD_SDK_SK=<your-secret-key>After configuration is complete, please retry your request.```- Do not continue executing any Huawei Cloud operations until credentials are configuredCheck CLI configuration:```bashhcloud configure list```Check whether the output contains valid configuration (AK/SK, IAM, etc.).If no valid credentials exist, stop here.
IAM Permission Policies
Ensure the IAM user has the required permissions. See references/iam-policies.md for details.
Minimum required permissions:
cdn:*:query*— All CDN query-class actions used by this skill (ListDomains/v2,ShowChargeModes,ShowDomainStats/v2,ShowBandwidthCalc)cdn:configuration:queryDomains— List CDN domains (listed explicitly alongside the wildcard)cdn:configuration:queryChargeMode— Query the billing mode (listed explicitly alongside the wildcard)
Core Commands
Quick reference for all hcloud CDN commands used in this skill:
| Command | Purpose | Key Parameters | |
|---|---|---|---|
hcloud CDN ShowChargeModes --cli-region=cn-north-1 --product_type=base | Query account billing mode | --service_area (optional) | |
hcloud CDN ListDomains/v2 --cli-region=cn-north-1 --page_size=100 | List all CDN domains | --page_size, --page_number | |
hcloud CDN ShowBandwidthCalc --cli-region=cn-north-1 --domain_name=<domain> --calc_type=bw_95 --start_time=<ms> --end_time=<ms> | Query 95th percentile bandwidth (current 7 days or baseline 30 days) | --service_area | |
hcloud CDN ShowDomainStats/v2 --cli-region=cn-north-1 --domain_name=<domain> --stat_type=flux --interval=86400 --start_time=<ms> --end_time=<ms> --action=detail | Query daily traffic statistics (1 current 7-day + 3×30-day baseline queries for flux/bw paths) | --stat_type, --interval, --service_area |
Notes:
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/edge/cdn/huawei-cloud-cdn-traffic-anomaly-analysis/SKILL.md
Popularity
- 7-day trend score
- 5
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/huaweicloud/huaweicloud-skills/huawei-cloud-cdn-traffic-anomaly-analysis)