Skip to content

CBST2-06: Implement rate limiting for JWT auth failures #310

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

Open
wants to merge 45 commits into
base: main
Choose a base branch
from

Conversation

jclapis
Copy link
Collaborator

@jclapis jclapis commented May 28, 2025

This adds a customizable setup to the signer module for rate limiting requests after repeated JWT authorization failures from a client. The implementation is simple: if a client fails JWT authorization X times, they are added to a cooldown and any subsequent requests will be denied until the cooldown completes.

The failure limit is controlled in the [signer] config with jwt_auth_fail_limit, or with the SIGNER_JWT_AUTH_FAIL_LIMIT_ENV environment variable.

The cooldown timeout (in seconds) is controlled in the [signer] config with jwt_auth_fail_timeout_seconds, or with the SIGNER_JWT_AUTH_FAIL_TIMEOUT_SECONDS_ENV environment variable.

As a side-effect, this also adds a unit testing setup for the Signer module since one wasn't in place yet. A test for this rate limiting behavior is included.

ltitanb and others added 28 commits May 13, 2025 17:17
@jclapis jclapis self-assigned this May 28, 2025
@jclapis jclapis added the signer Signer module label May 28, 2025
@jclapis jclapis changed the title Implement rate limiting for JWT auth failures CBST2-06: Implement rate limiting for JWT auth failures Jun 3, 2025
@jclapis jclapis marked this pull request as ready for review June 9, 2025 21:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
signer Signer module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants