Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

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

Open
#175 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
graphql, typescript
Domain
api, cli, data, security

Research direction

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.

Written by the indexing model from the issue text.

Description

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.

Dominant language
TypeScript
Stars
853
Forks
42
Avg merge
17h 57m
Merged PRs (30d)
146

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from cloudflare/cf

All issues in cloudflare/cf

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.