mod_security breaks Drupal and other web applications in "interesting" and unpredictable ways (depending on the rule-set used). As more and more wannabe hosters install mod_security without any regard for proper configuration, we receive an increasing amount of support requests where mod_security is involved.

A particular bad case is where mod_security breaks Batch API and causes install to fail. We should warn users that running mod_security may interfere with Drupal installation and use.

I'm not really happy about the $_GET && $phase == 'install' and the request_uri concatenation, but the install system doesn't support warnings in any other way AFAICS.

This is strictly spoken a feature request, so I leave it to the branch maintainers whether this is important enough to include in 7.

Comments

heine’s picture

Status: Active » Needs review
StatusFileSize
new1.79 KB

And the patch.

flickerfly’s picture

sub

flickerfly’s picture

The Batch API issue #320532: Batch API not working when http policy of mod_security is enabled. was fixed by ModSecurity. I think they'll pay attention if we take the time to properly demonstrate the problem.

Being security nuts, I bet they are block first, ask questions later in mindset, but fortunately they are willing to hear our response.

heine’s picture

I don't want us to take the brunt to support this WAF. So, if they shoot first and don't ask, their users should bug them, not us.

flickerfly’s picture

As one of their users, I'm glad to bug them once I understand where the problem is.

Neither ModSecurity nor Drupal are always wrong. This sort of message implies that ModSecurity is a bad thing and while that can be debated, it is not clearly so. As this patch recognizes, ModSecurity isn't going away.

I rather suspect that an increase in the popularity of ModSecurity should be an encouragement for Drupal to work with it, not discourage its use. To discourage its use will simply give rise to suspicions of insecurity by the unfamiliar and casual user. While Drupal does much to handle the security of itself, security holes do arise. My own hoster has had trouble with other drupal admins who fail to patch their sites and as a result was initially concerned to have drupal running. ModSecurity provides him with a certain level of assurance that Drupal isn't stepping outside it's bounds. I believe he's more comfortable with Drupal now as I've shows its merits and the only ModSecurity problems have been false-positives, but part of the reason I use his services is because I know he's on top of security concerns more than I am, unlike the wannabe hosters this is targeted at.

In short, can't we just all get along and sing a chorus of "Chum-by-ya, my lord, chum-by-ya!" :-)

heine’s picture

If a user installs Drupal and "it doesn't work", Drupal will take the blame. Some of those cases will result in support requests here.

There are different versions of mod_security in the wild and they potentially all have different rulesets enabled. As an example, some paranoid hosts prevent their users from POSTING the words lynx, mother, table or wget.

(ssh, don't tell your host that mod_security is trivially bypassed).

I don't want to discourage its use, just do some expectation management. We can of course change the wording in the patch.

heine’s picture

Status: Needs review » Needs work

TODO (chx channeled via #drupal):

- ditch else
- include link to handbook on a guide for debugging (which rules, where to file bugs etc).

flickerfly’s picture

I like the idea of a handbook page and would be willing to assist with writing if needed.

heine’s picture

Status: Needs work » Needs review
StatusFileSize
new1.93 KB

Removed the else, added a link to the handbook (placeholder atm).

flickerfly’s picture

I started the handbook page at http://drupal.org/node/695902. Feel free to throw suggestions for improvement here and I'll work them in.

ghazlewood’s picture

Is it worth adding something to the handbook page to encourage those bitten by a mod_security rule which is directly affecting Drupal operation to report the rule as a problem upstream? I use a commercially supported version of mod_security which allows me to report false positives so I'm not sure if there's an official place to deal with this or if this kind of thing just ends up on the mod_sec users mailing list?

I've noticed that some of the JIT patches and frequently updated rule sets change on a daily basis, and sometimes a really stupid rules makes it way in (usually only for 24 hours). It's always better to get daft rules fixed upstream rather than encourage people to disable them or even turn off mod_sec.

gábor hojtsy’s picture

ff1’s picture

flickerfly’s picture

Status: Needs review » Closed (won't fix)

#522646 was fixed in ModSecurity CRS 2.0.8

Also, I think it's safe at this point to say it isn't making it into D7. I'm going to go ahead and close it. If you think it should be bumped to D8 instead, that's fine by me.

heine’s picture

Version: 7.x-dev » 8.x-dev
Status: Closed (won't fix) » Needs work
jhedstrom’s picture

Version: 8.0.x-dev » 8.1.x-dev
Issue summary: View changes
Status: Needs work » Postponed (maintainer needs more info)
Issue tags: +Needs issue summary update

Is this still an issue? Tagging for IS update.

heine’s picture

Status: Postponed (maintainer needs more info) » Closed (won't fix)