Closed
Bug 993674
Opened 11 years ago
Closed 11 years ago
relengweb: Configure Zeus to send X-Forwarded-For, and use it in Apache configs
Categories
(Infrastructure & Operations Graveyard :: WebOps: Other, task)
Infrastructure & Operations Graveyard
WebOps: Other
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: dustin, Assigned: cliang)
Details
Attachments
(3 files)
The cluster currently uses the Zeus-default X-Cluster-Client-Ip, but everyone else seems to have standardized on the non-default X-Forwarded-For. So we should use those too.
Reporter | ||
Comment 1•11 years ago
|
||
Webops: this isn't a huge priority, but may help in keeping the releng cluster in line with other clusters.
Assignee: dustin → server-ops-webops
Component: RelOps → WebOps: Other
QA Contact: arich → nmaul
Assignee | ||
Updated•11 years ago
|
Assignee: server-ops-webops → cliang
Assignee | ||
Comment 2•11 years ago
|
||
I've added the rule that adds the X-Forwarded-For header to the releng-stage-http and releng-stage-https virtual servers on both the internal and external VIPs. Does it make sense to see how it works in staging for a week before applying to production? Or is this one of the situations where it is either safe or desirable to have this applied to production now?
Reporter | ||
Comment 3•11 years ago
|
||
The headers are only used by Apache for access control, so I think the next step is to change those ACLs in puppet and see that staging is still access-controlling properly. As a test case, http://buildapi.pvt.build.mozilla.org/ should only be available from the listed IPs (it might be easiest for you to verify from nagios1) and not from other 10.x addresses.
If that's OK, then it's fine to move on to production.
Assignee | ||
Comment 4•11 years ago
|
||
Apologies for my brain-deadness, but I'm not what is the safest way to alter the allow-build-net-zlb.conf.erb template for just staging. (If there is a clear path for doing so, I'm not seeing it.)
Does it make sense to, in both of the loops in the template, to put in an if statement to use X-Cluster-Client-IP versus X-Forwarded-For, based on the environment variable? That is, something like:
<% environment = scope.lookupvar("environment") -%>
<% vpn_internal_regexps.each do |subnet| -%>
<%- if environment == "stage" -%>
RewriteCond %{HTTP:X-Forwarded-For} !^<%= subnet %>$
<%- else -%>
RewriteCond %{HTTP:X-Cluster-Client-Ip} !^<%= subnet %>$
<%- end -%>
<% end -%>
Reporter | ||
Comment 5•11 years ago
|
||
Oh, good point. No, I think that's more likely to introduce breakage than to avoid it. We might be overthinking this!
I think something as simple as a tcpdump to verify that the request headers seen on each port (80..82, since 83 appears not to be in use) contain identical values in the X-{Forwarded-For,Cluster-Client-Ip} headers should be enough to be confident that the change will have no impact.
Assignee | ||
Comment 6•11 years ago
|
||
Assignee | ||
Comment 7•11 years ago
|
||
Assignee | ||
Comment 8•11 years ago
|
||
Reporter | ||
Comment 9•11 years ago
|
||
lgtm!
Assignee | ||
Comment 10•11 years ago
|
||
Changes applied to the releng and releng-https virutal servers on both the internal and external VIPs.
Please reopen this bug if I've missed something.
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Comment 11•11 years ago
|
||
This is resolved now, but for future reference, Zeus always adds a header "X-Cluster-Client-IP" whose value is the external IP that made the request to Zeus.
Reporter | ||
Comment 12•11 years ago
|
||
That's what we were using, but after atoll pointed out that their foreman configuration expects X-Forwarded-For, I noticed that *all* other webapps use X-Forwarded-For, so I filed this bug to make releng look more like everything else.
Updated•6 years ago
|
Product: Infrastructure & Operations → Infrastructure & Operations Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•