In my modsecurity auditlog there is a binary file logged as text:
How can I prevent modsecurity from bloating my logfiles with the content of binary files like that?
In my modsecurity auditlog there is a binary file logged as text:
How can I prevent modsecurity from bloating my logfiles with the content of binary files like that?
You can use @validateByteRange
to look for those characters that may cause you issues to drop the request body C part from the auditlog but do that after doing your basic filtering (OWASP CRS + positive filtering) so you can make sure you are not dropping important logs.
SecRule REQUEST_BODY|ARGS "@validateByteRange 9,10,13,32-126,128-255" \
"id:666,\
phase:2,\
pass,\
t:none,t:urlDecodeUni,\
msg:'Invalid character in request (non printable characters) dropping request body',\
severity:'INFO',\
setvar:'tx.msg=%{rule.msg}',\
ctl:auditLogParts=-C"