alibabacloud-ddos-security-monitor
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseDDoS Security Product Inspection & Monitoring
DDoS安全产品巡检与监控
This skill performs security inspection on DDoS security products under an Alibaba Cloud account, entirely through Aliyun CLI direct OpenAPI calls without any scripts or SDKs.
Architecture:
antiddos-public (Basic Protection) + ddosbgp (Native Protection) + ddoscoo (Anti-DDoS Pro/Premium) -> CLI OpenAPI -> Inspection Report本Skill通过Aliyun CLI直接调用OpenAPI,无需任何脚本或SDK,对阿里云账号下的DDoS安全产品执行安全巡检。
架构:
antiddos-public (Basic Protection) + ddosbgp (Native Protection) + ddoscoo (Anti-DDoS Pro/Premium) -> CLI OpenAPI -> 巡检报告Product & API Overview
产品与API概述
| Product | CLI Code | Use Case |
|---|---|---|
| DDoS Basic Protection | | Default free protection for ECS/SLB, Region param: |
| DDoS Native Protection | | Paid upgrade, native IP-level protection, Region param: |
| DDoS Anti-DDoS Pro/Premium | | Dedicated Anti-DDoS IP, L4/L7 protection, Region param: |
[MUST] Strict product routing isolation: APIs of the three products MUST NEVER be mixed. NEVER substituteAPIs forddoscooqueries or vice versa. If mixing is detected, abort immediately.ddosbgp[MUST] ddosbgp endpoint routing:default endpoint does NOT support mainland China Regions. You MUST specifyddosbgp describe-instance-listfor ALL--endpoint ddosbgp.cn-hangzhou.aliyuncs.comcalls.describe-instance-list[MUST] Easily confused API warning:
Scenario Correct Command Wrong Command (FORBIDDEN) Native Protection attack events (singular)ddosbgp describe-ddos-eventddoscoo describe-ddos-eventsAnti-DDoS Pro attack events (plural)ddoscoo describe-ddos-eventsddosbgp describe-ddos-event
| 产品 | CLI代码 | 适用场景 |
|---|---|---|
| DDoS Basic Protection | | ECS/SLB默认免费防护,地域参数: |
| DDoS Native Protection | | 付费升级产品,原生IP级防护,地域参数: |
| DDoS Anti-DDoS Pro/Premium | | 专用DDoS高防IP,L4/L7防护,地域参数: |
[必须] 严格的产品路由隔离:三类产品的API绝对不能混用。绝不能用API替代ddoscoo查询,反之亦然。若检测到混用,立即终止操作。ddosbgp[必须] ddosbgp端点路由:默认端点不支持中国大陆地域。所有ddosbgp describe-instance-list调用必须指定describe-instance-list。--endpoint ddosbgp.cn-hangzhou.aliyuncs.com[必须] 易混淆API警告:
场景 正确命令 错误命令(禁止使用) 原生防护攻击事件 (单数)ddosbgp describe-ddos-eventddoscoo describe-ddos-events高防IP专业版攻击事件 (复数)ddoscoo describe-ddos-eventsddosbgp describe-ddos-event
Pre-checks
预检查
Aliyun CLI >= 3.3.3 required — see CLI Installation Guide. Credentials required — see CLI Credential Setup. Runto verify. RAM permissions — see RAM Permission Policies.aliyun configure list[MUST] Permission Failure Handling: On permission errors: 1) Read2) Usereferences/ram-policies.mdskill 3) Pause until user confirms permissions granted.ram-permission-diagnose[MUST] AI-Mode lifecycle — Enable before any CLI invocation, disable at EVERY exit point:bashaliyun configure ai-mode enable aliyun configure ai-mode set-user-agent --user-agent "AlibabaCloud-Agent-Skills/alibabacloud-ddos-security-monitor"
需Aliyun CLI >= 3.3.3 — 详见CLI安装指南。 需配置凭证 — 详见CLI凭证设置。运行验证。 RAM权限 — 详见RAM权限策略。aliyun configure list[必须] 权限失败处理:遇到权限错误时:1) 阅读2) 使用references/ram-policies.mdSkill 3) 暂停操作直至用户确认权限已授予。ram-permission-diagnose[必须] AI-Mode生命周期:在任何CLI调用前启用,在所有退出点禁用:bashaliyun configure ai-mode enable aliyun configure ai-mode set-user-agent --user-agent "AlibabaCloud-Agent-Skills/alibabacloud-ddos-security-monitor"
Parameter Confirmation
参数确认
IMPORTANT: ALL user-customizable parameters MUST be confirmed with the user before execution.
| Parameter | Required/Optional | Description | Default |
|---|---|---|---|
| Inspection product scope | Optional | Basic/Native/Anti-DDoS Pro, default all | All |
| Time range | Optional | Inspection time window | Last 24 hours |
| Comparison mode | Optional | Day-over-day / week-over-week / custom | Day-over-day |
| Basic Protection instance-type | Optional | ecs/slb/eip/ipv6/swas/waf/ga_basic | ecs |
重要说明:所有用户可自定义的参数必须在执行前与用户确认。
| 参数 | 必填/可选 | 描述 | 默认值 |
|---|---|---|---|
| 巡检产品范围 | 可选 | Basic/Native/Anti-DDoS Pro,默认全部 | 全部 |
| 时间范围 | 可选 | 巡检时间窗口 | 最近24小时 |
| 对比模式 | 可选 | 同比/环比/自定义 | 同比 |
| Basic Protection实例类型 | 可选 | ecs/slb/eip/ipv6/swas/waf/ga_basic | ecs |
Region Strategy
地域策略
[MUST] ddosbgp Region traversal (dynamic + hardcoded fallback):
- Hardcoded baseline (12 Regions, MUST NOT be reduced):
cn-hangzhou cn-shanghai cn-beijing cn-shenzhen cn-hongkong ap-southeast-1 ap-southeast-2 ap-southeast-3 ap-southeast-5 ap-northeast-1 us-west-1 eu-central-1- Dynamic expansion: Call
(NOT ECS), union with baseline (only add, never subtract). If dynamic fetch fails, use baseline directly.aliyun ddosbgp describe-regions- Count validation: Final list >= 12 Regions. ALL must be traversed, NEVER break due to empty/error.
antiddos-public: Query fromonly (centralized). ddoscoo: MUST query bothcn-hangzhou+cn-hangzhou.ap-southeast-1
[必须] ddosbgp地域遍历(动态+硬编码 fallback):
- 硬编码基准地域(12个地域,不得减少):
cn-hangzhou cn-shanghai cn-beijing cn-shenzhen cn-hongkong ap-southeast-1 ap-southeast-2 ap-southeast-3 ap-southeast-5 ap-northeast-1 us-west-1 eu-central-1- 动态扩展:调用
(非ECS接口),与基准地域取并集(仅添加,不删除)。若动态获取失败,直接使用基准地域。aliyun ddosbgp describe-regions- 数量验证:最终地域列表≥12个。所有地域必须遍历,不得因空结果或错误中断。
antiddos-public:仅从查询(集中式)。 ddoscoo:必须同时查询cn-hangzhou+cn-hangzhou。ap-southeast-1
Core Inspection Workflow
核心巡检流程
Phase 1: Environment, Credential & Permission Pre-check
阶段1:环境、凭证与权限预检查
bash
undefinedbash
undefined1.1 Check CLI version + enable AI-Mode
1.1 Check CLI version + enable AI-Mode
aliyun version
aliyun configure ai-mode enable
aliyun configure ai-mode set-user-agent --user-agent "AlibabaCloud-Agent-Skills/alibabacloud-ddos-security-monitor"
aliyun version
aliyun configure ai-mode enable
aliyun configure ai-mode set-user-agent --user-agent "AlibabaCloud-Agent-Skills/alibabacloud-ddos-security-monitor"
1.2 Set global timeout and enable auto plugin install
1.2 Set global timeout and enable auto plugin install
aliyun configure set --auto-plugin-install true --connect-timeout 10 --read-timeout 30
aliyun plugin update
aliyun configure set --auto-plugin-install true --connect-timeout 10 --read-timeout 30
aliyun plugin update
1.3 Check credential configuration
1.3 Check credential configuration
aliyun configure list
aliyun configure list
1.4 Validate permissions (one call per product)
1.4 Validate permissions (one call per product)
aliyun antiddos-public describe-instance-ip-address
--ddos-region-id cn-hangzhou --instance-type ecs --current-page 1 --page-size 1 aliyun ddosbgp describe-instance-list --page-no 1 --page-size 1 --region cn-hangzhou --endpoint ddosbgp.cn-hangzhou.aliyuncs.com aliyun ddoscoo describe-instances --page-number 1 --page-size 1 --region cn-hangzhou aliyun ddoscoo describe-instances --page-number 1 --page-size 1 --region ap-southeast-1
--ddos-region-id cn-hangzhou --instance-type ecs --current-page 1 --page-size 1 aliyun ddosbgp describe-instance-list --page-no 1 --page-size 1 --region cn-hangzhou --endpoint ddosbgp.cn-hangzhou.aliyuncs.com aliyun ddoscoo describe-instances --page-number 1 --page-size 1 --region cn-hangzhou aliyun ddoscoo describe-instances --page-number 1 --page-size 1 --region ap-southeast-1
- Normal JSON -> permission OK | `Forbidden.RAM` / `NoPermission` -> see [RAM Policies](references/ram-policies.md)
> **[MUST] Abort rule**: If any pre-check fails 3 consecutive times, run `aliyun configure ai-mode disable`, output error report, and terminate.aliyun antiddos-public describe-instance-ip-address
--ddos-region-id cn-hangzhou --instance-type ecs --current-page 1 --page-size 1 aliyun ddosbgp describe-instance-list --page-no 1 --page-size 1 --region cn-hangzhou --endpoint ddosbgp.cn-hangzhou.aliyuncs.com aliyun ddoscoo describe-instances --page-number 1 --page-size 1 --region cn-hangzhou aliyun ddoscoo describe-instances --page-number 1 --page-size 1 --region ap-southeast-1
--ddos-region-id cn-hangzhou --instance-type ecs --current-page 1 --page-size 1 aliyun ddosbgp describe-instance-list --page-no 1 --page-size 1 --region cn-hangzhou --endpoint ddosbgp.cn-hangzhou.aliyuncs.com aliyun ddoscoo describe-instances --page-number 1 --page-size 1 --region cn-hangzhou aliyun ddoscoo describe-instances --page-number 1 --page-size 1 --region ap-southeast-1
- 返回正常JSON → 权限正常 | 返回`Forbidden.RAM` / `NoPermission` → 详见[RAM权限策略](references/ram-policies.md)
> **[必须] 终止规则**:若任何预检查连续失败3次,运行`aliyun configure ai-mode disable`,输出错误报告并终止操作。Phase 2: Product Inventory Check (Multi-Region Mandatory Traversal)
阶段2:产品资产检查(多地域强制遍历)
[MUST] Loop rules: ALL Regions must be queried. On ANY error (InvalidRegionId/Empty/Throttling), log and— break/exit is FORBIDDEN. After loop, verify EXECUTED >= 12 (ddosbgp) or = 2 (ddoscoo). Log results immediately after each call — relying on memory is FORBIDDEN.continueEmpty result handling:→ log "no instances", continue | Error code → log error, continue | Normal → extract instance IDs. After traversal, compile Region -> Instance ID list mapping for Phase 4.Total: 0
bash
undefined[必须] 循环规则:所有地域必须查询。遇到任何错误(InvalidRegionId/空结果/限流),记录日志并— 禁止中断/退出。循环结束后,验证已执行地域数≥12(ddosbgp)或=2(ddoscoo)。每次调用后立即记录结果 — 禁止依赖记忆。continue空结果处理:→ 记录“无实例”,继续 | 返回错误码 → 记录错误,继续 | 正常返回 → 提取实例ID。 遍历完成后,为阶段4编译地域→实例ID列表映射。Total: 0
bash
undefined2.1 Basic Protection assets
2.1 Basic Protection assets
aliyun antiddos-public describe-instance-ip-address
--ddos-region-id cn-hangzhou --instance-type ecs --current-page 1 --page-size 50
--ddos-region-id cn-hangzhou --instance-type ecs --current-page 1 --page-size 50
aliyun antiddos-public describe-instance-ip-address
--ddos-region-id cn-hangzhou --instance-type ecs --current-page 1 --page-size 50
--ddos-region-id cn-hangzhou --instance-type ecs --current-page 1 --page-size 50
2.2 Native Protection - [MUST execute full loop in single bash]
2.2 Native Protection - [MUST execute full loop in single bash]
BASELINE="cn-hangzhou cn-shanghai cn-beijing cn-shenzhen cn-hongkong ap-southeast-1 ap-southeast-2 ap-southeast-3 ap-southeast-5 ap-northeast-1 us-west-1 eu-central-1"
DYNAMIC=$(aliyun ddosbgp describe-regions 2>/dev/null | grep -o '"RegionId":"[^"]*"' | cut -d'"' -f4 | tr '\n' ' ')
if [ -n "$DYNAMIC" ]; then
ALL_REGIONS=$(echo "$BASELINE $DYNAMIC" | tr ' ' '\n' | sort -u | tr '\n' ' ')
else
ALL_REGIONS="$BASELINE"
fi
EXECUTED=0
for region in $ALL_REGIONS; do
[MANDATORY] NEVER break/return/exit - on ANY error, MUST continue
echo "=== ddosbgp query $region ==="
[CRITICAL] Must specify --endpoint for mainland China Regions
RESULT=$(aliyun ddosbgp describe-instance-list --page-no 1 --page-size 50 --region $region --endpoint ddosbgp.cn-hangzhou.aliyuncs.com 2>&1)
echo "$RESULT"
if echo "$RESULT" | grep -q "InvalidRegionId|ErrorCode"; then
echo "[WARN] $region returned error, logged and continuing"
fi
EXECUTED=$((EXECUTED+1))
continue
done
echo "=== Regions executed: $EXECUTED ==="
BASELINE="cn-hangzhou cn-shanghai cn-beijing cn-shenzhen cn-hongkong ap-southeast-1 ap-southeast-2 ap-southeast-3 ap-southeast-5 ap-northeast-1 us-west-1 eu-central-1"
DYNAMIC=$(aliyun ddosbgp describe-regions 2>/dev/null | grep -o '"RegionId":"[^"]*"' | cut -d'"' -f4 | tr '\n' ' ')
if [ -n "$DYNAMIC" ]; then
ALL_REGIONS=$(echo "$BASELINE $DYNAMIC" | tr ' ' '\n' | sort -u | tr '\n' ' ')
else
ALL_REGIONS="$BASELINE"
fi
EXECUTED=0
for region in $ALL_REGIONS; do
[MANDATORY] NEVER break/return/exit - on ANY error, MUST continue
echo "=== ddosbgp query $region ==="
[CRITICAL] Must specify --endpoint for mainland China Regions
RESULT=$(aliyun ddosbgp describe-instance-list --page-no 1 --page-size 50 --region $region --endpoint ddosbgp.cn-hangzhou.aliyuncs.com 2>&1)
echo "$RESULT"
if echo "$RESULT" | grep -q "InvalidRegionId|ErrorCode"; then
echo "[WARN] $region returned error, logged and continuing"
fi
EXECUTED=$((EXECUTED+1))
continue
done
echo "=== Regions executed: $EXECUTED ==="
2.3 Native Protection associated IPs (per discovered instance, uses --biz-region-id)
2.3 Native Protection associated IPs (per discovered instance, uses --biz-region-id)
aliyun ddosbgp describe-pack-ip-list
--instance-id <instance-id> --page-no 1 --page-size 50 --biz-region-id <region-id>
--instance-id <instance-id> --page-no 1 --page-size 50 --biz-region-id <region-id>
aliyun ddosbgp describe-pack-ip-list
--instance-id <instance-id> --page-no 1 --page-size 50 --biz-region-id <region-id>
--instance-id <instance-id> --page-no 1 --page-size 50 --biz-region-id <region-id>
2.4 Anti-DDoS Pro instances [MUST query both Regions]
2.4 Anti-DDoS Pro instances [MUST query both Regions]
aliyun ddoscoo describe-instances --page-number 1 --page-size 50 --region cn-hangzhou
aliyun ddoscoo describe-instances --page-number 1 --page-size 50 --region ap-southeast-1
aliyun ddoscoo describe-instances --page-number 1 --page-size 50 --region cn-hangzhou
aliyun ddoscoo describe-instances --page-number 1 --page-size 50 --region ap-southeast-1
2.5 Anti-DDoS Pro associated domains (per discovered instance)
2.5 Anti-DDoS Pro associated domains (per discovered instance)
aliyun ddoscoo describe-domains --instance-ids <instance-id> --region <region-id>
> **[MUST] End validation**: 1) Region count: ddosbgp >= 12, ddoscoo = 2 2) Product isolation: no mixed API prefixes 3) Instance deduplication: Global instances (CoverageType=4) appear in every Region — deduplicate by InstanceIdaliyun ddoscoo describe-domains --instance-ids <instance-id> --region <region-id>
> **[必须] 结束验证**:1) 地域数量:ddosbgp≥12,ddoscoo=2 2) 产品隔离:无混合API前缀 3) 实例去重:全局实例(CoverageType=4)会出现在每个地域 — 按InstanceId去重Phase 3: Confirm Comparison Period
阶段3:确认对比周期
Ask user for comparison period, parse into second-precision Unix timestamps. [MUST] Use bash command — manual calculation FORBIDDEN:
datebash
BASE_END=$(date +%s)
BASE_START=$((BASE_END - 86400))
COMPARE_END=$((BASE_START))
COMPARE_START=$((COMPARE_END - 86400))向用户确认对比周期,解析为秒级Unix时间戳。[必须] 使用bash 命令 — 禁止手动计算:
datebash
BASE_END=$(date +%s)
BASE_START=$((BASE_END - 86400))
COMPARE_END=$((BASE_START))
COMPARE_START=$((COMPARE_END - 86400))Week-over-week: offset 604800s | Hour-over-hour: offset 3600s
Week-over-week: offset 604800s | Hour-over-hour: offset 3600s
echo "Base: $BASE_START ~ $BASE_END | Compare: $COMPARE_START ~ $COMPARE_END"
undefinedecho "Base: $BASE_START ~ $BASE_END | Compare: $COMPARE_START ~ $COMPARE_END"
undefinedPhase 4: Execute Inspection & Generate Report
阶段4:执行巡检并生成报告
[MUST] Sequential Execution Guard: Execute API chains strictly in order for EACH instance. Do NOT stop at "planning" — every API MUST have an actualcommand executed with visible output. After each sub-step (4.1/4.2/4.3), printaliyun. Proceeding to 4.4/4.5 without all calls completed is FORBIDDEN.echo "[Step 4.X Complete]"[MUST] Route by inventory: No instances in ALL Regions → execute probe calls () on cn-hangzhou to preserve trace, report "not provisioned". Some Regions have instances → inspect those, skip empty Regions. NEVER substitute product APIs.--instance-id dummy
[必须] 顺序执行保障:为每个实例严格按顺序执行API链。不能停留在“规划”阶段 — 每个API必须执行实际的命令并输出可见结果。每个子步骤(4.1/4.2/4.3)完成后,打印aliyun。未完成所有调用前,禁止进入4.4/4.5。echo "[Step 4.X Complete]"[必须] 按资产路由:所有地域均无实例 → 在cn-hangzhou执行探测调用()以保留痕迹,报告“未部署”。部分地域有实例 → 巡检这些地域,跳过空地域。绝对禁止混用产品API。--instance-id dummy
4.1 Basic Protection Inspection
4.1 Basic Protection巡检
bash
undefinedbash
undefinedHas assets: real ID | No assets: probe call
Has assets: real ID | No assets: probe call
aliyun antiddos-public describe-ddos-event-list
--ddos-region-id <region-id> --instance-type <type> --instance-id <id>
--current-page 1 --page-size 50
--ddos-region-id <region-id> --instance-type <type> --instance-id <id>
--current-page 1 --page-size 50
aliyun antiddos-public describe-ddos-event-list
--ddos-region-id <region-id> --instance-type <type> --instance-id <id>
--current-page 1 --page-size 50
--ddos-region-id <region-id> --instance-type <type> --instance-id <id>
--current-page 1 --page-size 50
Probe: --instance-id dummy --ddos-region-id cn-hangzhou --instance-type ecs
Probe: --instance-id dummy --ddos-region-id cn-hangzhou --instance-type ecs
> **[MANDATORY CHECKPOINT 4.1]** Confirm describe-ddos-event-list returned JSON or explicit error. If not executed, retry now. Do NOT proceed to 4.2 until confirmed.
> **[强制检查点4.1]** 确认describe-ddos-event-list返回JSON或明确错误。若未执行,立即重试。确认完成前禁止进入4.2。4.2 Native Protection Inspection (ddosbgp APIs ONLY)
4.2 Native Protection巡检(仅使用ddosbgp API)
[MUST]APIs only. Attack events:ddosbgp(singular). L4 traffic:describe-ddos-event(MUST call). Region params: describe-ddos-event/describe-pack-ip-list usedescribe-traffic; describe-traffic uses--biz-region-id. Has instances → all 3 APIs per instance | ALL empty → 3 probe calls on cn-hangzhou (all required)--region
bash
aliyun ddosbgp describe-ddos-event \
--instance-id <id> --start-time <ts> --end-time <ts> \
--page-no 1 --page-size 50 --biz-region-id <region-id>
aliyun ddosbgp describe-pack-ip-list \
--instance-id <id> --page-no 1 --page-size 50 --biz-region-id <region-id>
aliyun ddosbgp describe-traffic \
--instance-id <id> --start-time <ts> --end-time <ts> --region <region-id>[必须] 仅使用API。攻击事件:ddosbgp(单数)。L4流量:describe-ddos-event(必须调用)。地域参数:describe-ddos-event/describe-pack-ip-list使用describe-traffic;describe-traffic使用--biz-region-id。 有实例 → 每个实例调用全部3个API | 所有地域均为空 → 在cn-hangzhou执行3次探测调用(全部必填)--region
bash
aliyun ddosbgp describe-ddos-event \
--instance-id <id> --start-time <ts> --end-time <ts> \
--page-no 1 --page-size 50 --biz-region-id <region-id>
aliyun ddosbgp describe-pack-ip-list \
--instance-id <id> --page-no 1 --page-size 50 --biz-region-id <region-id>
aliyun ddosbgp describe-traffic \
--instance-id <id> --start-time <ts> --end-time <ts> --region <region-id>Probe: --instance-id dummy, --biz-region-id cn-hangzhou (describe-traffic: --region cn-hangzhou)
Probe: --instance-id dummy, --biz-region-id cn-hangzhou (describe-traffic: --region cn-hangzhou)
> **[MANDATORY CHECKPOINT 4.2]** You MUST now verify all 3 ddosbgp APIs were actually executed by checking terminal output. If describe-ddos-event OR describe-pack-ip-list OR describe-traffic has zero terminal output, STOP and execute the missing call(s) NOW. Two consecutive failures to complete all 3 → output error log and terminate. Do NOT proceed to 4.3 until all 3 confirmed.
> **[强制检查点4.2]** 必须通过终端输出验证所有3个ddosbgp API已实际执行。若describe-ddos-event或describe-pack-ip-list或describe-traffic无终端输出,**立即停止**并执行缺失的调用。连续两次无法完成全部3个调用 → 输出错误日志并终止。确认全部完成前禁止进入4.3。4.3 Anti-DDoS Pro/Premium Inspection (ddoscoo APIs ONLY)
4.3 Anti-DDoS Pro/Premium巡检(仅使用ddoscoo API)
[MUST]APIs only. Has instances → all APIs per instance | Both Regions empty → probe calls on cn-hangzhouddoscoo
bash
aliyun ddoscoo describe-ddos-events \
--instance-ids <id> --start-time <ts> --end-time <ts> \
--page-number 1 --page-size 50 --region <region-id>
aliyun ddoscoo describe-domain-qps-list \
--start-time <ts> --end-time <ts> --interval 300 --region <region-id>
aliyun ddoscoo describe-port-flow-list \
--instance-ids <id> --start-time <ts> --end-time <ts> \
--interval 300 --region <region-id>
aliyun ddoscoo describe-domain-status-code-list \
--start-time <ts> --end-time <ts> --interval 300 \
--query-type gf --region <region-id>
aliyun ddoscoo describe-domain-status-code-list \
--start-time <ts> --end-time <ts> --interval 300 \
--query-type upstrem --region <region-id>[必须] 仅使用API。有实例 → 每个实例调用全部API | 两个地域均为空 → 在cn-hangzhou执行探测调用ddoscoo
bash
aliyun ddoscoo describe-ddos-events \
--instance-ids <id> --start-time <ts> --end-time <ts> \
--page-number 1 --page-size 50 --region <region-id>
aliyun ddoscoo describe-domain-qps-list \
--start-time <ts> --end-time <ts> --interval 300 --region <region-id>
aliyun ddoscoo describe-port-flow-list \
--instance-ids <id> --start-time <ts> --end-time <ts> \
--interval 300 --region <region-id>
aliyun ddoscoo describe-domain-status-code-list \
--start-time <ts> --end-time <ts> --interval 300 \
--query-type gf --region <region-id>
aliyun ddoscoo describe-domain-status-code-list \
--start-time <ts> --end-time <ts> --interval 300 \
--query-type upstrem --region <region-id>Probe: --instance-ids dummy, --region cn-hangzhou (same 5 APIs)
Probe: --instance-ids dummy, --region cn-hangzhou (same 5 APIs)
> **[MANDATORY CHECKPOINT 4.3]** Verify all 5 ddoscoo APIs have terminal output. Any missing → execute now. Do NOT proceed to 4.4.
> **[强制检查点4.3]** 验证所有5个ddoscoo API均有终端输出。任何缺失 → 立即执行。禁止进入4.4。4.4 Period-over-Period Analysis
4.4 同比分析
Change rate = (Base - Compare) / Compare × 100%. Thresholds: ±30%~±100% → Attention | >±100% → Anomaly | Blackhole/scrubbing present → Anomaly.
变化率 =(基准值 - 对比值)/ 对比值 × 100%。阈值:±30%~±100% → 关注 | >±100% → 异常 | 存在黑洞/清洗 → 异常。
4.5 Report Output
4.5 报告输出
Mandatory: Follow Report Template, no sections omitted. Group assets by Region.[MUST] Data consistency validation:
- Aggregation: Summary numbers must exactly match detail list counts
- Deduplication: Same instance/IP across Regions → deduplicate before counting
- Empty value annotation (hard rule): Empty array
→ write[]or0 (API returned empty). FORBIDDEN: vague phrases like "no anomaly found", "appears to be a false alarm". Key metrics with empty data MUST includeQuery failed (ErrorCode: XXX)tag at section start[DATA MISSING]- Cross-validation: Summary totals = sum of Region details
- Call record verification: Claimed API calls and conclusions must match actual execution. Fabrication FORBIDDEN
- Raw Data Binding: Copy-paste exact values from terminal output into report. FORBIDDEN: inferring from memory, writing "no domains" if API returned domains. Use
/grepto verify before finalizingjq[MUST] Pre-computation verification (hard blocker): [STRICT MODE] Directly writingwith pre-filled values is FORBIDDEN and counts as fabrication. You MUST useecho "<number>"/grep/jqto parse actual terminal output or saved log. The verification script must contain pipe commands that extract real data, NOT hardcoded echo statements.wcbash# [STRICT] Count API calls from terminal history - must use grep, not hardcoded echo echo "=== Call statistics ===" # Example: grep -c "aliyun antiddos-public" /path/to/terminal.log (adapt to your log method) echo "antiddos-public: $(grep -c 'antiddos-public' <<< "$TERMINAL_LOG")" echo "ddosbgp: $(grep -c 'aliyun ddosbgp' <<< "$TERMINAL_LOG")" echo "ddoscoo: $(grep -c 'aliyun ddoscoo' <<< "$TERMINAL_LOG")" # [STRICT] Count assets from API responses - must use jq/grep, not hardcoded echo "=== Asset statistics (from API JSON responses) ===" # Parse actual JSON outputs, e.g.: jq '.InstanceList | length', jq '.DomainList | length'Output must contain pipe commands (,grep,jq). Purewc -lwithout pipes = fabrication = abort. Mismatch with report draft → abort, re-traverse log, re-run. Report MUST quote the verification output snippet.echo "number"
强制要求:遵循报告模板,不得省略任何章节。按地域分组资产。[必须] 数据一致性验证:
- 聚合:汇总数字必须与明细列表计数完全匹配
- 去重:跨地域的相同实例/IP → 计数前去重
- 空值标注(严格规则):空数组
→ 标注为[]或0(API返回空)。禁止使用模糊表述如“未发现异常”、“疑似误报”。关键指标数据为空时,必须在章节开头添加查询失败(错误码:XXX)标签[数据缺失]- 交叉验证:汇总总数 = 各地域明细之和
- 调用记录验证:声称的API调用和结论必须与实际执行一致。禁止伪造
- 原始数据绑定:将终端输出的精确值复制粘贴到报告中。禁止依赖记忆推断,若API返回域名则不得写“无域名”。使用
/grep验证后再定稿jq[必须] 预计算验证(严格阻断规则): [严格模式] 直接写入并使用预填充值属于伪造,禁止此类操作。必须使用echo "<number>"/grep/jq解析实际终端输出或保存的日志。验证脚本必须包含提取真实数据的管道命令,而非硬编码的echo语句。wcbash# [STRICT] Count API calls from terminal history - must use grep, not hardcoded echo echo "=== Call statistics ===" # Example: grep -c "aliyun antiddos-public" /path/to/terminal.log (adapt to your log method) echo "antiddos-public: $(grep -c 'antiddos-public' <<< "$TERMINAL_LOG")" echo "ddosbgp: $(grep -c 'aliyun ddosbgp' <<< "$TERMINAL_LOG")" echo "ddoscoo: $(grep -c 'aliyun ddoscoo' <<< "$TERMINAL_LOG")" # [STRICT] Count assets from API responses - must use jq/grep, not hardcoded echo "=== Asset statistics (from API JSON responses) ===" # Parse actual JSON outputs, e.g.: jq '.InstanceList | length', jq '.DomainList | length'输出必须包含管道命令(、grep、jq)。纯wc -l无管道命令 = 伪造 = 终止操作。 与报告草稿不符 → 终止操作,重新遍历日志,重新运行。报告必须引用验证输出片段。echo "数字"
Cleanup
清理
[MUST] Mandatory exit safeguard: Regardless of exit reason (success, failure, cancellation, timeout), the final step MUST unconditionally execute AI-Mode disable + verification. Highest priority, cannot be overridden.
bash
aliyun configure ai-mode disable[必须] 强制退出保障:无论退出原因(成功、失败、取消、超时),最后一步必须无条件执行AI-Mode禁用+验证。优先级最高,不可覆盖。
bash
aliyun configure ai-mode disableVerify: try status command, if unsupported fall back to configure list
Verify: try status command, if unsupported fall back to configure list
VERIFY=$(aliyun configure ai-mode status 2>&1)
if echo "$VERIFY" | grep -q "not a valid|unknown|error"; then
Fallback: check via configure list output
aliyun configure list | grep -i "ai-mode|agent"
fi
VERIFY=$(aliyun configure ai-mode status 2>&1)
if echo "$VERIFY" | grep -q "not a valid|unknown|error"; then
Fallback: check via configure list output
aliyun configure list | grep -i "ai-mode|agent"
fi
If still uncertain, run disable again to be safe
If still uncertain, run disable again to be safe
aliyun configure ai-mode disable
> **[MUST]** Only write "AI-Mode confirmed disabled" if verification succeeded. If both `status` and `configure list` fail to confirm, write "AI-Mode disable executed but verification inconclusive (CLI compatibility issue)" — do NOT claim confirmed.aliyun configure ai-mode disable
> **[必须]** 仅当验证成功时,方可写入“AI-Mode已确认禁用”。若`status`和`configure list`均无法确认,写入“已执行AI-Mode禁用但验证结果不确定(CLI兼容性问题)” — 不得声称已确认禁用。References
参考资料
| Resource | Path |
|---|---|
| CLI Installation Guide | references/cli-installation-guide.md |
| RAM Permission Policies | references/ram-policies.md |
| API Parameter Reference | references/api-reference.md |
| CLI Command Table | references/related-commands.md |
| Inspection Report Template | references/report-template.md |
| Verification Method | references/verification-method.md |
| Acceptance Criteria | references/acceptance-criteria.md |
| 资源 | 路径 |
|---|---|
| CLI安装指南 | references/cli-installation-guide.md |
| RAM权限策略 | references/ram-policies.md |
| API参数参考 | references/api-reference.md |
| CLI命令表 | references/related-commands.md |
| 巡检报告模板 | references/report-template.md |
| 验证方法 | references/verification-method.md |
| 验收标准 | references/acceptance-criteria.md |