Project

General

Profile

Feature #1799

Respect HTTP_X_FORWARDED_FOR for configured list of ip addresses.

Added by Steve Traylen about 10 years ago. Updated about 10 years ago.

Status:
Closed
Priority:
Normal
Category:
Unattended installations
Target version:
Difficulty:
Triaged:
No
Bugzilla link:
Pull request:
Fixed in Releases:
Found in Releases:

Description

Hi
app/controllers/unattended_controller.rb

contains:

elsif (ip = request.env['REMOTE_ADDR']) =~ /127.0.0/
      ip = request.env["HTTP_X_FORWARDED_FOR"] unless request.env["HTTP_X_FORWARDED_FOR"].nil?
end

i.e if connecting from localhost then respect the HTTP_X_FORWARDED_FOR for requests for e.g.
http://judy.cern.ch/unattended/built

Having set up a remote http load balencer in front of two foreman hosts this 127.0.0 needs to be configured to whatever
that remote host is. After editing unattended_controller.rb to contain my balencers ip address the unattended scripts
work as expected.


Related issues

Related to Foreman - Bug #21628: Using the setting "Update IP from built request" when building host through proxy, the IP will be updated with the proxy instead of the host IPNew2017-11-10

Associated revisions

Revision 50e78f00 (diff)
Added by Hannes Schaller about 10 years ago

fixes #1799 moved REMOTE_ADDR verification to settings

History

#1 Updated by Ohad Levy about 10 years ago

what would you like we change? make it as a setting? or always respect the forwarded ip header?

#2 Updated by Ohad Levy about 10 years ago

  • Target version set to 1.1

#3 Updated by Ohad Levy about 10 years ago

  • Assignee changed from Ohad Levy to Hannes Schaller

#4 Updated by Hannes Schaller about 10 years ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100

#5 Updated by Ivan Necas almost 5 years ago

  • Related to Bug #21628: Using the setting "Update IP from built request" when building host through proxy, the IP will be updated with the proxy instead of the host IP added

Also available in: Atom PDF