Install
openclaw skills install @erickeyhu-hug/huawei-cloud-waf-queryQuery Huawei Cloud WAF (Web Application Firewall) attack events, access/protection logs, attack statistics, threat overview and top attack source IPs for daily security inspection and incident troubleshooting. Triggers include: "查询WAF攻击事件", "查询WAF告警", "查看WAF防护日志", "查看WAF访问日志", "WAF攻击统计", "WAF威胁概览", "查询攻击源IP", "waf query", "waf attack events", "waf logs", "waf statistics", "web application firewall", "安全日报", "日常巡检WAF".
openclaw skills install @erickeyhu-hug/huawei-cloud-waf-queryThis skill helps users query Huawei Cloud Web Application Firewall (WAF) protection data for daily security inspection and incident troubleshooting:
All operations are read-only queries (List/Show). No resource is created, modified or deleted.
KooCLI (hcloud) installed and authenticated — see references/cli-installation-guide.md.
WAF service permission — the IAM account needs WAF read permissions, see references/iam-policies.md.
Project ID — required by most WAF APIs. Obtain it from the Huawei Cloud console (username → My Credentials → Projects) or use:
hcloud IAM KeystoneListProjects --cli-region=cn-north-4 --name=cn-north-4
Region — WAF queries must specify a region, e.g. cn-north-4.
Time parameters from/to are millisecond timestamps and must be used together; the maximum time range is 30 days.
from/to millisecond timestamps (e.g. last 24 hours).
For "today / 3 days" style summaries, ListThreats --recent accepts yesterday|today|3days|1week|1month directly.ListStatistics to see the attack distribution, then drill down with ListEvent.ListEvent with filters (attack type, action, domain, time range).ShowEvent --eventid=<id> for full detail of a suspicious event.ListEventLog for access logs, ListTopIp for top source IPs, ListThreats for the threat summary.hcloud WAF ListEvent --cli-region=cn-north-4 --project_id={project_id} \
--from={from_ms} --to={to_ms} [--attacks.1={attack_type}] \
[--actions.1={action}] [--domains.1={domain}] --pagesize={page_size}
--attacks.1 values: xss, sqli, rfi, lfi, cmdi, cc, webshell, vuln, botm, robot, antitamper, antileakage, custom_blackip, custom_geoip, illegal, etc.--actions.1 values: block, pass, log, captcha, js_challenge, etc.--domains.N is the array form for domain filtering (repeatable, e.g. --domains.1=example.com --domains.2=other.com).
Do NOT use --domain (singular): it collides with the KooCLI system parameter of the same name and triggers an
interactive confirmation, which fails with [USE_ERROR]EOF in non-interactive (Agent) execution.pagesize cannot be -1; at most 10,000 records can be queried.hcloud WAF ShowEvent --cli-region=cn-north-4 --project_id={project_id} --eventid={event_id}
hcloud WAF ListEventLog --cli-region=cn-north-4 --project_id={project_id} --page={page} --pagesize={size}
hcloud WAF ListStatistics --cli-region=cn-north-4 --project_id={project_id} --from={from_ms} --to={to_ms}
hcloud WAF ListThreats --cli-region=cn-north-4 --project_id={project_id} --from={from_ms} --to={to_ms} --recent={yesterday|today|3days|1week|1month}
hcloud WAF ListTopIp --cli-region=cn-north-4 --project_id={project_id} --from={from_ms} --to={to_ms}
| Parameter | Required | Description | Example |
|---|---|---|---|
--cli-region | Yes | Huawei Cloud region | cn-north-4 |
--project_id | Yes | Project ID of the WAF instance | 0dd8cb4e... |
--from / --to | Yes (ListEvent/ListStatistics/ListThreats/ListTopIp) | Start/end time, millisecond timestamps, used together, max range 30 days | 1786885834203 |
--recent | Yes (ListThreats) | Recent period keyword | today, 3days, 1week |
--attacks.[N] | No | Attack type filter (repeatable) | --attacks.1=sqli |
--actions.[N] | No | Protection action filter (repeatable) | --actions.1=block |
--domains.[N] | No | Domain name filter, array form (repeatable, fuzzy match) | --domains.1=example.com |
--eventid | Yes (ShowEvent) | Attack event ID | e6c2d8e1... |
--page / --pagesize | No | Paging for ListEventLog | --page=1 --pagesize=10 |
hcloud <Service> <Operation> --cli-region=<region> [--key=value ...]
WAFListEvent, ShowEvent, ListStatistics--cli-region=<value> (e.g. cn-north-4)--key=value (e.g. --eventid=xxx)--key.N=value (e.g. --attacks.1=sqli)references/cli-installation-guide.md — KooCLI installation and authenticationreferences/iam-policies.md — Least-privilege IAM policies for WAF read-only accessreferences/verification-method.md — How to verify the skill worksreferences/dataflow-diagram.md — Mermaid data flow diagramreferences/acceptance-criteria.md — Acceptance criteria for this skillreferences/related-commands.md — Command quick reference| Scenario | Handling |
|---|---|
ListEvent returns 0 events | Verify from/to are valid millisecond timestamps and the range ≤ 30 days; confirm the WAF instance has protected domains |
ListThreats returns [USE_ERROR] for --recent | --recent only accepts yesterday, today, 3days, 1week, 1month |
Missing --project_id | Obtain the project ID via hcloud IAM KeystoneListProjects --cli-region=<region> --name=<region> |
pagesize set to -1 on ListEvent | Not allowed; use a positive integer (max 100) |
ShowEvent with a non-existent eventid | Returns {"total": 0, "items": []} silently (no error) — treat it as "event not found", verify the event ID is valid and still within the retention period |
| Query range > 30 days | Split into multiple queries with sub-ranges |
| No WAF instance in the account | The API returns empty lists (total: 0) — confirm WAF is enabled and domains are added |