🛡️ Zone Security Policy Comparison Tool

Compare security policies across Cloudflare zones and identify configuration deltas

📦 What's Included

⬇ Download Python Tool 👁 View Sample Report 📖 View README

🚀 Quick Start

Prerequisites

Required API Token Permissions

PermissionLevelNeeded For
Zone WAF ReadZoneWAF rules, custom/managed rules
Zone Settings ReadZoneSecurity settings comparison
Firewall Services ReadZoneIP access rules
Zone ReadZoneZone listing and details

Run It

# Compare all zones in your account
python cf_zone_security_compare.py --token YOUR_TOKEN --account YOUR_ACCOUNT_ID

# Compare specific zones
python cf_zone_security_compare.py --token YOUR_TOKEN --zones ZONE_ID_1,ZONE_ID_2

# Use environment variable for token
export CLOUDFLARE_API_TOKEN=your_token
python cf_zone_security_compare.py --account YOUR_ACCOUNT_ID

# Use a config file
python cf_zone_security_compare.py --config config.json

📊 What the Report Shows

CategoryWhat's Compared
WAF Custom RulesExpressions, actions, enabled state
WAF Managed RulesDeployed rulesets, overrides
Rate LimitingRate limit configurations
DDoS L7L7 DDoS protection rules
Bot Fight ModeSuper Bot Fight Mode rules
Security SettingsTLS, security level, browser check, challenge TTL
IP Access RulesAllowlists, blocklists, challenges

For each category, rules are classified as: