-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Json audit logging #914
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
Json audit logging #914
Conversation
* Write Stopwatch2 values into a separate map * Remove legacy Stopwatch * Proper sanitization of request/response headers * Lazily open maps for keys that may not have content
Remove compile-time setting for generating audit logs as JSON, creating a new config option (SecAuditLogFormat). sec_audit_logger is now a wrapper for sec_audit_logger_json or sec_audit_logger_native. This has the disadvantage of making the audit log generation code harder to maintain, but the logger function itself now is no longer pepper with binary branches.
Refactored this to make it a configurable option (instead of set at compile time) |
Create a separate map for each matched rule chain, making it easier to identify chains in which only a portion of rules actually matched.
* Escape rule actionset metadata * Escape and truncate logdata * Lazily add actionset tags as an array * Add negated rule op_param * Add unparsed rule representation
Any updates or notes on whether this is an acceptable patch? If there are stylistic concerns or missing functionality I will be happy to review them. Thanks. |
Hi @p0pr0ck5, thanks for the patch! I did not reviewed it yet, working on libmodsecurity - Is this patch following the format discussed at #897 ? |
@zimmerle, the JSON structure is somewhat different, in that the 'messages' key does not contain detailed info about the matched rules; instead The reason the patch is so large at this point is because we duplicated |
Hi @zimmerle, any idea if this patch is likely to make it into mainline? I understand most development time is being put into libmodsecurity, just looking for an idea if this is maybe in the ballpark. |
Hi @p0pr0ck5, Sorry for the delay, the development of libmodsecurity is taking more time than what I was expecting. We need to have both versions 2.9 and libModSecurity with the exactly same format, does not make sense to have two different things. In order to do that, I was hoping to have into the discussion about the format the authors of AuditConsole [1] and WAF FLE [2]. I will start a discussion via email. Also, not sure if you are in our development mailing list, but we are going to have a community meeting to discuss the open issues, etc... tell me if you are interested to participate... [1] https://jwall.org/web/audit/console/index.jsp |
Thanks for the reply and the off-thread discussion; I've joined the development mailing list and look forward to further discussion on this. |
'is_chained' should be true for an actionset when the is_chained member of the struct is true, or when its rule has a valid chain_starter member.
Merged! :) Thanks @p0pr0ck5!!! |
is this going to be in version 3? |
@jurgenweber version 3 is JSON by default. |
I am not experiencing that at all. My Goal is to get this data into elasticsearch/kibana in a structured manner. Right now I am getting the logs per section, line by line. For further context, I am using this: https://hub.docker.com/r/elisiano/nginx-modsecurity/~/dockerfile/ |
Mod Security Log (JSON) Structure is not proper key:pair?Hi all I was happy about mod security support JSON log format but why log is in not proper key:pair structure? I am planing to pull that log into Elastic search and Kibana but i am stuck because log are not structure (key:pair}. so let me know is any solution to make that possible? i was reading the one blog in which he get the log in key pair combination.so check this blog. Let me know is there any solution for the problem.
|
Mod Security Log monitoring DashboardFinally Mod Security Log monitoring Dashboard is ready, I have integrated Mod security Audit Log with ELK(latest version) for real time analysis and it's working good. So i am now working on WAF rules development. i need some guidance from others regarding WAF rule development. So please give some ideas to move further ? |
@umarfarook882 please do not hijack unrelated issues for your own personal questions, it's impolite and confusing for other members of the community. Consider using the mailing list to ask your own questions. Thank you! :) |
Implement generation of audit logging data as JSON (available as a compile-time option).