Add zone traffic analytics and Security Events (WAF/rate-limit) commands
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 35/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- graphql, typescript
调研方向
Trace the existing cf analytics query, analytics sql, and cf OAuth login entry points first, then compare their handling of zone-scoped analytics and the httpRequestsAdaptiveGroups and firewallEventsAdaptive datasets. Done means discoverable zone traffic and security-events commands, the required analytics OAuth scope, and a clear 4xx for unsupported datasets.
由索引模型根据 Issue 内容生成。
描述
Version: cf 1.0.0-beta.10
Problem: There is no way to answer "is my site OK right now?" from the CLI. Zone HTTP traffic analytics (requests, status codes, cache hit ratio, top countries/paths) and Security Events (WAF / rate-limit / bot blocks) can't be queried.
What I tried:
cf cli searchfor zone traffic, security events, WAF blocks, and country breakdown returns only Zero Trust, Spectrum, Analytics Engine, or Cloudforce One commands.cf analytics query top-n http-requests --zone <zone> ...(andfirewall-events) goes to the account-scoped/analytics/query/<dataset>endpoint. It returns500 art.api.internal_server_errorinstead of an "unknown dataset" error.cf analytics sql post --zone <zone>withhttp_requests/firewall_events(bare, or with anevents.orlogs.prefix) returns "table not found".information_schemaisn't enabled, andanalytics sql introspection getreturns 403 for an account owner logged in throughcfOAuth.
Why it matters: During a traffic spike, the first questions are where the traffic comes from (country, bot vs human, paths) and whether Cloudflare is blocking real users. Right now that needs the dashboard or a separately scoped API token.
Request:
- A zone traffic command, for example
cf zones analytics --since 6h --group-by status|country|path|botClass(backed byhttpRequestsAdaptiveGroups). - A security events command, for example
cf zones security-events list --since 1h --action block,challenge --group-by rule|country|path(backed byfirewallEventsAdaptive). - The
cfOAuth login should include the analytics read scope these commands need. analytics queryshould return a clear 4xx for unsupported datasets instead of a 500.
Related: #171 (generic GraphQL command) would also unblock this, but first-class commands for these two incident-response queries would be much easier to discover.
- 主要语言
- TypeScript
- 星标
- 853
- 派生
- 42
- 平均合并
- 17 小时 57 分钟
- 30 天内合并 PR
- 146
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
cloudflare/cf 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
cloudflare/cf#344 ·
维护者通常 1 天内回复
-
upstream
难度 2/5 1-3 小时 新手友好度 72/100
cloudflare/cf#262 ·
维护者通常 1 天内回复
-
`cf dev` rejects `--port` and `--host` for Vite projects, including the `cf init` template可能已有人在做 @jamesopstad 于 5 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 72/100
cloudflare/cf#223 · 已指派 2 人 ·
维护者通常 1 天内回复
-
upstream
难度 2/5 1-3 小时 新手友好度 75/100
cloudflare/cf#179 ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 58/100
cloudflare/cf#347 ·
维护者通常 1 天内回复
相似的 Issue
-
documentation
难度 2/5 1-3 小时 新手友好度 74/100
components-web-app/docs#260 ·
-
难度 1/5 1 小时以内 新手友好度 65/100
521xueweihan/HelloGitHub#4025 ·
-
难度 2/5 1-3 小时 新手友好度 72/100
-
难度 2/5 1-3 小时 新手友好度 75/100
ctrf-io/playwright-ctrf-json-reporter#117 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
voidzero-dev/void#478 ·
维护者通常 1 天内回复