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 limiter whitelist of IP address #997

Closed
wants to merge 2 commits into from

Conversation

rastislav-chynoransky
Copy link
Contributor

As suggested in #792

config/app.php Outdated
Comment on lines 230 to 232
'whitelisted_ip_addresses' => env('RATE_LIMITER_WHITELISTED_IP_ADDRESSES')
? explode(',', env('RATE_LIMITER_WHITELISTED_IP_ADDRESSES'))
: [],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there an actual need for the configurability? Could we just list the IPs here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be handy to be able to add our own IP addresses.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean for development? Maybe we could disable it based on app environment then?

Copy link
Contributor

@eronisko eronisko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have any issues with the implementation, but I'm a little concerned that the whitelisting is potentially needed for development. In my opinion, the rate limiter should be a safety net, not a mode of operation.

My guess is that either

  • the rate limiter is too strict, or
  • the client implementation is not optimal, or
  • the API needs a design adjustment

In any case, from an architecture perspective, I don't think the assumption that "nobody should call this so often, except for us" is 100% sound. The "whitelisted" calls are ultimately being triggered by visitors, so still outside of our control. In fact, for those apps -- that might potentially generate lots of requests -- we're losing that safety mechanism altogether.

My suggestion would be to increase the rate limit for everyone to a level we're comfortable with.

cc @igor-kamil @FrantisekMichalSebestyen

@rastislav-chynoransky
Copy link
Contributor Author

rastislav-chynoransky commented Apr 18, 2024

When using SSR frontends the requests will come from our own server, that's why we need to make a whitelist here. And if high rates are an issue we should implement rate limiter on the caller side.

Copy link
Member

@igor-kamil igor-kamil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for now just turn it off. in case of troubles, we can back to it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants