mirror of
https://github.com/jhd3197/ServerKit.git
synced 2026-12-04 06:01:23 +09:00
Add a WAF tab to the Cloudflare Zone Settings page for managing custom firewall rules (the http_request_firewall_custom phase entry-point ruleset). - CloudflareClient: ruleset list/get + phase-entrypoint create (PUT) + per-rule POST/PATCH/DELETE. - CloudflareService: list rules (empty when no custom ruleset yet, distinguished from an auth error by listing rulesets first), add rule (creates the ruleset on first use), update/delete, and three one-click presets — lock WordPress admin to an IP, block common exploit paths, challenge suspicious bots. The IP in the lock preset is validated with ipaddress so it can't inject expression syntax; rule actions are constrained to a safe terminal subset. - /api/v1/cloudflare/zones/:id/waf/* routes (list any user; add/preset/update/ delete admin). - WafPanel component (preset picker + custom-rule form + active-rules list with enable toggle and delete); api methods; SCSS. Tests: ruleset discovery, empty vs auth-error, create-on-first-rule vs append, action validation, preset IP validation + safe expression, update/delete (10). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>