Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remove the default retry policy for jwks fetch #4802

Merged
merged 4 commits into from
Nov 29, 2024

Conversation

zhaohuabing
Copy link
Member

@zhaohuabing zhaohuabing commented Nov 28, 2024

The current jwt implementation in the SecurityPolicy uses a default retry policy. While this default is reasonable from the perspective of a single Envoy, it could potentially overwhelm the JWKS server if multiple Envoys and SecurityPolicy instances are configured with the same JWKS.

This default retry policy can be removed as EG already enables https://www.envoyproxy.io/docs/envoy/latest/api-v3/extensions/filters/http/jwt_authn/v3/config.proto#extensions-filters-http-jwt-authn-v3-jwksasyncfetch with a failed_refetch_duration of 1s, which will refetch the jwks every 1s if failed.

Fixes #4791

Release Notes: Yes

arkodg
arkodg previously approved these changes Nov 28, 2024
@arkodg arkodg requested review from a team November 28, 2024 03:23
Signed-off-by: Huabing Zhao <[email protected]>
release-notes/current.yaml Outdated Show resolved Hide resolved
Copy link

codecov bot commented Nov 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 65.65%. Comparing base (17e932c) to head (2134cfc).
Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4802      +/-   ##
==========================================
+ Coverage   65.59%   65.65%   +0.05%     
==========================================
  Files         211      211              
  Lines       32001    32000       -1     
==========================================
+ Hits        20992    21010      +18     
+ Misses       9767     9750      -17     
+ Partials     1242     1240       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@arkodg arkodg requested review from a team November 29, 2024 04:59
@zirain zirain merged commit 526a05f into envoyproxy:main Nov 29, 2024
24 checks passed
@zhaohuabing zhaohuabing deleted the remove-jwks-retry-policy branch November 29, 2024 05:49
zhaohuabing added a commit to zhaohuabing/gateway that referenced this pull request Nov 29, 2024
* remove the default retry policy for jwks fetch

Signed-off-by: Huabing Zhao <[email protected]>

* fix gen

Signed-off-by: Huabing Zhao <[email protected]>

* Update release-notes/current.yaml

Co-authored-by: Arko Dasgupta <[email protected]>
Signed-off-by: Huabing Zhao <[email protected]>

---------

Signed-off-by: Huabing Zhao <[email protected]>
Co-authored-by: Arko Dasgupta <[email protected]>
(cherry picked from commit 526a05f)
Signed-off-by: Huabing Zhao <[email protected]>
zhaohuabing added a commit to zhaohuabing/gateway that referenced this pull request Nov 29, 2024
* remove the default retry policy for jwks fetch

Signed-off-by: Huabing Zhao <[email protected]>

* fix gen

Signed-off-by: Huabing Zhao <[email protected]>

* Update release-notes/current.yaml

Co-authored-by: Arko Dasgupta <[email protected]>
Signed-off-by: Huabing Zhao <[email protected]>

---------

Signed-off-by: Huabing Zhao <[email protected]>
Co-authored-by: Arko Dasgupta <[email protected]>
(cherry picked from commit 526a05f)
Signed-off-by: Huabing Zhao <[email protected]>
zhaohuabing added a commit that referenced this pull request Nov 29, 2024
* use a waitGroup instead of an enabled channel in the status updater (#4809)

use a waitGroup instead of a channel in the status updater

* use a waitGroup to synchronize to the `Send` method that the
status updater is enabled and ready for updates

Signed-off-by: Arko Dasgupta <[email protected]>
(cherry picked from commit 36939dc)
Signed-off-by: Huabing Zhao <[email protected]>

* fix: remove the default retry policy for jwks fetch (#4802)

* remove the default retry policy for jwks fetch

Signed-off-by: Huabing Zhao <[email protected]>

* fix gen

Signed-off-by: Huabing Zhao <[email protected]>

* Update release-notes/current.yaml

Co-authored-by: Arko Dasgupta <[email protected]>
Signed-off-by: Huabing Zhao <[email protected]>

---------

Signed-off-by: Huabing Zhao <[email protected]>
Co-authored-by: Arko Dasgupta <[email protected]>
(cherry picked from commit 526a05f)
Signed-off-by: Huabing Zhao <[email protected]>

---------

Signed-off-by: Arko Dasgupta <[email protected]>
Signed-off-by: Huabing Zhao <[email protected]>
Co-authored-by: Arko Dasgupta <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Jwks async fetching failed due to multiple requests per second.
3 participants