Replies: 7 comments 13 replies
-
We where able to add the request header by using the %REQ('Headername')% now. Another question is the following. We wanted to check the generated nginx configuration on the pod (we are deploying using the helm chart) but we are not able to connect to the pod. Is there a way to provide a value to the helm chart which enables us to debug in such a manner? |
Beta Was this translation helpful? Give feedback.
-
there's a lot of things being discussed here, so I'll add some links here which you'll find helpful
|
Beta Was this translation helpful? Give feedback.
-
@arkodg creib and I are colleagues, working on the same issue for several weeks now. As you may remember, we have recently discussed our case, where we need to rate-limit based on a JWT claim. We can't use the security policy approach because we have 50+ tenants and therefore we need as many providers and Huabing Zao has told us that there's a limit of 4 providers. So we have implemented External Auth, where the ExtAuth service not only returns the validation result, but also returns the JWT claim as a header. Now, using v1.2.1 and EarlyHeaderModification, we have added this required header into the original request. However, when we submit the client request to our Envoy URL, even though we do see the new header in the request, we see no rate-limit activity. It's as though rate-limiting decisions have been already made, and therefore "retro-adding" the required header made no difference. Which surprises us because in the filter sequence we have seen that rate-limiting takes place just before routing, i.e. practically last in sequence. What would you suggest here? Also as creib mentioned, we cannot open a shell into the three pods (main envoy-gateway, pod-for-our-own-gateway and envoy-ratelimit), and therefore we cannot see the code you are using inside NginX so we can perhaps understand it and figure out a solution. Is there something we can do to enable this kind of access? Thanks for your help! |
Beta Was this translation helpful? Give feedback.
-
Sure. For reference,
|
Beta Was this translation helpful? Give feedback.
-
HI @arkodg, thanks again for your help. Here is where we stand: With our current setup, when we submit the request with curl and manually add the critical header When we submit the same request properly (without the manual header), we don't get rate-limiting, it is not triggered. The critical header is returned to us with the response, both as "x-extracted-erp" and as "x-acme-erp", though of course this is not our goal here. We tried also without the "early-header" trick, and saw that rate-limiting stopped working altogether, i.e. even with the manual header. Here is the setup:
Can you see a way out?? |
Beta Was this translation helpful? Give feedback.
-
How would you suggest we set it then? |
Beta Was this translation helpful? Give feedback.
-
We removed the EarlyHeaders trick and rate-limiting worked. Thanks for your help! |
Beta Was this translation helpful? Give feedback.
-
Hi,
we are trying to implement the following use-case, where the information on how a user should be rate limited is part of the Bearer Token.
We are using the ExternalAuth Security Policy to implement our own logic for authorization. In this step we are also extracting the value for rate limiting for this user.
The idea was, that we add the rate limit value as a response header to the response of the external auth endpoint.
Then we wanted to add a new request header with this value to the initial request.
Is this approach working at all? Is the auth security policy executed before the rate limiting? How would we be able to use the value from the auth response as a value for a new request header?
Thanks a lot in advance.
Beta Was this translation helpful? Give feedback.
All reactions