-
Notifications
You must be signed in to change notification settings - Fork 16
Implement Rate Limit Feature - Sreejith #38
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
base: main
Are you sure you want to change the base?
Conversation
|
Add ResourcesAndRateLimitingTestCase for OWASP API4:2023 Implements automated testing for Unrestricted Resource Consumption (API4:2023) according to the OWASP API Security Top 10 2023. This test case detects:
Each vulnerability is reported with severity rating and remediation guidance. |
| } | ||
|
|
||
| try { | ||
| String fullUrl = "https://example.com" + endpoint.getPath(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The fullUrl variable is hardcoded with "https://example.com". This should be replaced with a mechanism to use the target URL from the scan configuration.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed
| long responseTime = endTime - startTime; | ||
|
|
||
| // If the response time is very high, it might indicate an expensive operation | ||
| if (responseTime > 5000) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The search test uses a fixed response time threshold (5 seconds). This could be made configurable or adjusted based on typical API response times.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed
| private static final Logger logger = LogManager.getLogger(ResourcesAndRateLimitingTestCase.class); | ||
|
|
||
| // Thresholds for testing | ||
| private static final int RATE_LIMIT_TEST_REQUESTS = 20; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These hard coding part, we need to see how we can make it configurable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed
No description provided.