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

Is it possible to change the SecAuditLogStorageDir variable so that the logs are sorted by vhost? #3118

Open
vukitoso opened this issue Mar 31, 2024 · 0 comments
Assignees
Labels
2.x Related to ModSecurity version 2.x

Comments

@vukitoso
Copy link

vukitoso commented Mar 31, 2024

Hello.

I have libapache2-mod-security2 2.9.7-1 installed on debian 12.
In the configuration file /etc/modsecurity/modsecurity.conf
Default SecAuditLogStorageDir = /opt/modsecurity/var/audit
and all logs are written together, regardless of vhost.
Is it possible to sort by vhost?

/opt/modsecurity/var/audit/site1.com/
/opt/modsecurity/var/audit/site2.com/

...

Then, as an option to expand the functionality, you can add variables:

$vhost
$year
$month
$day
$hour
$minute
$second
$id - some kind of unique identifier that is added to the end of the log name

so that you can create different options for log storage paths:

/opt/modsecurity/var/audit/$vhost/$year-$month-$day/$hour-$minute-$second-$ID.log
/opt/modsecurity/var/audit/site.com/2024-03-31/11-51-03-ZgkZYEAFt1ApFkqHlmHjUgAAAAE.log

or

/opt/modsecurity/var/audit/$vhost/$year-$month/$day/$hour-$minute-$second-$ID.log
/opt/modsecurity/var/audit/site.com/2024-03/31/11-51-03-ZgkZYEAFt1ApFkqHlmHjUgAAAAE.log

Thx.

@vukitoso vukitoso added the 2.x Related to ModSecurity version 2.x label Mar 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.x Related to ModSecurity version 2.x
Projects
None yet
Development

No branches or pull requests

2 participants