Skip to content

fix(cloudflare): find the edge rule that answers 403 for the webhook route #5035

Closed

Description

@devops-cli-service

Split from #5017.

Problem Description 22 of the 60 newest deliveries of the repository hook got HTTP 403 with the response header Server: cloudflare (2026-11-12 07:56-08:09Z). GitHub does not send a failed delivery again, so each event step of the roadmap loses deliveries. The alert RoadmapServiceWebhooksRejected counts only the refusals of the route behind Traefik, so it cannot see a refusal at the edge. ### Why this part is deferred The cause is a rule of the Cloudflare zone: an Access application with no bypass for the path, a WAF rule or a rate rule. Only the owner changes the Cloudflare configuration (k8s/README.md, GitOps), and owner decision O3 holds the change. The App token of the Service cannot read the Access applications, the WAF rules or the zone settings, so no runner Job can find the rule. ### Work 1. Read the failed deliveries: uv run devops gh api repos/<owner>/<name>/hooks/<id>/deliveries gives the time, the event, the status code and the response headers. 2. Read the Access applications and policies of hooks.<domain> with devops cloudflare access status --json and devops cloudflare access policies <app-id>. 3. Find the rule that answers 403. Give the evidence to the owner when the fix is a change at the edge. ### Acceptance Criteria - [ ] The deliveries after the fix time hold no 403: uv run devops gh api repos/<owner>/<name>/hooks/<id>/deliveries --jq '[.[]|select(.status_code==403)]|length' gives 0. - [ ] k8s/README.md, setup step 6, names the bypass or the rule that the fix adds. - [ ] A comment on this issue names the rule that answered 403 and the time of the fix.

Owner decision 2026-11-13

The approved pipeline split (tracker #5482, Phase 3) needs the webhook route for the events of D8. Its scope does not change. Owner step O3 changes the edge rule.

  • Live proof: after the fix and the owner step, a test delivery from the App settings page gets a 2xx answer through the edge. A comment gives the delivery ID and the status.

Activity

  1. added
    source/agent
    type/bug
    scope/cloudflare
    status/new
    value/high
    effort/medium
    on Nov 12, 2026
  2. devops-cli-service commented on Nov 12, 2026

    @devops-cli-service
    ContributorAuthor
  3. dan-petty commented on Nov 12, 2026

    @dan-petty
    Owner

    The rule that answers 403 is known: the edge change waits for owner decision O3

    The premise check on #5017 names the rule: #5017 (comment). Cloudflare Access refuses the deliveries. The application GitHub Webhooks - Roadmap Service on hooks.<domain>/webhooks/github has the Bypass policy gh-hooks-public-ips with 6 GitHub ranges and no Allow policy. uv run devops gh api meta --jq .hooks gives 9 ranges. These 3 are not in the policy: 9.234.98.160/28, 9.234.98.176/28, 9.234.106.48/28. A person made the policy in the dashboard: no manifest, OpenTofu file or setting holds it.

    The problem continues after #5017 (read only, 2026-11-12)

    • uv run devops gh api 'repos/dan-petty/devops-cli/hooks/692250036/deliveries?per_page=100' at about 12:56Z: 34 of the 100 newest deliveries (12:15-12:56Z) got 403, and 23 got 503 during the Service rollouts.
    • The gauge devops_cli_service_webhook_delivery_failures from fix(service): find why webhook deliveries get HTTP 403 #5017 counts them, and the alert RoadmapServiceWebhookDeliveriesFailed fires.

    Owner decision O3 (tracker #5014)

    Agents do not change an Access, WAF or DNS rule. The owner selects one option:

    1. Recommended: change gh-hooks-public-ips to include Everyone on the path hooks.<domain>/webhooks/github only. The route keeps its own controls: the HMAC signature check (401), the Traefik limit of 60 requests a minute (429) and the alert RoadmapServiceWebhooksRejected. GitHub changes its ranges with no notice and does not recommend allowing by IP address.
    2. Other option: add the 3 ranges above to gh-hooks-public-ips. Then compare the policy with uv run devops gh api meta --jq .hooks each time RoadmapServiceWebhookDeliveriesFailed fires.

    After the change, this command must give 0 (put the change time in place of <time>): uv run devops gh api 'repos/dan-petty/devops-cli/hooks/692250036/deliveries?per_page=100' --jq '[.[]|select(.status_code==403 and .delivered_at > "<time>")]|length'.

    The event steps that need deliveries stay blocked until the fix: #4413, #4415, #4416. Work items 1 and 2 of this issue are done; item 3 (the edge change, then setup step 6 of k8s/README.md) waits for O3.

  4. dan-petty commented on Nov 12, 2026

    @dan-petty
    Owner

    Owner decision 2 of 2026-11-12 (ADR modernization, tracker ): Option A. The Cloudflare Access Bypass on hooks.<domain>/webhooks/github admits Everyone, on that one path only, and the HMAC check authenticates GitHub. The cause of the 403 answers is the Access IP list: 3 of the 9 GitHub hook ranges of the meta API are not in it.

    Scope of this item before the owner changes Access:

    • Key the Traefik rate limit of the webhook route on Cf-Connecting-Ip (or add a Cloudflare rate-limit rule), so that another sender cannot fill the bucket of 60 a minute that GitHub uses.
    • The HMAC check (401 before the body is parsed), the 413 cap and the failure alert stay.
    • Make the consumer events a subset of the hook events, and check it.

    After this item merges, the owner changes Access (tracker owner step 2).

  5. dan-petty commented on Nov 16, 2026

    @dan-petty
    Owner

    Evidence, 2026-11-16 21:20Z: 41 of the newest 100 deliveries of the repository hook got HTTP 403 (20:49Z to 21:18Z: issues 29, pull_request 10, release 2). In the same 35 minutes the Service logged 73 webhook requests, all 200 or 202, so no 403 came from the Service: each one is the edge. This loss blocks the webhook-driven work that the owner asked for on 2026-11-16 (the cache of #6013, the events of #5555 and #4413) and costs GitHub budget, because a poll repairs each lost event (#6012). A builder starts the scope above now; after it merges, the owner changes Access (owner step O3).

  6. added
    owner/agent
    status/in-progress
    and removed
    status/new
    on Nov 16, 2026
  7. added a commit that references this issue on Nov 16, 2026
    90c364f
  8. added
    status/in-review
    and removed
    status/in-progress
    on Nov 16, 2026
  9. removed
    status/in-review
    owner/agent
    on Nov 16, 2026
  10. dan-petty commented on Nov 16, 2026

    @dan-petty
    Owner

    Live proof, 2026-11-16:

    • PR fix(cloudflare): Key the webhook rate limit on each client #6050 merged at 22:02:44Z; Argo CD synced devops, and the live Middleware roadmap-service-rate-limit has sourceCriterion: {"requestHeaderName":"Cf-Connecting-Ip"}.
    • Owner step O3 done: the Access policy gh-hooks-public of the application on /webhooks/github has Action Bypass and Include Everyone (last updated 22:08Z).
    • Redelivery test: delivery 3854447056812769280 (pull_request) got HTTP 403 at 22:06:18Z; its redelivery 3854447508379926528 got HTTP 200 at 22:09:48Z.
    • Before the change, 15 of the 40 deliveries before 22:08Z got 403 (and 5 got 503). The 403 share of the next 100 deliveries is checked in the next shepherd cycles.
  11. devops-cli-service commented on Nov 17, 2026

    @devops-cli-service
    ContributorAuthor
  12. devops-cli-service commented on Nov 17, 2026

    @devops-cli-service
    ContributorAuthor

    Live since 2026-11-17 01:11 UTC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/mediumpriority/p2-mediumscope/cloudflaresource/agenttype/bugvalue/high

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions