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:
master
2025-12-17 18:02:37 +02:00
parent 394b57f6bf
commit 8bbfe4d2d2
211 changed files with 47179 additions and 1590 deletions

View 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;
}

View File

@@ -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"
}