IT OPS

Cloudflare WAF Drift Detector with GitHub Baseline Review

Pulls live Cloudflare WAF rules on a schedule, diffs them against an approved baseline stored in GitHub, and opens a pull request to review any drift before it goes unnoticed.

CategoryIT Ops
Enginesim
Difficultyintermediate
Triggerschedule
Steps5
Setup~15 min

How it runs

The automated pipeline, trigger to output.

  • TriggerDaily schedule fires the drift check
  • ActionFetch live WAF rules from Cloudflare zoneCloudflareCloudflare
  • ActionLoad approved waf-baseline.json from GitHubGitHubGitHub
  • LogicDiff live config vs baseline; exit if identical
  • OutputOpen GitHub PR with the drift for security reviewGitHubGitHub

What it does

Keeps your Cloudflare Web Application Firewall honest. On a schedule it fetches the current WAF ruleset for a zone, compares it field by field against the last approved baseline committed in your GitHub repo, and turns any difference into a reviewable pull request instead of a silent production change.

When to use it

Run this when your WAF config is supposed to be change-controlled but people still edit rules in the Cloudflare dashboard during incidents. It catches out-of-band edits, gives security a paper trail, and forces every rule change through code review.

How it works

  1. 1A daily schedule fires the workflow.
  2. 2Cloudflare returns the live WAF custom rules and managed-rule overrides for the target zone.
  3. 3The workflow loads the committed `waf-baseline.json` from GitHub and computes a structured diff.
  4. 4A logic step checks whether the diff is empty; if nothing changed it exits quietly.
  5. 5When drift exists it writes the new live config to a branch and opens a GitHub pull request showing added, removed, and modified rules.
  6. 6The PR description tags the security reviewers so an approved merge becomes the new baseline.

Set it up

What you configure once, before turning it on.

  1. 1
    Connect CloudflareWorkers, Pages, R2, KV — the edge stack.
  2. 2
    Connect GitHubRepos, issues, pull requests, actions.
  3. 3
    Set each agent's modelWe leave models unset so you pick the tier — fast + cheap, or top-quality.
  4. 4
    Tune it to your dataEdit the prompts, filters, and field mappings so it matches how your team works.
  5. 5
    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.