SECOPS

Rotate a leaked Cloudflare API key and invalidate active sessions

On a manual incident trigger, this workflow rolls the exposed Cloudflare API key, purges cached edge tokens, and writes an audit record to Postgres before notifying the team.

CategorySecOps
Enginesim
Difficultyintermediate
Triggermanual
Steps5
Setup~15 min

How it runs

The automated pipeline, trigger to output.

  • TriggerOperator starts rotation with exposed key ID
  • ActionRoll Cloudflare API key and revoke the old oneCloudflareCloudflare
  • ActionPurge sessions and cached edge tokensCloudflareCloudflare
  • ActionInsert audit record into PostgresPostgreSQLPostgres
  • OutputConfirm rotation complete in SlackSlack

What it does

Gives an operator a one-click way to retire a compromised Cloudflare API key. It generates a new key, invalidates the sessions and cached tokens tied to the old one, and persists a tamper-evident audit row before announcing the rotation.

When to use it

Use this when a Cloudflare key shows up in a paste, a screenshot, or a misconfigured CI log and you need a controlled, recorded rotation rather than a panicked manual scramble. The manual trigger lets the responder confirm scope before anything is destroyed.

How it works

  1. 1An operator starts the workflow manually with the exposed key ID and incident reference.
  2. 2The workflow calls Cloudflare to roll the API key and revoke the old credential.
  3. 3It triggers a session and cached-token purge so anything signed with the old key stops working.
  4. 4An audit record is inserted into Postgres with who, what, when, and the incident reference.
  5. 5A Slack notice confirms the new key is live and the old one is dead.

Set it up

What you configure once, before turning it on.

  1. 1
    Connect CloudflareWorkers, Pages, R2, KV — the edge stack.
  2. 2
    Connect PostgresAny Postgres URL — query, write, migrate.
  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.