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

[Idea] Add variable support for SecAuditLog #3133

Open
Xakiadalisabad opened this issue Apr 25, 2024 · 2 comments
Open

[Idea] Add variable support for SecAuditLog #3133

Xakiadalisabad opened this issue Apr 25, 2024 · 2 comments

Comments

@Xakiadalisabad
Copy link

I would like to provide a log file separately for each user and their website. Is there a chance to do this using variables SecAuditLog?

@airween
Copy link
Member

airween commented Apr 26, 2024

Hi @Xakiadalisabad,

have you tried to put the directive into the vhost context where you want to have an own audit.log?

You didn't mention what version you use. If you use Apache, you can do:

<VirtualHost *:80>

    ...
    SecAuditLog /var/log/nginx/other-vhost-modsec_audit.log
    ...

</VirtualHost>

If you use libmodsecurity3 and Nginx, you can try:

server {
    ...
    modsecurity_rules '
        SecAuditLog /var/log/nginx/other-vhost-modsec_audit.log
    ';

}

@marcstern
Copy link
Contributor

If you use Apache, you can automate things with mod_macro, like
<Macro VHostName $name>
ServerName $name
SecAuditLog /var/log/httpd/audit_$name.log
[...]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants