SECOPS

Auto-Open a GitHub PR to Reconcile Cloudflare WAF Drift

When live Cloudflare WAF rules diverge from the baseline, this captures the live state and opens a GitHub pull request updating the baseline file.

CategorySecOps
Enginesim
Difficultyadvanced
Triggerschedule
Steps6
Setup~25 min

How it runs

The automated pipeline, trigger to output.

  • TriggerScheduled reconciliation run
  • ActionExport normalized live Cloudflare WAF rulesetCloudflareCloudflare
  • ActionRead current baseline file from GitHubGitHubGitHub
  • LogicDiff live state against baseline
  • ActionCommit live snapshot to a new branchGitHubGitHub
  • OutputOpen pull request summarizing the driftGitHubGitHub

What it does

This treats your live Cloudflare WAF configuration as the proposal and your Git baseline as the source of truth. On a schedule it exports the current ruleset, and if it differs from the committed baseline, it writes the live state to a branch and opens a GitHub pull request. Reviewers then merge to bless the change or close it to flag a rollback.

When to use it

Use it when you want every firewall change to converge back into version control through review rather than drift silently. It is ideal for GitOps-style teams who would rather adjudicate drift in a PR diff than chase it in a dashboard.

How it works

  1. 1A schedule starts the reconciliation run.
  2. 2Cloudflare returns the full live WAF and firewall ruleset, normalized to the baseline format.
  3. 3GitHub provides the current baseline file from the main branch.
  4. 4A diff logic step determines whether the live state differs from baseline.
  5. 5If it differs, a GitHub step commits the live snapshot to a new branch.
  6. 6The output step opens a pull request with a summary of every changed rule for human review.

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.