Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Server]: Implement API Rate Limiting for Security #5

Open
NightClover-code opened this issue Dec 8, 2024 · 0 comments
Open

[Server]: Implement API Rate Limiting for Security #5

NightClover-code opened this issue Dec 8, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@NightClover-code
Copy link
Owner

NightClover-code commented Dec 8, 2024

Description:

To protect our API from abuse and potential DDoS attacks, we need to implement rate limiting across our endpoints, with special attention to authentication routes.

Current State:

Currently, there is no rate limiting implemented, which could leave the API vulnerable to abuse, especially for sensitive endpoints like authentication.

Required packages

pnpm add @nestjs/throttler

Suggested Rate Limits:

| Route | Time Window | Max Requests | Notes |
|-------|------------|--------------|-------|
| /auth/login | 15 minutes | 5 | Prevent brute force |
| /auth/register | 1 hour | 3 | Prevent spam accounts |
| /products (GET) | 1 minute | 30 | Regular browsing |
| /orders | 1 minute | 10 | Normal usage |
| /upload | 1 hour | 20 | Prevent abuse |

Relevant Docs

https://docs.nestjs.com/security/rate-limiting

@NightClover-code NightClover-code added the enhancement New feature or request label Dec 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant