SECOPS

Datadog WAF Anomaly to Cloudflare Rule Pull Request

When Datadog detects an anomalous blocked-request spike, it correlates the offending traffic in Cloudflare and opens a GitHub pull request adding the candidate firewall rule…

CategorySecOps
Enginesim
Difficultyadvanced
Triggerwebhook
Steps6
Setup~25 min

How it runs

The automated pipeline, trigger to output.

  • TriggerDatadog anomaly monitor webhookDatadogDatadog
  • ActionFetch matching requests from CloudflareCloudflareCloudflare
  • LogicExtract dominant attack signature
  • ActionRender signature as Terraform ruleset blockOpenAI
  • ActionOpen GitHub pull request with the ruleGitHubGitHub
  • OutputNotify on-call of pending rule PRSlack

What it does

It converts a Datadog WAF anomaly alert into a version-controlled change. Instead of clicking rules into a dashboard, the candidate rule lands as a GitHub pull request against your Cloudflare-as-code repo, so every block has a diff, an author, and a reviewer.

When to use it

When your firewall is managed by Terraform or another IaC tool and you require all production rule changes to flow through code review rather than the Cloudflare UI.

How it works

  1. 1A Datadog monitor webhook fires on a blocked-request anomaly.
  2. 2Pull the matching request samples from Cloudflare for the alert window.
  3. 3Logic extracts the dominant signature (path, country, ASN, header pattern).
  4. 4An LLM step renders the signature as a Terraform `cloudflare_ruleset` block with a comment citing the evidence.
  5. 5Open a GitHub pull request adding the block, with the Datadog alert link in the body.
  6. 6Notify the on-call channel in Slack that a rule PR is awaiting review.

Set it up

What you configure once, before turning it on.

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