fix(security): implement rate limiting to prevent brute force attacks - #11
Open
FaizanKolega wants to merge 1 commit into
Open
fix(security): implement rate limiting to prevent brute force attacks#11FaizanKolega wants to merge 1 commit into
FaizanKolega wants to merge 1 commit into
Conversation
- Replace stub guard implementations with ThrottlerGuard extensions - Add ThrottlerModule with Redis support and in-memory fallback - Configure default rate limits: Data API (100 req/min), Meta API (50 req/min), Public API (10 req/min) - Apply stricter limits for authentication endpoints (5 req/min, 15-min block) - Add NC_THROTTLER_* environment variables for customization - Implement granular tracking: IP + user + base/workspace for different API types - Add special handling for critical auth endpoints (signin, signup, password reset, token validation) Fixes rate limiting vulnerabilities in authentication, data export, job endpoints, and public APIs.
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.
Fixes rate limiting vulnerabilities in authentication, data export, job endpoints, and public APIs.
Change Summary
Implements rate limiting across all API endpoints to prevent brute force attacks and DoS vulnerabilities. Replaces stub guard implementations (DataApiLimiterGuard, MetaApiLimiterGuard, PublicApiLimiterGuard) with functional ThrottlerGuard extensions.
Fixes:
Change type
Test/ Verification
Authentication brute force protection:
Verify rate limits are enforced:
Check logs for throttler initialization:
Additional information / screenshots (optional)
Default configuration:
NC_THROTTLER_REDIS=redis://host:port/dbfor distributed rate limitingNC_THROTTLER_*environment variables@nestjs/throttlerpackage already in dependencies