You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
description="RateLimitsFromHeaders emits per-request rate-limit override structs from trusted request<br />headers into io.envoy.ai_gateway dynamic metadata. Each header value must be formatted as<br />`<count>/<unit>` (e.g. `100000/HOUR`). Overrides the global defaults from GatewayConfig<br />for entries with the same MetadataKey."
3202
+
description="RateLimitsFromHeaders emits per-request rate-limit override structs from request headers<br />into io.envoy.ai_gateway dynamic metadata. Each header value must be formatted as<br />`<count>/<unit>` (e.g. `100000/HOUR`). Overrides the global defaults from GatewayConfig<br />for entries with the same MetadataKey.<br /><br />See RateLimitFromHeader for the security requirement to strip these headers from client<br />requests using ClientTrafficPolicy.spec.headers.earlyRequestHeaders.remove."
3203
3203
/>
3204
3204
3205
3205
@@ -3939,7 +3939,7 @@ GatewayConfigSpec defines the configuration for the AI Gateway.
description="GlobalRateLimitsFromHeaders defines gateway-level defaults for emitting per-request<br />rate-limit override structs from trusted request headers into io.envoy.ai_gateway dynamic metadata.<br />Route-scoped entries with the same MetadataKey take precedence."
3942
+
description="GlobalRateLimitsFromHeaders defines gateway-level defaults for emitting per-request<br />rate-limit override structs from request headers into io.envoy.ai_gateway dynamic metadata.<br />Route-scoped entries with the same MetadataKey take precedence.<br /><br />See RateLimitFromHeader for the security requirement to strip these headers from client<br />requests using ClientTrafficPolicy.spec.headers.earlyRequestHeaders.remove."
RateLimitFromHeader emits a per-request rate-limit override struct into io.envoy.ai_gateway
4674
-
dynamic metadata from a trusted request header. The header value must be formatted as
4674
+
dynamic metadata from a request header. The header value must be formatted as
4675
4675
"COUNT/UNIT" (e.g. "100000/HOUR"). The gateway parses it and writes a struct with
4676
4676
requests_per_unit and unit fields under MetadataKey — the struct
4677
4677
Envoy's RateLimit.Override.DynamicMetadata reads. If the header is absent or malformed the key is omitted.
4678
4678
4679
+
**Security note**: this feature reads the rate-limit value from an incoming request header.
4680
+
A client that can set this header can inflate its own quota. To prevent spoofing, you MUST strip
4681
+
the header from client requests before the HTTP filter chain (including ext-authz) processes it.
4682
+
Use `ClientTrafficPolicy.spec.headers.earlyRequestHeaders.remove` on the associated Gateway:
4683
+
4684
+
```yaml
4685
+
apiVersion: gateway.envoyproxy.io/v1alpha1
4686
+
kind: ClientTrafficPolicy
4687
+
spec:
4688
+
targetRefs:
4689
+
- group: gateway.networking.k8s.io
4690
+
kind: Gateway
4691
+
name: <your-gateway>
4692
+
headers:
4693
+
earlyRequestHeaders:
4694
+
remove: ["<header-name>"]
4695
+
```
4696
+
4697
+
After stripping, only a trusted component such as ext-authz (running after the strip) can set
4698
+
the header, ensuring the value reflects the actual tenant quota.
4699
+
4679
4700
##### Fields
4680
4701
4681
4702
@@ -4689,7 +4710,7 @@ Envoy's RateLimit.Override.DynamicMetadata reads. If the header is absent or mal
4689
4710
name="header"
4690
4711
type="string"
4691
4712
required="true"
4692
-
description="Header is the trusted request header whose value encodes the rate limit as `<count>/<unit>`,<br />where unit is one of SECOND, MINUTE, HOUR, DAY."
4713
+
description="Header is the request header whose value encodes the rate limit as `<count>/<unit>`,<br />where unit is one of SECOND, MINUTE, HOUR, DAY.<br /><br />This header must be set exclusively by a trusted component (e.g. ext-authz). See the security<br />note on RateLimitFromHeader for how to prevent client spoofing."
0 commit comments