Description
The /scan and /scan-url endpoints execute resource-intensive operations, including running external security scanners (Semgrep, OSV-Scanner, and Gitleaks) and writing scan results to disk. Currently, there is no rate limiting, allowing a single client to overwhelm the server by sending repeated scan requests.
Implement IP-based rate limiting using slowapi to protect the service from abuse and accidental resource exhaustion.
Acceptance Criteria
Expected Impact
- Prevents abuse of expensive scan endpoints.
- Improves server stability under heavy traffic.
- Makes rate limits configurable for different deployment environments.
Difficulty: Easy–Medium
Description
The
/scanand/scan-urlendpoints execute resource-intensive operations, including running external security scanners (Semgrep, OSV-Scanner, and Gitleaks) and writing scan results to disk. Currently, there is no rate limiting, allowing a single client to overwhelm the server by sending repeated scan requests.Implement IP-based rate limiting using slowapi to protect the service from abuse and accidental resource exhaustion.
Acceptance Criteria
SCAN_RATE_LIMITenvironment variable.Retry-Afterheader when the limit is exceeded.SCAN_RATE_LIMITin a new Configuration section ofREADME.md.Expected Impact
Difficulty: Easy–Medium