-
Notifications
You must be signed in to change notification settings - Fork 886
coderd: tighten /login rate limiting #4432
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,6 +24,9 @@ const ( | |
SessionCustomHeader = "Coder-Session-Token" | ||
OAuth2StateKey = "oauth_state" | ||
OAuth2RedirectKey = "oauth_redirect" | ||
|
||
// nolint: gosec | ||
BypassRatelimitHeader = "X-Coder-Bypass-Ratelimit" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why not just allow owner to bypass implicitly without needing to set a header? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I thought it may lead to bugs / misunderstandings with other features that rely on the rate limit. For example, a spinning script. Also, we may not realize if the front end is sending too many requests since we usually test with Owner. |
||
) | ||
|
||
// New creates a Coder client for the provided URL. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another way to do this is add a resource for bypassing the rate limit. Then the FE can actually check if the capability exists, and we can give this to other roles as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Last I checked Rego was taking 20%+ of test CPU time, so it seems counterproductive the DoS prevention goals of the rate limiter. I added a comment to that effect.