huaweicloud/huaweicloud-skills/huawei-cloud-cdn-traffic-anomaly-analysis

Claude Code and agent skill by huaweicloud/huaweicloud-skills

Trust tier 3
  • community
Source check pending

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-analysis

SKILL.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 ExampleTrigger 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-1 and ap-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 OperationAPI/CommandReason
❌ Create domainCreateDomain (v1/v2), CreateDomainByDuplicateWrite operation; creates production resource
❌ Delete domainDeleteDomain (v1/v2)Irreversible; removes domain from CDN
❌ Modify domain configUpdateDomainFullConfig (v1/v2), UpdateDomainOrigin, UpdateCacheRules, etc.Write operations; may affect production traffic
❌ Enable/Disable domainEnableDomain (v1/v2), DisableDomain (v1/v2)Affects production traffic
❌ Modify billing modeSetChargeModesFinancial impact; requires explicit authorization
❌ Create refresh/preheat tasksCreateRefreshTasks (v1/v2), CreatePreheatingTasks (v1/v2)Write operations; affects edge cache
❌ Verify domain ownershipVerifyDomainOwnerPOST 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 hcloud
CLI manually for configuration changes. The complete list of 55 prohibited operations is documented in references/prohibited-operations.md."

Architecture

CDN Traffic Anomaly Analysis
├── ShowChargeModes (Query account billing mode)
├── ListDomains/v2 (List all CDN domains)
├── Domain Validation (Verify target domain exists)
├── TimestampCalculation (scripts/cdn_timestamp.py)
│ ├── Current window (default 7 days, UTC+8 midnight)
│ └── Baseline windows (3 × 30-day windows, non-overlapping)
├── QueryMetrics (Based on billing mode)
│ ├── bw_95 → ShowBandwidthCalc
│ │ ├── Current: 1 call (7-day single aggregate)
│ │ └── Baseline: 3 calls (30-day aggregates each)
│ └── flux/bw → ShowDomainStats/v2 (stat_type=flux or bw)
│ ├── Current: 1 call (7-day window, interval=86400)
│ └── Baseline: 3 calls (30-day windows each, interval=86400)
└── ThresholdJudgment (Dual-threshold: absolute + baseline-relative)
├── ⚠️ Anomalous: exceeds absolute threshold
├── 👀 Watch: exceeds baseline × multiplier (sub-threshold surge)
└── ✅ Normal: neither threshold triggered
API Call Budget
Billing ModeAPI CallsRate LimitEst. Duration
bw_956 (1 billing + 1 domain + 1 current + 3 baseline)2/s (ShowBandwidthCalc)~3s
flux / bw6 (1 billing + 1 domain + 1 current + 3 baseline)15/s (ShowDomainStats)~1s

KooCLI Command Format Standard

All hcloud CDN commands follow this standard format:

bash
hcloud CDN <Operation> --cli-region=cn-north-1 [--parameter=value ...]

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:

bash
# Correct
hcloud CDN ShowChargeModes --cli-region=cn-north-1 --product_type=base
hcloud CDN ListDomains/v2 --cli-region=cn-north-1 --page_size=100
# Incorrect (space instead of equals sign)
hcloud CDN ShowChargeModes --cli-region cn-north-1

Prerequisites

Prerequisite check: Huawei Cloud CLI (hcloud / KooCLI) >= 3.2.0 required
Run hcloud version to verify version >= 3.2.0. If not installed or version is too low,
see references/cli-installation-guide.md for installation guide.
bash
hcloud version
Prerequisite check: Python >= 3.8 required (for timestamp calculation)
Run python --version to verify version >= 3.8.
bash
python --version
Prerequisite check: hcloud credentials configured
Before performing CDN operations, you must verify hcloud credentials are configured:
```bash
hcloud configure list
```
If no valid credentials exist, stop and guide the user to configure credentials.
⚠️ hcloud parameter format requirements
hcloud (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 requirements
CDN is a global service (is_global=true). The hcloud CLI for CDN only accepts cn-north-1 and ap-southeast-1 (both map to the same endpoint cdn.myhuaweicloud.com); cn-north-4 is
rejected 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 using hcloud configure set to 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 credentials
If 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 file
Method 2: Environment variable configuration
export 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 configured
Check CLI configuration:
```bash
hcloud 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:

CommandPurposeKey Parameters
hcloud CDN ShowChargeModes --cli-region=cn-north-1 --product_type=baseQuery account billing mode--service_area (optional)
hcloud CDN ListDomains/v2 --cli-region=cn-north-1 --page_size=100List 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=detailQuery 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

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
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/huaweicloud/huaweicloud-skills/huawei-cloud-cdn-traffic-anomaly-analysis/badge)](https://verified-skill.com/skills/huaweicloud/huaweicloud-skills/huawei-cloud-cdn-traffic-anomaly-analysis)

Something wrong with this skill or its page? Tell us.