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

Question regarding rotating logs of modsec #2470

Closed
albgen opened this issue Dec 7, 2020 · 2 comments
Closed

Question regarding rotating logs of modsec #2470

albgen opened this issue Dec 7, 2020 · 2 comments
Assignees
Labels
3.x Related to ModSecurity version 3.x

Comments

@albgen
Copy link

albgen commented Dec 7, 2020

Hello dears,

i'm running modsec on latest nginx on centos7. The problem is that i cannot rotate the logs with logrotate.

My logrotate config file for modsec is the following:

/var/log/modsec_audit.log {
daily
rotate 7
missingok
compress
postrotate
[ ! -f /var/run/nginx.pid ] || kill -USR1 cat /var/run/nginx.pid
endscript
}

@zimmerle
Copy link
Contributor

zimmerle commented Dec 7, 2020

Hi @albgen,

libModSecurity is not implementing the support for kill -USR1. Try nginx reload instead.

To follow the development of this feature, keep an eye on this issue: #2304

@zimmerle zimmerle closed this as completed Dec 7, 2020
@zimmerle zimmerle self-assigned this Dec 7, 2020
@zimmerle zimmerle added the 3.x Related to ModSecurity version 3.x label Dec 7, 2020
@albgen
Copy link
Author

albgen commented Dec 8, 2020

i tried with the following config

/var/log/modsec_audit.log {
daily
rotate 7
missingok
compress
postrotate
/usr/sbin/nginx -s reload
endscript
}

but the result was the following which means the new log for the day is 0:

image

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

No branches or pull requests

2 participants