cloudflare-waf-author

Draft Cloudflare WAF custom rules and managed-rule exceptions with validated inputs.

15|2|Updated Dec 13, 2025
One-click install
npx skills add https://github.com/d-padmanabhan/agent-engineering-handbook --skill cloudflare-waf-author
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cloudflare-waf-author
Source: https://github.com/d-padmanabhan/agent-engineering-handbook/tree/main/skills/cloudflare-waf-author
Command: npx skills add https://github.com/d-padmanabhan/agent-engineering-handbook --skill cloudflare-waf-author

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill prevents broken or overly broad Cloudflare WAF changes by enforcing a safe, docs-first, evidence-backed authoring workflow for both custom WAF rules and managed-rule exceptions.

Core Features & Use Cases

  • Rule-type correct workflow: Forces an explicit branch between Custom Rules (custom actions like block/challenge/log/skip-as-allow) and Managed-Rule Exceptions (skip) so the ruleset phase and behavior are correct.
  • Docs-first predicate drafting: Requires reading the authoritative Cloudflare Ruleset Engine docs and copying field/operator details accurately before writing expressions.
  • Peer-rule mirroring: Mandates surveying the closest existing rules for the same zone so the new rule matches house patterns and evaluation shape.
  • Requester confirmation gate: Collects required inputs (hosts/paths/methods, source IP shape, soak plan, and—when applicable—specific OWASP child-rule IDs) before any expression is drafted.
  • Provenance + consistency requirements: Enforces mandatory rationale artifacts (Terraform comments, Dashboard runbook entries, or API sibling .md files) plus four-source consistency checks to prevent title/body/code drift.
  • Self-checks and anti-pattern avoidance: Includes per-interface and cross-cutting checklists (e.g., allow-before-block ordering, multi-value header correctness, safe API ETag + test validation, and soak-first block promotion).

Quick Start

Use cloudflare-waf-author to draft a Cloudflare WAF Custom Rule (or a Managed-Rule Exception) that blocks or skips specific traffic on a given host and path using the chosen interface (Terraform, Dashboard, or API).

Frequently Asked Questions about cloudflare-waf-author

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write safe Cloudflare WAF custom rules without breaking production traffic?

Drafting safe Cloudflare WAF custom rules requires selecting the correct ruleset phase, validating required inputs like hosts and paths, and mirroring existing peer rules to match house patterns before generating expressions.

How do I create a Cloudflare WAF managed-rule exception to skip specific OWASP child rules?

To create a Cloudflare WAF managed-rule exception, you select the skip workflow, collect specific OWASP child-rule IDs, and generate an accurate expression for Terraform, Dashboard, or API interfaces.

Does the Cloudflare Ruleset Engine require different expressions for Terraform, Dashboard, and API?

Yes, the Cloudflare Ruleset Engine requires interface-specific anti-pattern avoidance, such as managing Terraform rule positioning and performing API ETag plus expression test validation for safe deployment.

What is the best way to manage Cloudflare WAF rule provenance and consistency across interfaces?

Managing Cloudflare WAF rule provenance requires mandatory rationale artifacts like Terraform comments or API sibling markdown files, plus four-source consistency checks to prevent configuration drift across interfaces.

When should I use a soak plan before promoting a Cloudflare WAF custom rule to block traffic?

A soak plan is required before promoting a Cloudflare WAF custom rule to block traffic, allowing you to validate expression matches during a logging phase and prevent unintended blocks or false positives.

What limitations exist when drafting Cloudflare WAF rules for multi-value headers?

Drafting Cloudflare WAF rules for multi-value headers requires guard-by-type checks and accurate field operator copying from Ruleset Engine documentation to avoid evaluation shape mismatches and processing errors.