[Backend] Add dedicated rate limiting on /api/v1/health to prevent scraper DoS
Overview
The health check route /api/v1/health currently performs active database and Redis ping operations on every request, but is excluded from rate limiting.
Problem
- Aggressive monitoring scrapers or external scanners could flood
/health, saturating database connection pools.
Proposed Changes
- Attach a dedicated light rate limiter to
/health(e.g. 60 requests per minute per IP). - Cache health check status in memory for 2 seconds to avoid executing DB/Redis queries on consecutive bursts.
Acceptance Criteria
- [ ] Rapid requests within 2 seconds return cached health response without pinging DB.
- [ ] Exceeding rate limit returns
429 Too Many Requests. - [ ] Liveness probes continue to pass normally under expected intervals.
@chidii has applied to work on this issue as part of the Stellar Wave Program's 9th wave.
Hello Maintainer, I've reviewed this issue thoroughly and I'm well positioned to resolve it — experienced across the relevant stack and comfortable navigating the existing codebase. Ready to start right away.
ℹ️ Repo Maintainers: To accept this application, review their application or assign @chidii to this issue.
Congratulations, @chidii! 🎉 Your application was accepted by the repo's maintainers, and the issue is due on September 30, 2026.
🧑💻 @chidii: Please resolve the issue such that the repo's maintainers have enough time to review your contribution before the due date. You'll earn Points for completing the issue on-time, which will make you eligible for a share of the Stellar Wave Program's reward pool.
[!WARNING] When opening a PR, please link it to this issue to ensure it gets tracked accurately. Points are awarded when this issue is marked as completed by the maintainer.
🤠 Repo maintainers: Please keep an eye on the contributor's progress and review their work before the due date. You can manage this issue, including adjusting its complexity and points, here.
🌊 Happy Wave 🌊
PR: #1579
🎉 This issue has been marked as completed on GrantFox!
@chidii's PR #1579 was approved and merged by @K1NGD4VID.
🏆 @chidii: You earned 40 FoxPoints for this contribution! Your current tier: Builder (1,545 total points). Track your full progress on GrantFox.
👏 Great work, @chidii! Keep contributing to LabsCrypt.
This issue has been marked as completed by a Drips Wave moderator for @chidii as part of the Stellar Wave Program's 9th Wave 🥳
Moderator's reason: [Auto-assessed] The PR #1579 was approved and merged by maintainer @K1NGD4VID as recorded in the issue comments and PR metadata (mergedAt timestamp present). The changes correctly implement the requested 60 req/min rate limiter and 2-second in-memory status cache for the health check route.
😎 @chidii: You earned 200 Points for completing this issue! After the current Wave ends, you'll be eligible for a percentage of the Wave's reward pool based on the percentage of total points you've earned. Learn more here.
🧑💻 Repo maintainers: How'd the contributor do? Leave a review to share your experience working with them.
ℹ️ Note: This issue was marked complete via moderation. Points were issued even though the GitHub issue remains open.