Skip to content

Extra whitespace in some configuration directives causing error #2006

Closed
@porjo

Description

@porjo

Describe the bug

Putting more than one space or tab between some configuration directives and their value causes an error.

For example:

SecAuditLog /usr/local/apache24/logs/modsec_audit.log

If I put 2 or more spaces between SecAuditLog and /usr/local... (or any number of tabs) I get this error:

nginx: [emerg] "modsecurity_rules_file" directive Rules error. File: /usr/local/apache24/conf/modsecurity_rules.conf. Line: 34. Column: 55. Invalid input:  SecAuditLog  /usr/local/apache24/logs/modsec_audit.log in /usr/local/nginx-1.10.1/conf/nginx.conf:48

Other configuration directives don't have this problem. For example I can put many spaces between SecAuditLogFormat and JSON

Expected behavior

Extra whitespace (within reason) should be permitted between directive and value as this can assist to make the configuration file easier to read. Also, behaviour should be consistent for all directives.

Server (please complete the following information):

  • ModSecurity version (and connector): ModSecurity v3.0.3 with nginx-connector v1.0.0
  • WebServer: nginx-1.10.1
  • OS (and distro): Linux, centos7

Rule Set (please complete the following information):

  • Running any public or commercial rule set? SpiderLabs commercial rules
  • What is the version number? 2018-08-11

Additional context

I've also tested with Apache connector (cloned from tip 2019-01-17)

Metadata

Metadata

Assignees

Labels

3.xRelated to ModSecurity version 3.x

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions