Skip to content

MANUAL RUN: free Cloudflare protections for codeSplitters (WAF, bots, auth rate-limit rule, Access on admin, Turnstile key) #653

Closed

Description

@QuinnsCode

Found in the security audit (notes/SECURITY_AUDIT.md). Free Cloudflare protections for the live codeSplitters site that are dashboard switches, not code:

  1. WAF managed rules (Security → WAF → Managed rules): the free managed ruleset is on by default for proxied zones. Check it's on for the codeSplitters domain.
  2. Bot Fight Mode (Security → Bots): on. Skip it if it blocks MCP clients or the CLI; then use a WAF custom rule to skip /api/* and /mcp with a bearer.
  3. A rate limiting rule (free plan: 1 rule, 10s window) on /api/auth/*, e.g. 20 requests / 10s per IP → block. It sits in front of the Worker, so no D1 writes.
  4. Cloudflare Access (Zero Trust, free up to 50 users) on the admin paths (/admin*, /api/admin*) with a one-time PIN to ADMIN_EMAIL or GitHub login. A stolen admin session then still needs the Access login. A small code change may be needed for the API paths' JSON clients; do the UI path first.
  5. Turnstile: create a widget for the domain (free) and put the secret into 1Password at op://codesplitters/turnstile/secret so the Turnstile code change can read it through varlock.
  6. Notifications (Notifications → Add): "Security Events Alert" and "Workers usage" to your email, and API token audit: list tokens at dash.cloudflare.com/profile/api-tokens and delete stale ones; check the drops token is R2-only on rustybuns-drops.

Check: each step's page shows it on; the auth rate-limit rule blocks a for i in $(seq 30); do curl -s -o /dev/null -w '%{http_code}\n' https://<site>/api/auth/get-session; done burst with a 429 near the end.

Activity

  1. added
    securityFound in the security audit (#135)
    manual runNeeds the owner to run it by hand (tokens, sign-ins); agents can't close it
    on Oct 11, 2026
  2. self-assigned this
    on Oct 11, 2026
  3. QuinnsCode commented on Oct 11, 2026

    @QuinnsCode
    OwnerAuthor

    11 Oct: Turnstile widget made, secret at op://codesplitters/turnstile/secret, site key in #720. A $10 billing budget alert emails the owner. API tokens reviewed (kept "Cloudflare Agent Token - 2026-06-24", recently used).

    Skipped: WAF managed rules, Bot Fight Mode, the /api/auth/* rate-limit rule and Access on /admin* all need a zone the account owns. codeSplitters is served from workers.dev, so they'd need a custom domain first. Leaving this open for that decision.

  4. QuinnsCode commented on Oct 11, 2026

    @QuinnsCode
    OwnerAuthor

    Walk-through 2026-10-11, done with the owner in the dashboard.

    Blocked: needs a custom domain. codeSplitters is served from codesplitters.notryanquinn.workers.dev, and these settings only apply to a domain of your own:

    • 1. WAF managed rules
    • 2. Bot Fight Mode
    • 3. Rate-limit rule on /api/auth/*
    • 4. Access on /admin*, /api/admin*
    • 6. "Security Events Alert" (also needs a custom domain)

    Done

    • 5. Turnstile widget created for the workers.dev host, and its secret saved to 1Password at op://codesplitters/turnstile/secret. The form went through twice, so there are two codesplitters widgets (site keys …TxsbLsHzvigdzX and …TyaxcLpAqRT0pg). When the Turnstile code change is built, use the one whose secret matches 1Password and delete the other.
    • 6. Usage alert: codesplitters-usage-alert1 (billing budget alert, email).
    • 6. Token audit (looked only, nothing deleted). The drops token (account token "Agentic office") is R2 bucket-item-write only. Worth a look by the owner:
      • User token "Cloudflare Agent Token - 2026-06-24": ~174 permissions on all accounts and zones, last used Jun 24. The broadest token on the account.
      • Duplicates: FlareUp ×3, staticflare-bootstrap ×2.

    Leaving this open as a manual run until codeSplitters is on a custom domain.

  5. QuinnsCode commented on Oct 11, 2026

    @QuinnsCode
    OwnerAuthor

    Done with what can be done on workers.dev (see the comment above). The steps that need a custom domain moved to #722.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

manual runNeeds the owner to run it by hand (tokens, sign-ins); agents can't close itsecurityFound in the security audit (#135)

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions