Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Add zone traffic analytics and Security Events (WAF/rate-limit) commands

未关闭
#175 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
35/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
活跃
技术栈
graphql, typescript
领域
api, cli, data, security

调研方向

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 内容生成。

描述

upstream

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 search for 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> ... (and firewall-events) goes to the account-scoped /analytics/query/<dataset> endpoint. It returns 500 art.api.internal_server_error instead of an "unknown dataset" error.
  • cf analytics sql post --zone <zone> with http_requests / firewall_events (bare, or with an events. or logs. prefix) returns "table not found". information_schema isn't enabled, and analytics sql introspection get returns 403 for an account owner logged in through cf OAuth.

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:

  1. A zone traffic command, for example cf zones analytics --since 6h --group-by status|country|path|botClass (backed by httpRequestsAdaptiveGroups).
  2. A security events command, for example cf zones security-events list --since 1h --action block,challenge --group-by rule|country|path (backed by firewallEventsAdaptive).
  3. The cf OAuth login should include the analytics read scope these commands need.
  4. analytics query should 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 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

cloudflare/cf 的其他 Issue

查看 cloudflare/cf 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。