Conversation
Scanner probes targeting the planner (SSH keys, cloud configs, .env files, Vite RSC source-map probing) also hit this app; none are valid routes. Return 404 at nginx instead of forwarding to Hono, alongside the existing bad-bot and rate-limit guards. Two regex locations in config/nginx.conf.erb: - sensitive or unknown file extensions (nested paths included), excluding the /static asset dir - extension-less probes seen in the canonical log archive (id_rsa- style key names, wp-* paths, /__vite_rsc_findSourceMapURL, the debug-trigger path) Code review findings shaped the final rules: the .env branch missed .env.local and .env.production variants (fixed), and the e2e suite bypasses nginx entirely, so nothing verified this config (addressed with a new CI job below). Curls in the CI job use a browser user-agent because the existing bad-bot map 444s curl. New nginx CI job renders the ERB, runs nginx -t, and asserts a curl matrix: scanner probes 404 at the edge, /static assets and app routes pass through. Verified against a live nginx:alpine container: the full probe and passthrough matrix passes, and prettier:check is clean.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Block scanner junk at the nginx edge so it never reaches the auth app.
The planner gets the same treatment in codebar/planner#2884; this applies the identical rules to the auth nginx config. Probes have not targeted the auth host in the log archive yet, but wordlists don't discriminate, and the config already carries bad-bot and rate-limit guards. None of the blocked patterns are valid auth routes, so the block is behaviour-preserving.
Changes
Two regex locations in
config/nginx.conf.erb, ahead of thelocation /proxy:/staticasset dirid_rsa-style key names,wp-*paths,/__vite_rsc_findSourceMapURL, the debug-trigger probe,Dockerfile,__debug__,userfiles,backup,private[-_]keyNew CI job
nginx-edge-configrenders the ERB, runsnginx -t, and asserts a curl matrix: scanner probes 404 at the edge,/staticassets and app routes pass through. Curls use a browser user-agent because the existing bad-bot map 444s curl. The e2e suite bypasses nginx entirely, so nothing previously verified this config.Verification
nginx -tnginx:alpinecontainer, sized under the existinglimit_reqburstprettier:checkcleanReview notes
/staticexclusion is a hand-maintained allowlist. A new public asset directory outside/staticwould silently 404 at the edge; the CI matrix is the guard, so keep both in sync./api/auth/*paths) still reach Better Auth unchanged.