Hi, maybe forgotten but i advise you to redirect requests from http://xtools.wmflabs.org:80 via HTTP-301 to https://xtools.wmflabs.org:443 because you have TLS-support trough a wildcard X.509.
Regards --Keks
Hi, maybe forgotten but i advise you to redirect requests from http://xtools.wmflabs.org:80 via HTTP-301 to https://xtools.wmflabs.org:443 because you have TLS-support trough a wildcard X.509.
Regards --Keks
Yeah i didn't wrote that but checked https://www.ssllabs.com/ssltest/analyze.html?d=xtools.wmflabs.org
Better first go sure, that TLS is used :)
--Keks
@Der_Keks Future reference, if you file a security issue only subscribers can see it. If you file one against XTools, please subscribe at least myself, MusikAnimal, or Samwilson.
Probably won’t see any progress until we move this task into “working” on our work board.
Okay, I did some investigation into this. According to the Symfony docs, it is possible to force https via Symfony. However, this requires configuring each individual route. Unless there's an option I'm missing. http://symfony.com/doc/current/security/force_https.html
As our servers are configured with Puppet, this is theoretically feasible. But a huge developer burden to configure each individual route and maintain that list. Therefore, I propose closing this task as "wontfix" as we are not required to implement HTTPS and because of the burden.
Man, I'm really tired. We have another option (and this might be the smartest), is just do an apache-side configuration. See https://wiki.apache.org/httpd/RedirectSSL for the simple way to do it.
Since we're already configuring things with Puppet, T170514: Set up XTools servers with Puppet might be the place to chase that down. @MaxSem since you did the initial puppet work (with gerrit 368101), could you make this a thing?
Yeah guys that i am thinking about since 2 Month but noone made this suggestion...
In Nginx i realized this on my own Nextcloud-Server without any CMS. I hate CMS *shaking*
http://xtools.wmflabs.org/ is using nginx too. So heavy to go into the configs and change it? Don't worry, you can test the config via shell: nginx -t
server { listen 80; server_name xtools.wmflabs.org; server_tokens off; location / { return 301 https://$host:443$request_uri; } }
It is a simple operation and it takes sooo long?
This is what's done in IA Upload:
if ( $request->headers->get( 'X-Forwarded-Proto' ) == 'http' ) { $uri = 'https://' . $request->getHost() . $request->headers->get( 'X-Original-URI' ); return new RedirectResponse( $uri ); }
Ok you get the host and the uri manually. The variable $host and $request_uri does this for you automatically, so "$request->getHost()" == "$host". You method has no HTTP Status Code to define. I defined 301, because Google and other SE will compensate this instead of 302 (downranking)
No, sorry, what I was getting at is that you have to examine the X-Forwarded-Proto header, rather than the port number, because all requests come in on port 80 from the proxy (because we can't see the original request, for privacy reasons).
(I think.)
@Der_Keks https://xtools.wmflabs.org is already available. We're going to continue investigating this, but as of right now you're welcome to use that link to browse securely.
Lowering priority as a workaround exists.
There is actually another option: https://www.owasp.org/index.php/HTTP_Strict_Transport_Security_Cheat_Sheet
This is what ACC uses.
The proper way to set headers in Symfony: https://symfony.com/doc/current/introduction/http_fundamentals.html - Hoping that we can set it based on subdomain.
I feel like this discussion is over-complicating this - it should be pretty trivial to implement I think. For example, my HTTPS redirector in Python is exactly 4 lines of code: https://github.com/legoktm/toolforge/blob/master/toolforge/__init__.py#L99
The solution outlined in T170989#3575779 seems fine.
Except for the obvious problem that we don't use nginx. We use Apache. Hense my further investigation into this.
I think I'm missing exactly what part of T170989#3575779 relies on nginx. The X-Forwarded-Proto proto header should be set by the proxy.
As this appears to be part of the puppet configuration, I am transfering this task over to @Samwilson as discussed on IRC.
Yes, this is a relatively low priority change. We're putting it into our puppet configuration when it is finally built, which is ongoing.
This should have nothing to do with puppet. The code snippet pasted in T170989#3575779 should probably cover it.
I'll confirm what @Legoktm said. Cloud dynamicproxy sets the header, regardless of the backend server, apache or nginx.
We've opted to force a header via apache config. That's the easiest way to handle it, as Symfony has some strange configuration settings for forcing HTTPS (and we don't want those necessarily set for other users of XTools). That's also why it has to be puppetized (we maintain virtual 3 servers right now, with possibly more in the future depending on need)
Do you have any documentation on this "Cloud dynamicproxy" and how to inject headers into it? If so I'd love to see it.
I'm unaware of the documentation, but the code is at https://github.com/wikimedia/puppet/blob/production/modules/dynamicproxy/templates/domainproxy.conf#L90
Done with https://wikitech.wikimedia.org/w/index.php?title=Tool:XTools&diff=1771815&oldid=1771705
We'll add it to the puppet config whenever we actually create a puppet config :)
Sorry for the long wait.