SECOPS

Rotate Leaked Cloudflare Token on GitHub Secret-Scan Alert

When GitHub secret scanning flags a leaked Cloudflare API token in a repo, it automatically rolls the token at Cloudflare, swaps the new value into the repo's Actions secrets.

CategorySecOps
Enginesim
Difficultyintermediate
Triggerwebhook
Steps5
Setup~15 min

How it runs

The automated pipeline, trigger to output.

  • TriggerGitHub secret-scanning alert receivedGitHubGitHub
  • LogicFilter: alert is a Cloudflare API token
  • ActionCreate new Cloudflare token, revoke leaked oneCloudflareCloudflare
  • ActionUpdate repo Actions secret with new tokenGitHubGitHub
  • OutputPost rotation receipt to SlackSlack

What it does

Closes the loop between detection and remediation for a single high-blast-radius credential type: Cloudflare API tokens. The moment GitHub's secret scanning fires an alert for a Cloudflare token, this workflow mints a fresh token, invalidates the exposed one, updates the GitHub Actions secret so CI keeps working, and records exactly what happened.

When to use it

Use it when your team ships Cloudflare automation from GitHub and you cannot afford the hours between a leak alert and a human rotating the key by hand. Best for orgs where Cloudflare tokens gate DNS, WAF, or Workers deploys.

How it works

  1. 1GitHub secret-scanning alert webhook fires with the detected secret type.
  2. 2A filter confirms the alert type is a Cloudflare API token; anything else exits.
  3. 3Cloudflare creates a replacement token with the same scopes, then revokes the leaked one.
  4. 4The new token value is written back into the repo's GitHub Actions secret.
  5. 5A Slack message delivers the rotation receipt: repo, alert URL, old token id revoked, and timestamp.

Set it up

What you configure once, before turning it on.

  1. 1
    Connect GitHubRepos, issues, pull requests, actions.
  2. 2
    Connect CloudflareWorkers, Pages, R2, KV — the edge stack.
  3. 3
    Connect SlackChannels, DMs, threads, mentions.
  4. 4
    Set each agent's modelWe leave models unset so you pick the tier — fast + cheap, or top-quality.
  5. 5
    Tune it to your dataEdit the prompts, filters, and field mappings so it matches how your team works.
  6. 6
    Test, then turn it onRun once against a sample, confirm the output, then enable the trigger.

Run this workflow in your colony.

14-day trial. No DevOps. No Sales call. Provisioned in under a minute.