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

Fix code scanning alert no. 8: Missing rate limiting #628

Closed
wants to merge 1 commit into from

Conversation

wagmarcel
Copy link
Member

Fixes https://github.com/IndustryFusion/DigitalTwin/security/code-scanning/8

To fix the problem, we need to introduce rate limiting to the Express application. The best way to do this is by using the express-rate-limit package, which allows us to easily set up rate limiting for our routes. We will configure a rate limiter to limit the number of requests to the /auth endpoint to a reasonable number per minute. This will help protect the application from denial-of-service attacks.

We will need to:

  1. Install the express-rate-limit package.
  2. Import the express-rate-limit package in the KafkaBridge/lib/authService/index.js file.
  3. Set up a rate limiter with appropriate configuration.
  4. Apply the rate limiter to the /auth route.

Suggested fixes powered by Copilot Autofix. Review carefully before merging.

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@wagmarcel wagmarcel closed this Dec 5, 2024
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.

1 participant