News for hackers. Stuff that matters.
Re:Optionsbleed – HTTP OPTIONS method can leak Apache's serv... by kodfodrasz on Monday September 18, 2017 @11:06AM (#15276549)
Is anybody still using Apache?

I'm really iterested on the whys (in addition to the obvious legacy reasons).

Re:Optionsbleed – HTTP OPTIONS method can leak Apache's serv... by oxguy3 on Monday September 18, 2017 @12:09PM (#15277095)
It's still a really nice web server. Easy to configure, incredibly reliable, twenty years of security fixes under its belt, endless docs/info available for it online. I've been meaning to learn nginx for a while, but with Apache working just fine, it doesn't feel very urgent.

Besides Apache and nginx, there aren't really any servers I'd trust for production use. Conceptually, I really like what Caddy is doing, but it's simply too young, not to mention the concerns that came up when Let's Encrypt had an outage back in May: https://github.com/mholt/caddy/issues/1680

Re:Optionsbleed – HTTP OPTIONS method can leak Apache's serv... by mholt on Monday September 18, 2017 @12:15PM (#15277153)
The concerns about Caddy handling an ACME server outage are not really well founded these days, because:

1) Caddy has the most robust OCSP implementation of any web server. It caches staples locally and refreshes them halfway through the validity period so it can endure days-long OCSP responder outages.

2) Even if a certificate needs to be renewed while the ACME server is down, Caddy can endure 2-to-3-week-long outages of the ACME server because it renews 30 days out from expiration and tries twice per day until it succeeds, logging its actions along the way.

And because Caddy is written in Go, memory leaks like what Apache suffers are much less likely, if not impossible.

(Source: I implemented it.)

Re:Optionsbleed – HTTP OPTIONS method can leak Apache's serv... by stephenr on Monday September 18, 2017 @01:30PM (#15277791)
> 1)...

Two calls to OpenSSL and a few lines of shell script will fetch staples from LE whenever I want (ie more often than your defaults that have caused problems before) for HAProxy to serve. How's that for robust.

>2)...

great so you're as reliable as.. any other LE client that tries to renew before expiry, but without the ability to choose when to renew certs?

Re:Optionsbleed – HTTP OPTIONS method can leak Apache's serv... by mholt on Monday September 18, 2017 @03:41PM (#15278862)
1) Caddy has never had OCSP outage problems. When LE's OCSP responders went down for a day a few months ago, Caddy was the ONLY server that kept sites online (unless nginx was explicitly configured for it; almost all Apache sites with it went down, including gnu.org).

2) Ours is the only LE client built directly into the web server, so "reliability" isn't really a comparable factor. By doing renewals automatically, Caddy's HTTPS implementation is more reliable and robust than doing it manually.

Re:Optionsbleed – HTTP OPTIONS method can leak Apache's serv... by stephenr on Monday September 18, 2017 @10:50PM (#15281421)
> 1)

Ok fine, you want to pretend HAProxy isn't a thing that exists, we can do that.

> 2)

That isn't necessarily a good thing. Have you ever heard of separation of concerns?

You specifically mentioned how Caddy can manage 2-3 week outages, as if it's something unique to your software.

Every LE client that can be run from cron/a systemd timer renews certificates autagically.

So where's the manual part that you keep claiming is not "robust"?

Re:Optionsbleed – HTTP OPTIONS method can leak Apache's serv... by pfg on Tuesday September 19, 2017 @06:39AM (#15283326)
As someone who occasionally helps people with their web server/TLS/Let's Encrypt configuration, my experience is that there is a world of difference between a web server merely giving you the tools you'd need for a (relatively) sane OCSP and auto-renewal configuration, and one that takes care of everything. You should not need the amount of specialized knowledge you currently need to correctly configure OCSP on HAProxy or nginx, for example.

Failure to renew a certificate (for any number of reasons) and missing intermediate certificates are the most common issues, and both of these are essentially solved with a web server that supports ACME natively. The same applies to OCSP stapling - we're not going to achieve ubiquitous stapling support on the server side if every server admin needs to deploy a bash script calling to openssl because the native OCSP implementation in their web server is broken.

Re:Optionsbleed – HTTP OPTIONS method can leak Apache's serv... by stephenr on Tuesday September 19, 2017 @09:27AM (#15284366)
There is literally zero configuration required for HAProxy. You just store .ocsp files alongside the .pem's

Yes you need to fetch them regularly. I use the aforementioned shell script to do this.

Why do you people keep up this weird narrative that only caddy renews certificates automatically?

The native ocsp handling in HAProxy isn't broken: it just expects to have TLS material provided to it.

If someone setting up HAProxy on a server can't install a shell script calling two OpenSSL commands and setup cron to call it regularly, I don't think your big problem is "HAProxy doesn't handle ocsp". It's PEBKAC.

Re:Optionsbleed – HTTP OPTIONS method can leak Apache's serv... by pfg on Tuesday September 19, 2017 @09:55AM (#15284592)
> There is literally zero configuration required for HAProxy. You just store .ocsp files alongside the .pem's

> Yes you need to fetch them regularly. I use the aforementioned shell script to do this.

It does sound like there's some configuration involved after all, namely the configuration of a cronjob, and perhaps adjustments to a bash script. This is something that the majority of server operators will not bother with, though these numbers might look slightly better for HAProxy since that's generally something you see used by more experienced sysadmins. Even with nginx, we're talking about one line of configuration for the actual stapling file - that's not the blocker, it should just work, by default. Fun fact: IIS does this.

> Why do you people keep up this weird narrative that only caddy renews certificates automatically?

I'm not sure who "you people" are, and I never made any such claim. What I'm saying is that web servers that support ACME natively leave a lot less room for the types of misconfigurations that I commonly see. I'm aware of an ACME module for apache and lua scripts for nginx which provide similar features (regarding renewal and certificates, not for the OCSP aspect), but they're not part of what you run by default when you use those web servers.

> The native ocsp handling in HAProxy isn't broken: it just expects to have TLS material provided to it.

I have yet to see you explain why this should be necessary. The web server has all the information it needs to do this. Other web servers can do this.

> If someone setting up HAProxy on a server can't install a shell script calling two OpenSSL commands and setup cron to call it regularly, I don't think your big problem is "HAProxy doesn't handle ocsp". It's PEBKAC.

This is like arguing MongoDB should continue to bind to all interfaces by default because everyone should have firewalls in place. Yes, they should, but it's never going to happen, so why can't we just have a safe default?

Re:Optionsbleed – HTTP OPTIONS method can leak Apache's serv... by stephenr on Tuesday September 19, 2017 @11:49AM (#15285695)
> It does sound like there's some configuration involved after all

How is "schedule a script to run @daily" or whatever schedule you want, at all match up to what you suggested is required:

>> You should not need the amount of specialized knowledge you currently need to correctly configure OCSP on HAProxy or nginx, for example.

If you're configuring a public facing server, a cronjob should not be considered "specialised knowledge".

> it should just work, by default

HAProxy and nginx do a fucking shit ton more than Caddy does. HAProxy doesn't really have a "default" you have to tell it what you want to do, specifically. This is a good thing.

> I'm not sure who "you people" are, and I never made any such claim.

>> By doing renewals automatically, Caddy's HTTPS implementation is more reliable and robust than doing it manually.

>> Failure to renew a certificate (for any number of reasons) and missing intermediate certificates are the most common issues,

You're both giving the impression that Caddy is able to automatically renew certificates, while no other software does this.

> I have yet to see you explain why this should be necessary.

Off the top of my head:

- Separation of concerns. I don't ask my mechanic to build me a car, or to drive me to the shops in it.

- Not every organisation uses LetsEncrypt certificates. Some will even use self-signed certificates.

- TCP or DNS load-balanced environments will want the exact same certificate & key on multiple servers.

- Caddy has already shown that trusting some "automagic" solution can bite you in the ass. Remember that time Caddy wouldn't even start, even though it had perfectly valid certificate material in it's cache, because LE was down?

> The web server has all the information it needs to do this.

HAProxy doesn't know the email address I'd want LetsEncrypt to use for notifications. It also shouldn't be agreeing to LE's terms on my behalf.

> This is like arguing MongoDB should continue to bind to all interfaces by default because everyone should have firewalls in place.

No, it isn't.

I'm sorry but you simply don't get the choice of arguing anything about how creating a fucking cronjob is "too hard" when Caddy doesn't even ship with a configuration to start as a service.

"I know I just had to google the shit out of how to create a systemd unit, but fuck it, it's better than writing a damned cron job for oscp staples!"

Re:Optionsbleed – HTTP OPTIONS method can leak Apache's serv... by pfg on Tuesday September 19, 2017 @12:26PM (#15286059)
> If you're configuring a public facing server, a cronjob should not be considered "specialised knowledge".

Knowing how HAProxy's OCSP implementation works (i.e., by looking for a $cert.ocsp file) is the specialized knowledge. Odds are, you don't know about it and just won't use OCSP stapling. This is especially true since every web server does this differently.

> HAProxy and nginx do a fucking shit ton more than Caddy does. HAProxy doesn't really have a "default" you have to tell it what you want to do, specifically. This is a good thing.

I'm not arguing that it doesn't do a lot of things Caddy doesn't. I'm arguing for sane defaults. If I tell HAProxy to enable TLS and provide a certificate that contains an OCSP AIA extension, a sane default would be to use that information to manage OCSP stapling.

> You're both giving the impression that Caddy is able to automatically renew certificates, while no other software does this.

You're leaving out the part where I say these issues "[...] are essentially solved with a web server that supports ACME natively". I'm not referring to Caddy specifically. The web server doing this natively is far less error-prone. I have also mentioned alternatives.

> - Separation of concerns. I don't ask my mechanic to build me a car, or to drive me to the shops in it.

Where do you draw the line? Most deployments let their web servers handle TLS. OCSP stapling should be part of a modern TLS deployment. You could similarly argue that using HAProxy for TLS is wrong (and that you should rather put pound or stunnel in front of it).

> - Not every organisation uses LetsEncrypt certificates. Some will even use self-signed certificates.

That's fine; you can continue to manually configure certificates, even with Caddy, and I'm definitely not arguing that this option should be removed. ACME is also an open standard, so switching to other CAs can be as simple as configuring a different ACME server url.

> - TCP or DNS load-balanced environments will want the exact same certificate & key on multiple servers.

That's why you can replace the certificate and key storage in more complex environments[1].

> - Caddy has already shown that trusting some "automagic" solution can bite you in the ass. Remember that time Caddy wouldn't even start, even though it had perfectly valid certificate material in it's cache, because LE was down?

Software can break, what a surprise. You could similarly have a broken OCSP updater script that puts empty or expired OCSP responses in your stapling file because the check is missing or incomplete and break the site for your visitors. Or your ACME client could fail on renewal because of a backend change on Let's Encrypt's end that exposes a bug in it[2].

> HAProxy doesn't know the email address I'd want LetsEncrypt to use for notifications. It also shouldn't be agreeing to LE's terms on my behalf.

You can ... provide your email address? You keep arguing that this stuff is easy, surely adding a single line with your email address won't break the camel's back. Accepting the TOS can be solved as part of the installation or configuration process, much like ACME clients do it.

Anyway, you seem to be having some kind of problem with Caddy. I'm not interested in that discussion (which is to say I'm not interested in discussing this further, I think I've made my point) - my goal is to improve the user experience of server admins when they enable HTTPS, and I have no doubt that native ACME support and automated OCSP management, both with sane defaults, would both help HTTPS adoption and improve the quality of the TLS configuration of your average web server.

[1]: https://godoc.org/github.com/mholt/caddy/caddytls#Storage

[2]: https://community.letsencrypt.org/t/acme-sh-standalone-fails...

Re:Optionsbleed – HTTP OPTIONS method can leak Apache's serv... by stephenr on Tuesday September 19, 2017 @01:18PM (#15286595)
My issue is with caddy.

FYI, the issue a few months back wasn't "software breaks".

It worked exactly as they designed and implemented it. The original issue was closed, before (as seems to be a pattern lately) they changed direction when they received so much negative feedback about their highly opinionated choices for the project.

To this day the same logic is still in caddy, but with a longer grace period. Try starting caddy offline with a cert that expires in less than 7 days.

I don't trust someone to develop a server if they think failing to start at all, is better than starting with close to expired or even expired certificates.

Re:Optionsbleed – HTTP OPTIONS method can leak Apache's serv... by jimjag on Tuesday September 19, 2017 @10:57AM (#15285193)
It's called the Ostrich Solution. You stick your head in the sand to ignore alternatives to buttress the argument that your solution is the sole solution to a problem. You then hope that no one does even the most rudimentary investigation, which is, unfortunately, getting more and more prevalent nowadays.
Re:Optionsbleed – HTTP OPTIONS method can leak Apache's serv... by jimjag on Tuesday September 19, 2017 @10:54AM (#15285161)
re: "only LE client".

https://github.com/icing/mod_md

this is being folded into the official Apache httpd repo.

Re:Optionsbleed – HTTP OPTIONS method can leak Apache's serv... by runako on Monday September 18, 2017 @11:14AM (#15276623)
According to Netcraft, 21% of the sites on the public Internet run Apache:

https://news.netcraft.com/archives/2017/07/20/july-2017-web-...

There are lots of legit reasons to run Apache:

- it works like a champ

- it's widely known

- it's got a big ecosystem (plugins, etc.)

- it has a fairly complete WebDAV implementation

- it's widely supported

TL;DR "legacy" sometimes means "good" and not just "old."

Re:Optionsbleed – HTTP OPTIONS method can leak Apache's serv... by pmlnr on Monday September 18, 2017 @11:16AM (#15276642)
Yeah, right. It's also still prone to slowloris and you can take down a shared hosting server with a laptop in a coffee store.

In this case legacy is either "I don't know anything else", "well it worked so far" or "meh".

Re:Optionsbleed – HTTP OPTIONS method can leak Apache's serv... by hannob on Monday September 18, 2017 @11:32AM (#15276781)
Apache has mod_reqtimeout which mitigates the slowloris-attack. It's been a while, but in my tests that worked pretty well.
Re:Optionsbleed – HTTP OPTIONS method can leak Apache's serv... by xorcist on Monday September 18, 2017 @01:13PM (#15277660)
This is your second comment that mentions slowloris. You know slowloris isn't specific to Apache, right?
Re:Optionsbleed – HTTP OPTIONS method can leak Apache's serv... by pmlnr on Monday September 18, 2017 @05:59PM (#15280045)
I know.
Re:Optionsbleed – HTTP OPTIONS method can leak Apache's serv... by jimjag on Monday September 18, 2017 @12:43PM (#15277380)
Lots of reasons. First of all, it is fast and reliable. The choice of MPMs allow for sys-admins to choose exactly how they want httpd to scale. Unparalleled RFC compliance. Load balancing with dynamic, runtime configuration. Failover. .htaccess file. Full support for FPM/FastCGI. Fully Open Source and community driven (not Open Core). mod_rewrite capability. Hundreds of modules for almost every and all situation. Most people simply take the "lazy" route and not even investigate httpd, instead relying on the FUD about much older versions (you still get, for example, the screed that "Apache forks off a new process for each request")... Apache httpd 2.4 is just as fast and reliable as any other web-server out there, nginx included. It's just not seen as the "cool and hip" web-server. I guess some people are more concerned about marketing.
Re:Optionsbleed – HTTP OPTIONS method can leak Apache's serv... by tyingq on Monday September 18, 2017 @11:11AM (#15276588)
One driver is popular software that depends on the .htaccess construct.

WordPress, for example. It can run on other servers, but their own docs call out the issue..."Since Nginx does not have .htaccess-type capability and WordPress cannot automatically modify the server configuration for you, it cannot generate the rewrite rules for you"

Re:Optionsbleed – HTTP OPTIONS method can leak Apache's serv... by pmlnr on Monday September 18, 2017 @11:17AM (#15276654)
... and this is why WP has it's own rewrite engine, which works perfectly with nginx.
Re:Optionsbleed – HTTP OPTIONS method can leak Apache's serv... by tyingq on Monday September 18, 2017 @11:25AM (#15276717)
The quoted text is from their docs, and does not read that way. Some more:

"With Nginx there is no directory-level configuration file like Apache's .htaccess or IIS's web.config files. All configuration has to be done at the server level by an administrator, and WordPress cannot modify the configuration, like it can with Apache or IIS"

Re:Optionsbleed – HTTP OPTIONS method can leak Apache's serv... by pmlnr on Monday September 18, 2017 @11:55AM (#15276971)
https://codex.wordpress.org/Rewrite_API

What you are saying is, on it's own, true. It's also a solved problem for WP.

Re:Optionsbleed – HTTP OPTIONS method can leak Apache's serv... by solnyshok on Monday September 18, 2017 @12:43PM (#15277381)
does it work with all plugins too?
Re:Optionsbleed – HTTP OPTIONS method can leak Apache's serv... by pmlnr on Monday September 18, 2017 @05:58PM (#15280035)
It runs before the plugin hook, so yes, as far as I was able to test it a while ago, it does.
Re:Optionsbleed – HTTP OPTIONS method can leak Apache's serv... by hannob on Monday September 18, 2017 @11:25AM (#15276720)
Apache is the standard solution in web hosting.

Its "killer feature" are htaccess files. It provides a possibility to give users a limited way to configure their virtual hosts, without giving them too much power. (Unfortunately there are some unfixed systemic security issues with that, namely symlink attacks...)

Re:Optionsbleed – HTTP OPTIONS method can leak Apache's serv... by sk5t on Monday September 18, 2017 @02:10PM (#15278120)
I'd imagine one could crush the server with pathological rewrite regexps too.
Re:Optionsbleed – HTTP OPTIONS method can leak Apache's serv... by hannob on Monday September 18, 2017 @02:41PM (#15278375)
You can, and it's very unfortunate that the apache devs don't consider these things vulnerabilities. (I reported a DoS via password hashes a while ago.)
Re:Optionsbleed – HTTP OPTIONS method can leak Apache's serv... by tannhaeuser on Monday September 18, 2017 @01:21PM (#15277722)
Are you kidding? Apache is by far the most used web server for dynamic content-driven sites. It's "killer" feature is its robustness, in particular for (shared or otherwise) CGI hosting (and PHP hosting, of course). Outside the web app bubble, CGIs eg. per-request process spawning isn't a performance problem at all when you're using caching, which Apache httpd conveniently provides with mod_cache; mod_cache, unlike eg. Varnish and other dedicated caching solutions, has full RFC7324 caching with re-validation, not just "Expires:".

Apache httpd in many ways is a much more complete web server solution compared to, say, nginx (which I like as well). I'm prefering Apache httpd for the depth of available documentation alone, because everything is developed openly, C source is accessible and not hard to develop with, and because of the breadth of available options (certbot/letsencrypt/acme reference implementation on Apache, WebDAV, clustering etc. etc.).

Re:Optionsbleed – HTTP OPTIONS method can leak Apache's serv... by drzaiusapelord on Monday September 18, 2017 @11:24AM (#15276705)
Almost every DO, vultr, Linode, etc guide I've seen for LAMP server config uses Apache. I also suspect apache, being the old guard, is the defacto standard in various appliances, routers, firewalls, IoT, etc devices. Its our generation's BIND. Its probably never going away, even if better competitors come and go.

As far as stats go, according to netcraft MS's IIS is leading with Apache second and nginx a distant third. Of course, this data isn't terribly reliable as netcraft can only see front ends, which may hide whats behind the load balancer, but IIS/Apache are still kings.

Re:Optionsbleed – HTTP OPTIONS method can leak Apache's serv... by Jdam on Monday September 18, 2017 @01:05PM (#15277598)
So it's surprising, what the A in LAMP stands for?!
Re:Optionsbleed – HTTP OPTIONS method can leak Apache's serv... by sidlls on Monday September 18, 2017 @11:33AM (#15276792)
There are plenty of docs on linode for nginx configurations.
Re:Optionsbleed – HTTP OPTIONS method can leak Apache's serv... by anaganisk on Monday September 18, 2017 @12:06PM (#15277066)
Plenty =/= best
Re:Optionsbleed – HTTP OPTIONS method can leak Apache's serv... by joosters on Monday September 18, 2017 @01:48PM (#15277951)
It's pretty robust these days and is battle-hardened by the many attacks on it. Plus it has support for just about everything under the sun - that is, if someone has written something that extends or relies upon a web server, there will almost certainly be apache support.

(And I'm writing this as a dev who worked on a competing web server which IM-biased-O was vastly better :)

Re:Optionsbleed – HTTP OPTIONS method can leak Apache's serv... by jlgaddis on Tuesday September 19, 2017 @03:55PM (#15288217)
I use Apache specifically on shared web servers in order to run each customer's web site under a separate uid/gid (for security purposes). I use it on other $work web servers just for consistency/ease of management (performance isn't an issue).

Mostly I use it because, after probably 20 years or so, I'm quite comfortable with and accustomed to it.

That said, I have started putting a few of my own web sites on nginx just to try it out a bit and get some familiarity with it.

Re:Optionsbleed – HTTP OPTIONS method can leak Apache's serv... by wolco on Monday September 18, 2017 @11:44AM (#15276889)
Speed is one of the reasons to stay on apache. Using nginx to serve static and using php_mod vs fpm-php will be faster as long as you disable directory level .htaccess
Re:Optionsbleed – HTTP OPTIONS method can leak Apache's serv... by pmlnr on Monday September 18, 2017 @11:56AM (#15276990)
If you're using php-fpm over unix socket, I doubt this is true, please show some stats.
Re:Optionsbleed – HTTP OPTIONS method can leak Apache's serv... by wolco on Monday September 18, 2017 @12:25PM (#15277236)
Re:Optionsbleed – HTTP OPTIONS method can leak Apache's serv... by jimjag on Monday September 18, 2017 @12:45PM (#15277401)
Re:Optionsbleed – HTTP OPTIONS method can leak Apache's serv... by Veratyr on Monday September 18, 2017 @12:50PM (#15277448)
Does this apply to anything other than PHP? Not saying it's not significant, just curious. Does mod_wsgi outperform uwsgi with uwsgi_pass for example?
Re:Optionsbleed – HTTP OPTIONS method can leak Apache's serv... by Thaxll on Monday September 18, 2017 @12:55PM (#15277507)
Nginx is faster than Apache, you're talking about PHP which is very different. php-fpm is not part of Nginx.
Re:Optionsbleed – HTTP OPTIONS method can leak Apache's serv... by xorcist on Monday September 18, 2017 @01:12PM (#15277651)
Nginx should be faster in theory, but it's kind of hard to show in practice as the actual http parsing is just so much faster than anything else. You have to really tune them for for benchmark scenarios to see any kind of difference.

What your vendor supports and what you are most comfortable with configuring should decide which one you run.

PHP, as you say, is something else entirely. It's so much slower than your http server so the latter doesn't matter at all.

Re:Optionsbleed – HTTP OPTIONS method can leak Apache's serv... by jimjag on Monday September 18, 2017 @02:41PM (#15278378)
Not all the time... Before, when nginx was event and Apache was prefork or worker, yeah. But with the Event MPM, performance is pretty much neck-and-neck.
Re:Optionsbleed – HTTP OPTIONS method can leak Apache's serv... by delias_ on Monday September 18, 2017 @11:16AM (#15276640)
Running apache in front of tomcat is still a very common pattern. Mostly due to connection handling and configuration around it.
Re:Optionsbleed – HTTP OPTIONS method can leak Apache's serv... by AndyMcConachie on Tuesday September 19, 2017 @10:18AM (#15284807)
I use Apache all the time. It's great software.

It's kept up to date and it works for everything I want it to work with. This idea that because it's old and not hip therefore it's use is questionable is kinda dumb. I was disappointed when OBSD wrote their own httpd that was initially filled with stupid bugs.

If it ain't broke don't fix it.

Re:Optionsbleed – HTTP OPTIONS method can leak Apache's serv... by Blackthorn on Monday September 18, 2017 @11:18AM (#15276668)
No other server implements complete support for server side includes.
Re:Optionsbleed – HTTP OPTIONS method can leak Apache's serv... by pmlnr on Monday September 18, 2017 @11:24AM (#15276707)
nginx with lua or perl module?
Re:Optionsbleed – HTTP OPTIONS method can leak Apache's serv... by Blackthorn on Monday September 18, 2017 @11:25AM (#15276719)
Please explain exactly how that provides complete support for the server side includes standard.
Re:Optionsbleed – HTTP OPTIONS method can leak Apache's serv... by liveoneggs on Monday September 18, 2017 @04:29PM (#15279232)
a popular CDN vendor has noted that SSL with apache was faster than nginx at very large scale (although was later replaced with something else).