cartalyst / sentinel

A framework agnostic authentication & authorization system.
BSD 3-Clause "New" or "Revised" License
1.51k stars 238 forks source link

Throttling for proxy (AWS ELB) #531

Open rubenvl2 opened 4 years ago

rubenvl2 commented 4 years ago

Description

Hi! We are using Sentinel in a multi-server environment in AWS, using ELB (Elastic Load Balancer) that acts as a proxy.

Unfortunately, the throttling is using the internal IP. The HTTP header includes the proxy real user address but Sentinel doesn't seem to have any option to get this address instead of the local subnet internal one.

Do you have any option to get the real user IP ?

Thanks!

Example

Here you can see the local IPs in the throttling table https://snipboard.io/aPz98f.jpg

brunogaspar commented 4 years ago

Seems to be a problem within the Symfony Http component as i don't recall we retrieve the ip address in any other way.

rubenvl2 commented 4 years ago

@brunogaspar thanks! will investigate further with symfony/Laravel and if we find anything will post it back here. Thanks! :)

brunogaspar commented 4 years ago

Sure, sounds good.

I know that there issues with load balancers on Google Cloud App Engine, not sure if it's kinda related with AWS.

ikkez commented 3 years ago

for the record: this only seems to be an issue, if you initialize sentinel before the middlewares are loaded.. i.e. with a static call in a custom service provider