-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Spurious unformatted 'Apache-Error' audit log lines in 2.9.1RC1 #1073
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
Comments
I think this has been around before. Here is a dump of my audit log for ModSec 2.7.5 on Apache 2.4.18:
So if this is a bug, then it is an old one. Or one introduced by a fairly recent apache version. |
I'm seeing lots of these: Apache-Error: [file "apache2_util.c"] [line 271] [level 3] [client %s] ModSecurity: %s%s [uri "%s"]%s In addition to this, I see many: Prior to the Apache-Error above. There seems to be a 1:1 mapping, and have started since running 2.9.1 (unfortunately I was running 2.7.3 prior to that, so can't comment exactly what build introduced this behavior. |
@bridavis, I think the messages populated with %s etc. date back at least to 2.7.5, but nobody noticed. It may also depend on the apache version. We see that scalar value message for the first time. Could you elaborate a bit. Ideally minimal config and request to provoke the message. That would help to reproduce and isolate. |
@dune73 : I will send you a copy of the log offline. Attaching log here in case anyone has seen this before. This doesn't seem to be an impacting issue, other than filling up the logs, but I'd like to confirm. |
seeing the same here: FreeBSD 9.3-RELEASE-p39 / Apache24 / modsec 2.9.1 |
the reason is that the error log format is used instead of the formatted error log message I have created a pull request for this problem: #1216 |
-> comments with the PR. |
Hi @arminabf, that is correct! thanks for remind me. |
Hello everyone, I have deployed a waf on cloud (azure) app gateway waf, I have a false positive ( CANNOT ADD SCALAR VALUE WITHOUT AN ASSOCIETED KEY) I don't know why waf detect a request as a bad traffic, [ "teacher" ] |
Hello @mrahmatellah, is your FP related to this issue in any way? |
Hi @mrahmatellah, The error message you mentioned "Cannot add scalar value without an associated key" usually happens when the JSON parser can't associate a key to a given JSON value as the code normally expects a key/value format (e.g. [profession: "teacher"]) data for JSON and your request only contains the value ([ "teacher" ]). #1576 might be related so maybe you could retry with the current proposed solution for v2 at #1577. Still, as far as I can remember this error message shouldn't be causing a false positive... Unless maybe if this issue is causing the request body parser to fail and triggering rule 200002... If the problem persists, please open a new issue for proper tracking and provide ModSecurity logs because as @dune73 have mentioned we can't see an explicit link to your problem with this issue. |
thank you very much for this answer, i will open a ne issue (tomorrow i shall see that with our developpers team, if they can't resolve that, i shall open a new issue. Thank you for your answer again !! |
With ModSecurity 2.9.1RC1 on FreeBSD, for every ModSecurity log line in the audit log, another line
Apache-Error: [file "apache2_util.c"] [line 271] [level 3] [client %s] ModSecurity: %s%s [uri "%s"]%s
line is logged. (So if there are three ModSecurity events, there are threeApache-Error
lines)This looks weird and increases the site of the audit logs.
Reproduce:
Apache-Error
line for every ModSecurity log entry inH
sectionExample:
The text was updated successfully, but these errors were encountered: