-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Auditlog is not output #2220
Comments
can you please post how this "partial" JSON looks like? |
THX For reply For example, this JSON is output but ruleid is not included.
|
Hi @nakacya , I'm not certain whether this is your issue, but there was a bug fix in October (d4dc3db ) that may be relevant. For that bug, the details that you note as missing were being omitted when the disruptive action was 'deny'. If you're using 3.0.3 either from a repo package or from the 3.0.3-tagged github commit (from Nov. 1, 2018), you might have your logging issue fixed if you move up to at least 6395fe0 |
THX forreply @martinhsv I checked, but it seems that the corresponding correction has been completed.
|
Oh? “xmlrpc.php?rsd=%00” should have been rejected by modsecurity ... curl doesn't require a favicon, so why don't it appear in the auditlog?
|
Hi @nakacya , One thing I noticed that is a little unusual is your setting
This means you are telling ModSecurity to write to the audit log for transactions for any status code. E.g. even if the HTTP Status Code is 200, that is considered 'Relevant' because of your setting, so log writing occurs. But the "messages" portion of the log would be empty because ModSecurity has not populated it with anything because there is no information to convey. A request for favicon.ico was likely sent by your browser (you can confirm this by using your browser's developer tools). The favicon.ico request did not trigger any ModSecurity detections. The return code for that particular transaction was 200, but the transaction was written to the audit log anyway -- again, with an empty "messages" portion because there was no detection information to include. |
THX Reply @martinhsv I'm trying to change this setting now, but the audit log shows a return code 200.
In the first place, /favicon.ico does not exist. |
THX Reply @martinhsv I'm sorry I made a mistake reading. When I checked with the developer tool, I got the following three requests. I think |
If requests for /content.min.ss and /favicon.ico return HTTP Status 200, then, based on those settings (SecAuditLogRelevantStatus "^[4-5]+"), there will be no audit log entry for those two requests. However, logging is also controlled other ways, including at the individual rule level. For example you could intentionally set a rule to include 'log,pass' amongst its actions. And other rules that are triggered, but are not intended to block may require a specific 'nolog' or 'noauditlog' action to prevent writing to the audit log. |
When you get the following URL
Yes, I understand this. The error log (log) is output as follows.
In crs-setup.conf, it is described as follows.
id: 949110 is set as follows.
In the case of setting above, it should be set that “id: 949110 is output to log and audit log”. However, I tried changing the settings in various ways, but the situation is as follows. |
I'm sorry but I cannot reproduce what you are seeing. With current v3/master and the rule and configuration details that you have supplied above, I get content in the audit log including the "messages" section that specifies the rule id as 949110. For that request (http://xxx.xxx.xxx.jp/xmlrpc.php?rsd=%00%22): To clarify, when you say 'nothing is output to the audit log' do you mean that literally that no output at all is appearing in the audit log? If so, that's quite different from what has been discussed so far. If there is some content going to the audit log, and it's just missing some details like the rule id ('949110'), is the messages section present but empty? ( E.g. "messages":[]}} )? Or is the messages section missing altogether? |
Hi @nakacya , Although I wasn't able to reproduce what you were reporting, investigation related to your report did show a problem with the combination 'nolog,auditlog' that would affect output in some cases. A fix for this may be available in v3/master soon-ish. But, in the meantime my suggestion to you would be to try changing your SecDefaultAction lines to be 'log,auditlog'. |
Hello @martinhsv, I'm sorry to reply late at the end of Japan. When will you fix it? |
Hi @nakacya , That fix for the 'nolog,auditlog' use case that I mentioned has been merged to v3/master. Again, since I was not able to reproduce what you were reporting I cannot give assurance that that will fix your problem. However, since you are using SecDefaultAction that includes 'nolog,auditlog', this newly-merged fix, might be of some help. |
Hi, @martinhsv Today I got a new repository and tested it. Basically, isn't the auditlog output for a deny rule?
I changed |
Hi @nakacya, Can you create a minimalist ruleset to test such functionality? |
Hi @zimmerle How simple rules are suitable?
Ummmmmmm……. |
I repeated the test. When When
config
|
@nakacya see if victorhora/ModSecurity-nginx@ac3e8a9 solves your issue. |
Thank you for information! I ran recompule.
We confirmed that auditlog was output without any problem. |
Blocked when executing the above (normally so far)
・ It is recorded in error log.
・Not output to Auditlog.
Logs and dumps
Output of:
https://gist.github.com/nakacya/9614561b559cb04ac5d4edc35449621c
no log
None
Expected behavior
A clear and concise description of what you expected to happen.
Server (please complete the following information):
Rule Set (please complete the following information):
Not all Auditlogs are out.
return code 200 is output normally
400 series return code is also output in json, but the message part such as ruleid is missing
The text was updated successfully, but these errors were encountered: