Page MenuHomePhabricator

Deprecate and disable port 80 for one-off sites under canonical domains
Closed, ResolvedPublic

Description

Leveraging the fact that WMF canonical domains are on the HSTS preload list, we don't need to listen on port 80, as every request even http:// ones should reach the servers via https thanks to HSTS.

The first step will be to replace the current redirect from http to https with a simple 403, on a second stage we will disable port 80 completely.

Sites rejecting traffic on port 80 with a 403 response:

  • apt.wikimedia.org
  • archiva.wikimedia.org
  • icinga.wikimedia.org
  • dumps.wikimedia.org
  • gerrit.wikimedia.org
  • gitlab.wikimedia.org
  • librenms.wikimedia.org
  • lists.wikimedia.org (per https://phabricator.wikimedia.org/T238720#8752022)
  • mirrors.wikimedia.org
  • orchestrator.wikimedia.org

Related Objects

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Change 551950 had a related patch set uploaded (by Vgutierrez; owner: Vgutierrez):
[operations/puppet@production] librenms: Reject plain text requests with a 403

https://gerrit.wikimedia.org/r/551950

Note very old browsers may not support HSTS preload list or even HSTS itself; probably we want to configure a specific 403 message (or still redirect them when user agent is these browsers).

we are targeting here the one-off sites, some of them are already configured to support TLSv1.2 only, that's usually a stricter requirement for UAs than HSTS support itself.

Comparing https://caniuse.com/#feat=tls1-2 VS https://caniuse.com/#feat=stricttransportsecurity it looks like all the UAs that support TLSv1.2 also support HSTS wit h the exception of Opera Mini, I believe that's not a blocker for the one-off sites.

Just to be clear, wikipedia and the rest of the canonical sites are out of scope for this task :)

Vgutierrez triaged this task as Medium priority.Nov 20 2019, 5:22 AM
Vgutierrez moved this task from Backlog to TLS on the Traffic board.

Change 551950 merged by Vgutierrez:
[operations/puppet@production] librenms: Reject plain text requests with a 403

https://gerrit.wikimedia.org/r/551950

For information, due to this bug in Firefox, when the user type the URL without the "https://" prefix Firefox does not even try to connect to https when port 80 is closed. This means Firefox displays a timeout error - I just tried with Firefox Nightly. Hence some users could report "Wikipedia is unreachable".

Hmm with HSTS the browser shouldn't even try port 80.

Yes, indeed, I have to precise my test was with a non-HSTS site, and it seems there is no issue with HSTS-preloaded sites according to this comment. I tested connecting to Wikipedia as an HSTS-preloaded site and blocking locally my port 80 in output with iptables, there is no issue.

So this Firefox bug is not an issue here.

BBlack added a subscriber: BBlack.

The swap of Traffic for Traffic-Icebox in this ticket's set of tags was based on a bulk action for all such tickets that haven't been updated in 6 months or more. This does not imply any human judgement about the validity or importance of the task, and is simply the first step in a larger task cleanup effort. Further manual triage and/or requests for updates will happen this month for all such tickets. For more detail, have a look at the extended explanation on the main page of Traffic-Icebox . Thank you!

Change 859449 had a related patch set uploaded (by Vgutierrez; author: Vgutierrez):

[operations/puppet@production] orchestrator: Reject non-tls requests with a 403

https://gerrit.wikimedia.org/r/859449

Change 859449 merged by Vgutierrez:

[operations/puppet@production] orchestrator: Reject non-tls requests with a 403

https://gerrit.wikimedia.org/r/859449

Change 859457 had a related patch set uploaded (by Vgutierrez; author: Vgutierrez):

[operations/puppet@production] icinga: Reject non-tls requests with a 403

https://gerrit.wikimedia.org/r/859457

Change 859467 had a related patch set uploaded (by Vgutierrez; author: Vgutierrez):

[operations/puppet@production] dumps: Reject non-tls requests with a 403

https://gerrit.wikimedia.org/r/859467

Change 859467 merged by Vgutierrez:

[operations/puppet@production] dumps: Reject non-tls requests with a 403

https://gerrit.wikimedia.org/r/859467

Change 859498 had a related patch set uploaded (by David Caro; author: David Caro):

[operations/puppet@production] dumps: fix http alert to check the new status

https://gerrit.wikimedia.org/r/859498

Change 859498 merged by David Caro:

[operations/puppet@production] dumps: fix http alert to check the new status

https://gerrit.wikimedia.org/r/859498

Change 859457 merged by Vgutierrez:

[operations/puppet@production] icinga: Reject non-tls requests with a 403

https://gerrit.wikimedia.org/r/859457

Mentioned in SAL (#wikimedia-operations) [2022-11-22T13:57:46Z] <vgutierrez> block plain text requests on icinga.wm.o - T238720

Change 859983 had a related patch set uploaded (by Vgutierrez; author: Vgutierrez):

[operations/puppet@production] archiva: Reject non-tls requests with a 403

https://gerrit.wikimedia.org/r/859983

Change 859986 had a related patch set uploaded (by Vgutierrez; author: Vgutierrez):

[operations/puppet@production] gerrit: Reject non-tls requests with a 403

https://gerrit.wikimedia.org/r/859986

Change 859983 merged by Vgutierrez:

[operations/puppet@production] archiva: Reject non-tls requests with a 403

https://gerrit.wikimedia.org/r/859983

Change 859986 merged by Vgutierrez:

[operations/puppet@production] gerrit: Reject non-tls requests with a 403

https://gerrit.wikimedia.org/r/859986

BCornwall changed the task status from Open to Stalled.Mar 24 2023, 10:42 PM
BCornwall moved this task from TLS to Ready for work on the Traffic board.
BCornwall lowered the priority of this task from Medium to Low.Mar 24 2023, 10:49 PM
BCornwall added a subscriber: BCornwall.

Change 904843 had a related patch set uploaded (by BCornwall; author: BCornwall):

[operations/puppet@production] gitlab: Disable listening on port 80

https://gerrit.wikimedia.org/r/904843

Change 904854 had a related patch set uploaded (by BCornwall; author: BCornwall):

[operations/puppet@production] lists: Disable access on port 80

https://gerrit.wikimedia.org/r/904854

BCornwall changed the task status from Stalled to In Progress.Mar 31 2023, 9:16 PM
BCornwall claimed this task.
BCornwall moved this task from Backlog to Traffic team actively servicing on the Traffic board.

@Ladsgroup You expressed opposition to removing :80 from lists. Is that to say that you don't see a way forward and that lists should be removed from the sites in the ticket description?

Well, I don't oppose it, it's just that this port is used internally and it'll break, you might be able to see the traffic flowing if you do tcpdump on the host, the archiver service (hyperkitty daemon) calls the webservice on port 80 in localhost and when I was doing the upgrade of mm2 to mm3 I couldn't find a workaround for it back then but this kind of work is not usual to me so I might have missed some easy way to fix it. If there is not an easy way or you don't want to/have resources, I don't oppose leaving it as-is and removing the site from this ticket's description.

Hope that clears it a bit.

@brennen @hashar there is a open change to disable port 80 on GitLab, similar to Gerrit some time ago.

Any concerns with that? I would create a similar announcement on wikitech-l like we've done for gerrit.

Gitlab being fairly recent, I don't think it ever got advertised with http rather than https so it must be fine to drop port 80 entirely. For Gerrit, that is pretty much the same (it always had https).

Maybe we have some statistics somewhere to lookup whether people try to reach Gitlab over http / port 80, but I don't think it matters.

I have +1 ed the Puppet change.

Gitlab being fairly recent, I don't think it ever got advertised with http rather than https so it must be fine to drop port 80 entirely. For Gerrit, that is pretty much the same (it always had https).

Maybe we have some statistics somewhere to lookup whether people try to reach Gitlab over http / port 80, but I don't think it matters.

I have +1 ed the Puppet change.

Thanks for the feedback and review.

Regarding statistics we have nginx access logs. Logstash/access logs do not contain the port so it's a bit tricky to find http requests. We can look for http 301 like the following logstash query:
https://logstash.wikimedia.org/goto/c2db07f5cf2163763138820d35062d33

But I think the above search contains also https traffic.

That does not provide much information :) I say go for it, I don't think anything accesses Gitlab from http.

Change 904843 merged by BCornwall:

[operations/puppet@production] gitlab: Disable listening on port 80

https://gerrit.wikimedia.org/r/904843

I send a short message on wikitech-l, in case something breaks on GitLab so users are aware of the change.
Thanks for merging!

BCornwall updated the task description. (Show Details)

I went ahead and struck lists off of the.... list since it seems there's a reason for port 80 to be exposed. If removing port 80 is something we want to do for that service, I think creating a new ticket would be beneficial. Thanks!

Change 904854 abandoned by BCornwall:

[operations/puppet@production] lists: Disable access on port 80

Reason:

The service still uses :80 for various tasks

https://gerrit.wikimedia.org/r/904854