Repository navigation
order: password-protect the /admin order list in nginx - #1669
Merged
Merged
Conversation
The order list was reachable by anyone holding the admin token in a ?k= URL, which is easy to paste into chat or browser history. nginx now asks for a password first (user admin, a bcrypt hash in /etc/nginx/fab-admin.htpasswd) and hands the app its token itself from a root-only include (/etc/fab/nginx-admin.conf), so the person signs in with a password alone. /admin gets its own rate limit (30/min per address, burst 20) so guesses are slow. Without the password file every /admin request fails closed; without the token include the app asks for ?k= as before. Tested on the live server: no, wrong or token-only credentials get 401 (also for /admin/files, POST /admin/order, /%61dmin, //admin, /x/../admin); the right password lists the orders; /v1/health and /terms unchanged; rapid wrong guesses are cut off with 503. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
The order list was reachable by anyone holding the admin token in a ?k= URL,
which is easy to paste into chat or browser history. nginx now asks for a
password first (user admin, a bcrypt hash in /etc/nginx/fab-admin.htpasswd)
and hands the app its token itself from a root-only include
(/etc/fab/nginx-admin.conf), so the person signs in with a password alone.
/admin gets its own rate limit (30/min per address, burst 20) so guesses
are slow. Without the password file every /admin request fails closed;
without the token include the app asks for ?k= as before.
Tested on the live server: no, wrong or token-only credentials get 401
(also for /admin/files, POST /admin/order, /%61dmin, //admin, /x/../admin);
the right password lists the orders; /v1/health and /terms unchanged; rapid
wrong guesses are cut off with 503.
🤖 Generated with Claude Code