feat(rate-limiting): Implement core rate limiting functionality with configuration, decision-making, metrics, middleware, and service registration
- Add RateLimitConfig for configuration management with YAML binding support. - Introduce RateLimitDecision to encapsulate the result of rate limit checks. - Implement RateLimitMetrics for OpenTelemetry metrics tracking. - Create RateLimitMiddleware for enforcing rate limits on incoming requests. - Develop RateLimitService to orchestrate instance and environment rate limit checks. - Add RateLimitServiceCollectionExtensions for dependency injection registration.
This commit is contained in:
18
datasets/reachability/ground-truth/basic/gt-0001/main.c
Normal file
18
datasets/reachability/ground-truth/basic/gt-0001/main.c
Normal file
@@ -0,0 +1,18 @@
|
||||
// gt-0001: Direct call to vulnerable sink from main
|
||||
// Expected: REACHABLE (tier: executed)
|
||||
// Vulnerability: CWE-120 (Buffer Copy without Checking Size)
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
char buffer[32];
|
||||
|
||||
if (argc > 1) {
|
||||
// Vulnerable: strcpy without bounds checking
|
||||
strcpy(buffer, argv[1]); // SINK: CWE-120
|
||||
printf("Input: %s\n", buffer);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
{
|
||||
"$schema": "https://stellaops.io/schemas/sample-manifest.v1.json",
|
||||
"sampleId": "gt-0001",
|
||||
"version": "1.0.0",
|
||||
"category": "basic",
|
||||
"description": "Direct call to vulnerable sink from main - REACHABLE",
|
||||
"language": "c",
|
||||
"expectedResult": {
|
||||
"reachable": true,
|
||||
"tier": "executed",
|
||||
"confidence": 1.0
|
||||
},
|
||||
"source": {
|
||||
"files": ["main.c"],
|
||||
"entrypoint": "main",
|
||||
"sink": "strcpy",
|
||||
"vulnerability": "CWE-120"
|
||||
},
|
||||
"callChain": [
|
||||
{"function": "main", "file": "main.c", "line": 5},
|
||||
{"function": "strcpy", "file": "<libc>", "line": null}
|
||||
],
|
||||
"annotations": {
|
||||
"notes": "Simplest reachable case - direct call from entrypoint to vulnerable function",
|
||||
"difficulty": "trivial"
|
||||
},
|
||||
"createdAt": "2025-12-17T00:00:00Z",
|
||||
"createdBy": "corpus-team"
|
||||
}
|
||||
Reference in New Issue
Block a user