tracker.log file not producing actual IP addresses

Bug #1657123 reported by Paul Everitt
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
KARL4
Fix Released
Medium
Carlos de la Guardia

Bug Description

In production, we're simply logging the IP address of the frontend server 195.62.126.159

We looked at this a bit and found that it was hard to do in the Pyramid 1.2 that we're using. But obviously the information is in the incoming request headers somewhere.

Revision history for this message
Carlos de la Guardia (cguardia) wrote :

A bit hard to figur ethis out so far. It works fine on staging, so it would appear that the X-Forwarded-For header is not being set correctly somewhere in the production frontend chain. I took a look at the configs on staging and production and they appear to be set correctly. Both staging and production have exactly the same frontend configuration, right?

Revision history for this message
Paul Everitt (paul-agendaless) wrote : Re: [Bug 1657123] tracker.log file not producing actual IP addresses

They are both generated from the same Fabric script, but with different parameters. Is it possible that the nginx config is different? (You should be able to compare the karl configs and the nginx configs prod vs staging.)

—Paul

> On Jan 28, 2017, at 2:20 PM, Carlos de la Guardia <email address hidden> wrote:
>
> A bit hard to figur ethis out so far. It works fine on staging, so it
> would appear that the X-Forwarded-For header is not being set correctly
> somewhere in the production frontend chain. I took a look at the configs
> on staging and production and they appear to be set correctly. Both
> staging and production have exactly the same frontend configuration,
> right?
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1657123
>
> Title:
> tracker.log file not producing actual IP addresses
>
> Status in KARL4:
> New
>
> Bug description:
> In production, we're simply logging the IP address of the frontend
> server 195.62.126.159
>
> We looked at this a bit and found that it was hard to do in the
> Pyramid 1.2 that we're using. But obviously the information is in the
> incoming request headers somewhere.
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/karl4/+bug/1657123/+subscriptions

Revision history for this message
Carlos de la Guardia (cguardia) wrote :

I think these are the relevant lines:

karlstaging00 /etc/nginx/local/karlstaging.conf:

        location / {
                proxy_set_header X-Vhm-Host https://$host;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_pass http://app_servers;
        }

osfkarl00 /etc/nginx/local/osfkarl.conf:

        location / {
                proxy_set_header X-Vhm-Host https://$host;
                proxy_pass http://osfkarl;
        }

Note how the X-Forwarde-For line is missing in production.

Is that part of the fabric scripts?

Changed in karl4:
status: New → In Progress
Revision history for this message
Paul Everitt (paul-agendaless) wrote :

Nope, that’s something that Flying Circus provides, but we can edit. You then restart based on these instructions:

  https://flyingcircus.io/doc/guide/platform_gentoo/nginx.html

—Paul

> On Jan 29, 2017, at 1:33 AM, Carlos de la Guardia <email address hidden> wrote:
>
> I think these are the relevant lines:
>
> karlstaging00 /etc/nginx/local/karlstaging.conf:
>
> location / {
> proxy_set_header X-Vhm-Host https://$host;
> proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
> proxy_pass http://app_servers;
> }
>
> osfkarl00 /etc/nginx/local/osfkarl.conf:
>
> location / {
> proxy_set_header X-Vhm-Host https://$host;
> proxy_pass http://osfkarl;
> }
>
> Note how the X-Forwarde-For line is missing in production.
>
> Is that part of the fabric scripts?
>
> ** Changed in: karl4
> Status: New => In Progress
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1657123
>
> Title:
> tracker.log file not producing actual IP addresses
>
> Status in KARL4:
> In Progress
>
> Bug description:
> In production, we're simply logging the IP address of the frontend
> server 195.62.126.159
>
> We looked at this a bit and found that it was hard to do in the
> Pyramid 1.2 that we're using. But obviously the information is in the
> incoming request headers somewhere.
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/karl4/+bug/1657123/+subscriptions

Revision history for this message
Carlos de la Guardia (cguardia) wrote :

I believe this is fixed. Sorry it took so long, I was not very familiar with the frontend setup.

Changed in karl4:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.