Add RateLimiter to RawController
What does this MR do?
Add a Rate Limiter Request to
- Limits raw requests to 300 per minute and per raw path.
- Add a new attribute to ApplicationSettings so user can change this value on their instance.
Gitlab::ActionRateLimiterto limit the raw requests.
- Add a new method into ActionRateLimiter to log the event into
Related to #48717 (closed)
Does this MR meet the acceptance criteria?
- Changelog entry
- [-] Documentation created/updated or follow-up review issue created
- [-] Code review guidelines
- [-] Merge request performance guidelines
- Style guides
- Database guides
- Separation of EE specific content
Performance and testing
- Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process.
- [-] Tested in all supported browsers
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
- [-] Label as security and @ mention
- [-] The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
- [-] Security reports checked/validated by a reviewer from the AppSec team
|Admin area||Raw endpoint blocked|
- For testing purposes, the rate limit request was set to
10requests per minute.
- First tab uses:
- Second tab uses:
- Make RateLimiter to accept a string as a key (Right now it only accepts Active Record models)
Limit endpoint to 300 requests per minute
- Value should be read from ApplicationSetting or config. Default to 300.
If there are more log the requests (probably to
- Tests and refactor
- Manual QA