Skip to content

Feat/cloudflare edge bot block - #86

Merged
agjs merged 3 commits into
mainfrom
feat/cloudflare-edge-bot-block
Jun 1, 2026
Merged

Feat/cloudflare edge bot block#86
agjs merged 3 commits into
mainfrom
feat/cloudflare-edge-bot-block

Conversation

@agjs

@agjs agjs commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

Summary

Test plan

  • bun run check (or bun run check:full for the cross-app pass) from the repo root
  • Stack smoke if compose/infra touched: cd infra/compose/compose && ./dev.sh up

App merge bars

Area Command
API cd apps/api && bun run validate
UI cd apps/ui && bun run validate
Docs cd apps/docs && bun run build:ci
Repo drift bun run check (from repo root)

Conventions

  • No any, no blind as, no !
  • New env vars in schema + .env.example (+ SECURITY.md when relevant)
  • Tests updated for changed behavior

Screenshots

agjs and others added 3 commits June 2, 2026 00:36
Adds a cloudflare_ruleset (http_request_firewall_custom phase) that blocks common scanner paths (/.env, /.git/, /wp-admin, …) at the edge before they reach Traefik/api/ui. Path list is a root variable (bot_block_paths) defaulting to a sensible set; on by default, toggle via enable_bot_blocking. Validation rejects an /.well-known/acme-challenge entry (would break ACME). Documented in provisioning-with-tofu.mdx.
…bot-blocking

Cloudflare module additions, all free-tier and on by default:
- auth_rate_limit: Managed Challenge on /api/auth/* (Cloudflare's free rate-limit rule), in front of the app's Valkey limiter
- edge_cache: cache Vite's content-hashed /assets/* for a year, bypass /api/*
- zone_dnssec: sign the zone (auto at CF Registrar; DS exposed via dnssec_ds_record output otherwise)
- bot_block now also matches any hidden dotfile (with /.well-known carve-out) and empty/known-scanner user-agents; patterns are lowercased so matching is truly case-insensitive

All gated by enable_* toggles; tofu fmt + validate pass.
@agjs
agjs merged commit 639bde7 into main Jun 1, 2026
30 checks passed
@agjs
agjs deleted the feat/cloudflare-edge-bot-block branch June 1, 2026 22:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant