Skip to content

Comments

Admin improvements#812

Merged
tonylee08 merged 9 commits intosb/admin-endpointsfrom
admin-improvements
Feb 3, 2026
Merged

Admin improvements#812
tonylee08 merged 9 commits intosb/admin-endpointsfrom
admin-improvements

Conversation

@tonylee08
Copy link
Collaborator

@tonylee08 tonylee08 commented Jan 22, 2026

Security

  • Constant-time token comparison - Prevents timing attacks on bearer token validation using subtle::ConstantTimeEq
  • Rate limiting on auth failures - 10 failed attempts/minute before returning 429, prevents brute-force attacks
  • Protected tokens in memory - Tokens wrapped in secrecy::Secret, zeroed on drop, prevents accidental logging
  • Audit logging - All admin actions logged with action type and key identifiers for traceability

Operational

  • Health check unauthenticated - /admin/health moved outside auth layer for load balancer probes
  • 404 on missing resources - delete_pool, delete_asset, and update_pool return 404 if resource doesn't exist
  • Atomic pool updates - update_pool now executes single UPDATE query instead of up to 4 separate queries
  • Startup warning - Logs warning if ADMIN_TOKENS env var is not configured

@tonylee08 tonylee08 changed the base branch from sb/admin-endpoints to main February 3, 2026 17:48
@tonylee08 tonylee08 changed the base branch from main to sb/admin-endpoints February 3, 2026 17:51
@tonylee08 tonylee08 merged commit 7bb7442 into sb/admin-endpoints Feb 3, 2026
1 check passed
sb- added a commit that referenced this pull request Feb 4, 2026
* admin endpoints

* fmt

* Admin improvements (#812)

* security and improvements

* rate limiting admin endpoints

* token in memory fix

* delete returns 404 if not found

* health behind auth

* admin warning if no token configured

* cargo fmt

* improvements

---------

Co-authored-by: Tony Lee <tony.lee@mystenlabs.com>
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.

2 participants