sektioneins / suhosin

SUHOSIN [수호신] for PHP 5.x - The PHP security extension.
https://www.suhosin.org
Other
471 stars 71 forks source link

use different HTTP headers other than X-Forwarded-For #94

Open joerg-mi opened 9 years ago

joerg-mi commented 9 years ago

Dear all,

our web server is behind a proxy cascade. So the X-Forwarded-For header only delivers the ip address of the front end proxy but the ip address is in a different header (for example X-Remote-Client-IP). Changing the names is not possible for technical reasons outside my influence.

To deal with this I integrated a new option suhosin.log.remote-addr-header (with "HTTP_X_FORWARDED_FOR" as default). This option is only used if suhosin.log.remote-addr-header is enabled.

I decided to use the php style to reference headers. So you have to prepend HTTP_ and translate hyphens to underscores.

I also integrated a documented entry in the suhosin.ini and added some test scripts.

with kind regards, Joerg