Rate-limiting by JWT token #4231
Replies: 1 comment 8 replies
-
I dont think the headers can be spoofed, they should get overwritten by the jwt filter Using SeurityPolicy's Jwt claimToHeader feature + the Distinct type in Global Ratelimit https://gateway.envoyproxy.io/docs/tasks/traffic/global-rate-limit/#rate-limit-distinct-users should solve your use case We could enhance the Global RateLimit to treat |
Beta Was this translation helpful? Give feedback.
-
In our first steps with Envoy Gateway we have installed it with Helm on Kubernetes in AWS, we have set up a few HTTPRoutes, we have integrated with Keycloak for authentication and we have enabled rate-limiting at a PoC level. This community has provided considerable help already and for that we are grateful.
In our platform we want to rate-limit not by headers (that can be spoofed) but by the contents of the submitted token that was received from Keycloak.
We have confirmed that the token contains data such as the email address of the account. How can we set up rate-limiting based on such values? In the docs there is a very brief reference to this matter, with a security provider that is configured to expose JWT claims in the form of HTTP headers, is that necessary? Can we not directly refer to the "email" claim inside the token when we define our BackendTrafficPolicy?
Beta Was this translation helpful? Give feedback.
All reactions