-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Add custom leading text to audit log lines #3432
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
base: v3/master
Are you sure you want to change the base?
Add custom leading text to audit log lines #3432
Conversation
Hi @szedenik-adam, first of all, many thanks for this PR. I have only two notes:
Let me know if you need any help, and thank you again. |
Hi @airween, thank you for your feedback.
Sure, I can replace the initializer list with in-class initializers. I used the initializer list approach there because I didn't want to break the existing code's "pattern" (and I also prefer that approach because with that, the constructor contains the member variable initializations).
Yes, of course. There I used
Yes, I planned to do that, I just wanted to wait until I get approval of this PR to avoid doing unnecessary work. |
Excellent, thank you! |
wiki patch: modsec_wiki_auditlog_header.patch |
Hi @szedenik-adam, thanks for modifications - unfortunately there are two new issues in SonarCloud. Could you take a look at them? |
yes, I will adapt the code according to those hints |
|
Thanks - could you add some real life example? I mean how will look like a line if the admin sets this directive. Also if it's possible, put examples in case of |
Added example and limitation that the parameter is only used when |
what
This PR introduces a new property:
SecAuditLogHeader
, that allows audit logs to have a customizable text that is prepended to each line.Acts as a basic version of Apache HTTP Server's LogFormat.
why
In Kubernetes, the pods' log is taken from stdout and to use applications that directly log to stdout, we need to differentiate each log source (in this case, ModSecurity's audit log and the application's own log).
references
https://kubernetes.io/docs/concepts/cluster-administration/logging/