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

Rate limits for unauthenticated endpoints can cause denial of service in environments using a single NATed IP #30909

Closed
webvictim opened this issue Aug 23, 2023 · 8 comments
Assignees
Labels
bug c-cp Internal Customer Reference tsh tsh - Teleport's command line tool for logging into nodes running Teleport. ux

Comments

@webvictim
Copy link
Contributor

webvictim commented Aug 23, 2023

Expected behavior

Teleport rate limits should be higher for login attempts in NATed office environments, or otherwise configurable through config file/dynamic cluster resource config.

Current behavior

Lots of users logging in at once (for example at the beginning of a day) can cause Teleport to emit errors on login:

Screenshot 2023-08-23 at 11 01 18

Current unauthenticated rate limits appear to be an average of 20 requests per minute with an allowed burst of 40:

This was a Teleport Cloud tenant, but the rate limits are the same for all clusters.

Bug details:

  • Teleport version: 13.3.5 11.3.20
@webvictim webvictim added bug tsh tsh - Teleport's command line tool for logging into nodes running Teleport. ux c-cp Internal Customer Reference labels Aug 23, 2023
@zmb3
Copy link
Collaborator

zmb3 commented Aug 23, 2023

I raised this in #24623 (comment) and some of the limits applied where were reverted in #27747.

The max rate reached error is from oxy's ratelimiter, so it is definitely us and not a rate limit from an upstream API.

@jentfoo
Copy link
Contributor

jentfoo commented Aug 23, 2023

It's worth calling out that the PR's above exist only in master and wont be released till Teleport 14. So issues in T13 are not from the PR's linked above.

That said, those changes actually may improve the situation in a couple ways:

So there is some potential that the customer may have an improved experience with T14. But a feature improvement to make these values configurable would be best for everyone.

@zmb3
Copy link
Collaborator

zmb3 commented Aug 23, 2023

Good point. It would be great to know which endpoint is being rate limited above so we can determine if the upcoming changes will help the situation.

@webvictim
Copy link
Contributor Author

The customer was unable to get further details on the particular endpoint as when they went to run tsh -d login, the rate limit was no longer in force. I suspect it was either webapi/ping or webapi/find though.

@jentfoo
Copy link
Contributor

jentfoo commented Aug 23, 2023

With 13 neither ping or find have any rate limits:

h.GET("/webapi/find", httplib.MakeHandler(h.find))
// Issue host credentials.
h.POST("/webapi/host/credentials", httplib.MakeHandler(h.hostCredentials))
}
// bindDefaultEndpoints binds the default endpoints for the web API.
func (h *Handler) bindDefaultEndpoints() {
h.bindMinimalEndpoints()
// ping endpoint is used to check if the server is up. the /webapi/ping
// endpoint returns the default authentication method and configuration that
// the server supports. the /webapi/ping/:connector endpoint can be used to
// query the authentication configuration for a specific connector.
h.GET("/webapi/ping", httplib.MakeHandler(h.ping))
h.GET("/webapi/ping/:connector", httplib.MakeHandler(h.pingWithConnector))

@webvictim
Copy link
Contributor Author

My apologies, I made an error - the tenant is on v11.3.20. It seems the limiter code is quite different there.

@jentfoo
Copy link
Contributor

jentfoo commented Sep 19, 2023

@webvictim is further action needed on this issue?

@webvictim
Copy link
Contributor Author

Given that the customer will need to upgrade to v12 and beyond soon to remain in support, I think it's OK to close this.

@jentfoo jentfoo closed this as completed Sep 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug c-cp Internal Customer Reference tsh tsh - Teleport's command line tool for logging into nodes running Teleport. ux
Projects
None yet
Development

No branches or pull requests

3 participants