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

[nginx] filedescriptor leak with audit_log rotation #838

Closed
prune998 opened this issue Feb 13, 2015 · 2 comments
Closed

[nginx] filedescriptor leak with audit_log rotation #838

prune998 opened this issue Feb 13, 2015 · 2 comments
Assignees

Comments

@prune998
Copy link

Nginx support log-file rotation using the USR1 signal (kill -USR1 ).

first BUG :
This is not honored by mod_security and its audit log.

Using the HUP signal seems to partialy work.

second BUG :
After rotating (mv audit.log audit.log.old) the audit log file and doing a HUP kill on the process, I still see opened file for the old files :

lsof -p 694241 | grep audit| grep itcro
nginx   694241 root    7w   REG              252,0   128158   395227 /opt/data/nginx/logs/front.itcrowd.uat.xx.yy.audit.log.1
nginx   694241 root    8w   REG              252,0   128158   395227 /opt/data/nginx/logs/front.itcrowd.uat.xx.yy.audit.log.1
nginx   694241 root   11w   REG              252,0        0   408570 /opt/data/nginx/logs/front.itcrowd.uat.xx.yy.audit.log.3
nginx   694241 root   12w   REG              252,0        0   408570 /opt/data/nginx/logs/front.itcrowd.uat.xx.yy.audit.log.3
nginx   694241 root   32w   REG              252,0   128158   395227 /opt/data/nginx/logs/front.itcrowd.uat.xx.yy.audit.log.1
nginx   694241 root   33w   REG              252,0   128158   395227 /opt/data/nginx/logs/front.itcrowd.uat.xx.yy.audit.log.1
nginx   694241 root   36w   REG              252,0        0   408571 /opt/data/nginx/logs/front.itcrowd.uat.xx.yy.audit.log.4
nginx   694241 root   38w   REG              252,0        0   408571 /opt/data/nginx/logs/front.itcrowd.uat.xx.yy.audit.log.4
nginx   694241 root   41w   REG              252,0   128158   395227 /opt/data/nginx/logs/front.itcrowd.uat.xx.yy.audit.log.1
nginx   694241 root   42w   REG              252,0   128158   395227 /opt/data/nginx/logs/front.itcrowd.uat.xx.yy.audit.log.1
nginx   694241 root   47w   REG              252,0        0   408576 /opt/data/nginx/logs/front.itcrowd.uat.xx.yy.audit.log.6
nginx   694241 root   48w   REG              252,0        0   408576 /opt/data/nginx/logs/front.itcrowd.uat.xx.yy.audit.log.6
nginx   694241 root   51w   REG              252,0    10095   408297 /opt/data/nginx/logs/front.itcrowd.uat.xx.yy.audit.log.test
nginx   694241 root   52w   REG              252,0    10095   408297 /opt/data/nginx/logs/front.itcrowd.uat.xx.yy.audit.log.test
nginx   694241 root   56w   REG              252,0        0   408567 /opt/data/nginx/logs/front.itcrowd.uat.xx.yy.audit.log.2
nginx   694241 root   57w   REG              252,0        0   408567 /opt/data/nginx/logs/front.itcrowd.uat.xx.yy.audit.log.2
nginx   694241 root   61w   REG              252,0        0   408574 /opt/data/nginx/logs/front.itcrowd.uat.xx.yy.audit.log.5
nginx   694241 root   62w   REG              252,0        0   408574 /opt/data/nginx/logs/front.itcrowd.uat.xx.yy.audit.log.5
nginx   694241 root   66w   REG              252,0        0   408578 /opt/data/nginx/logs/front.itcrowd.uat.xx.yy.audit.log.7
nginx   694241 root   67w   REG              252,0        0   408578 /opt/data/nginx/logs/front.itcrowd.uat.xx.yy.audit.log.7
nginx   694241 root   71w   REG              252,0        0   408581 /opt/data/nginx/logs/front.itcrowd.uat.xx.yy.audit.log.8
nginx   694241 root   72w   REG              252,0        0   408581 /opt/data/nginx/logs/front.itcrowd.uat.xx.yy.audit.log.8
nginx   694241 root   76w   REG              252,0        0   408583 /opt/data/nginx/logs/front.itcrowd.uat.xx.yy.audit.log
nginx   694241 root   77w   REG              252,0        0   408583 /opt/data/nginx/logs/front.itcrowd.uat.xx.yy.audit.log
nginx   694241 root   81w   REG              252,0        0   408583 /opt/data/nginx/logs/front.itcrowd.uat.xx.yy.audit.log
nginx   694241 root   82w   REG              252,0        0   408583 /opt/data/nginx/logs/front.itcrowd.uat.xx.yy.audit.log

This will lead to filedescriptor ressource exhaust...

@ikrauchanka
Copy link

@zimmerle
Copy link
Contributor

zimmerle commented May 6, 2017

Won't fix in 2.x and fixed in libmodsecurity

Further information available here - https://github.com/SpiderLabs/ModSecurity-nginx

@zimmerle zimmerle closed this as completed May 6, 2017
@zimmerle zimmerle self-assigned this May 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants