cloudflare-edge-hardening
Enforce and audit all 10 Free-Tier Cloudflare Edge Security & Speed dimensions across all 59 active zones and 4 AI Gateways via cloudflare-free-tier-hardener.ts and cloudflare-mcp.
SKILL.mdskills/cloudflare-edge-hardening/SKILL.md
GitHubCloudflare Free-Tier Maximum Leverage Edge Hardening (59 Zones, 13 Zone Dimensions & 4 AI Gateways)
13 Enforced Zone-Level Free-Tier Security & Performance Dimensions (bin/cloudflare-free-tier-hardener.ts)
- 5 Free WAF Custom Firewall Rules (
http_request_firewall_customphase —295active rules across59zones):[Free-WAF-1]Block Sensitive Dotfiles, VCS, Env & Backup Leaks (/.env,/.git/,/.aws/,/.ssh/,/wp-config.php,/phpinfo.php,.sql,.bak)[Free-WAF-2]Block CMS, PHP, CGI & Path Traversal Exploit Probes (/wp-admin,/wp-login.php,/xmlrpc.php,/vendor/phpunit,/cgi-bin/,../,/actuator/)[Free-WAF-3]Block Known Vulnerability Scanner & Exploit User-Agents (sqlmap,nikto,nuclei,masscan,zgrab,acunetix,nessus,dirbuster,gobuster)[Free-WAF-4]Enforce Standard HTTP Methods & BlockTRACE/TRACKAbuse[Free-WAF-5]Managed Challenge on Empty-UA Automated Auth & Admin Probes (/admin*,/api/auth/sign-in*,/login)
- 1 Free HTTP Rate Limiting Rule (
http_ratelimitphase —59/59zones):[Free-RateLimit-1]Protect Auth & Login POST Endpoints Against Brute-Force Floods (25 req / 10spercf.colo.id+ip.src).
- 4 Free Edge Security Response Headers (
http_response_headers_transformphase —59/59zones):X-Content-Type-Options: nosniffReferrer-Policy: strict-origin-when-cross-originX-Permitted-Cross-Domain-Policies: nonePermissions-Policy: camera=(), microphone=(), geolocation=(), payment=()
- 2 Free Edge Cache Rules (
http_request_cache_settingsphase —118rules across59/59zones):[Free-Cache-1]Bypass Edge Cache for Dynamic API, Auth, MCP, Webhook & Admin Routes (/api/*,/admin*,/webhook*,/mcp*).[Free-Cache-2]Aggressive Edge (30d) & Browser (1y) Cache for Immutable Hashed Static Assets (/assets/*,.woff2,.avif,.webp).
- 1 Free Zstandard (
zstd+brotli+gzip) Compression Rule (http_response_compressionphase —59/59zones):[Free-Compress-1]Preferzstd,brotli, andgzipacross all compressible web, JSON/RFC 9457 (application/problem+json), SVG, XML, and WebAssembly responses.
- 1 Free API-Safe Config Rule (
http_config_settingsphase —59/59zones):[Free-Config-1]Disable Email Obfuscation (email_obfuscation: false) on/api/*,/webhook*, and/mcp*JSON endpoints so@email strings inside JSON responses are never rewritten.
- Free Smart Tiered Cache (
tiered_cache_smart_topology_enable = "on"—59/59zones). - Free Bot Fight Mode & AI Scraper Block (
enable_js: true,fight_mode: true,ai_bots_protection: "block"—59/59zones). - Free Leaked Credential Checks (
POST /zones/:id/leaked-credential-checksenabled: true—59/59zones). - Free Page Shield Client-Side JS Supply-Chain Monitor (
PUT /zones/:id/page_shieldenabled: true—59/59zones). - Free DNSSEC (
PATCH /zones/:id/dnssecstatus: "active"—59/59zones). - Free RFC-3986 URL Normalization at Both Incoming WAF & Origin Scope (
PUT /zones/:id/url_normalization{"type":"cloudflare","scope":"both"}—59/59zones). - 25 Free Zone Security & Speed Settings (
59/59zones =1,475zone settings):0rtt: "on",always_online: "on",always_use_https: "on",automatic_https_rewrites: "on",brotli: "on",browser_check: "on",early_hints: "on",ech: "on",email_obfuscation: "on",hotlink_protection: "on",http3: "on",ip_geolocation: "on",ipv6: "on",min_tls_version: "1.2",opportunistic_encryption: "on",opportunistic_onion: "on",pq_keyex: "on"(Post-Quantum ML-KEM),privacy_pass: "on",pseudo_ipv4: "add_header",replace_insecure_js: "on",security_header(1-year HSTS Preloadmax_age: 31536000, include_subdomains: true, preload: true, nosniff: true),security_level: "medium",tls_1_3: "zrt",websockets: "on", andspeed_brain: "on".
4 Hardened Cloudflare AI Gateways (projectsites, megabyte-os, projectsites-dev, megabyte-space)
collect_logs: true,log_classification: true,retry_max_attempts: 3,retry_delay: 1000,retry_backoff: "exponential".
Multi-Swarm Parallelization & OpenCode (DeepSeek) Offload Mandate
- Domain Swarm Directive: Decompose work into contract-locked OpenSpec DAG nodes, convene a right-sized SCRUM quorum (
claude+codex+gemini) for key decisions, and offload all throughput-safe implementation, plugin catalogs, unit tests (100% coverage), and parallel Cloudflare Browser Run E2E suites toopencode(DeepSeek) swarms. - Massive OpenCode (DeepSeek) Offload: Whenever a task slice is throughput-safe (bounded implementation, plugin catalog shards, 100% unit test generation, Playwright E2E specs, migrations, or documentation), offload it to parallel
opencodeswarms powered by DeepSeek (~/.agentskills/bin/opencode-deepseek.shvia the LiteLLM 4-key poolhttps://llm.megabyte.space/v1) rather than consuming premiumclaude,codex, orgeminiclient quota. - Tri-Frontier Parallel Swarms & Right-Sized SCRUM Quorum: When complex architectural synthesis, speculative critical-path racing, or adversarial verification is needed, run
claude,codex, andgeminiin parallel across isolated Git worktrees (bin/multi-swarm-orchestrator.ts) guided by a right-sized collaborative SCRUM meeting (bin/scrum-deliberation-quorum.ts) of only the required specialist agents. Seerules/parallel-multi-swarm-orchestration.md. - End-of-Round Parallel Meaning & Preference Triad Extraction (
bin/triad-end-of-turn-sync.ts): At the end of every prompt round (running in parallel with final verification, deployment, and reporting), extract any possible meaning, preference, architectural lesson, reusable site code, or system configuration from the current agent window and store it concurrently intoheymegabyte/agent-skills(for AI skills/rules/prompts — always updated under the Minimum-Prompt Ecosystem Completeness Assumption: assuming the skills should have already been written so that we write as few prompts as possible to finish as complete a product or multi-repo ecosystem as possible via massive parallel agent swarms),heymegabyte/theme.tools(for reusable site/app code across the 28 canonical@theme.tools/*libraries), andheymegabyte/install.doctor(for reusable system/host code). - Concurrent End-of-Prompt Delivery Closure: Run documentation/comment reconciliation and bounded
theme.tools,install.doctor, andagent-skillsextraction reviews concurrently with proportional tests and release preparation. After reconciling those changes and generated outputs, revalidate the exact final tree. Commit only that tested tree, push it normally tomain, promote it through the approved production rail, and run production smoke plus critical E2E verification. Fail closed without mutating production when authority, credentials, spending permission, review, recovery, validation, or provenance gates are missing; record the exact blocker instead.