Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extra whitespace in some configuration directives causing error #2006

Closed
porjo opened this issue Jan 20, 2019 · 2 comments
Closed

Extra whitespace in some configuration directives causing error #2006

porjo opened this issue Jan 20, 2019 · 2 comments
Assignees
Labels
3.x Related to ModSecurity version 3.x

Comments

@porjo
Copy link

porjo commented Jan 20, 2019

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)

@zimmerle
Copy link
Contributor

Hi @porjo,

Thanks for the report. Fixed at: dc78c0e

@porjo
Copy link
Author

porjo commented Jan 21, 2019

Thanks for the quick fix! 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.x Related to ModSecurity version 3.x
Projects
None yet
Development

No branches or pull requests

2 participants