inspectFile fix

This commit is contained in:
bunkerity 2020-06-06 21:01:28 +02:00
parent ccaaa8b57d
commit efcf937109
3 changed files with 6 additions and 3 deletions

View File

@ -307,6 +307,7 @@ If set to yes, ClamAV will automatically remove the detected files.
## TODO
- Default CSP
- Custom Dockerfile based on bunkerized-nginx
- Auth basic
- Documentation
- Custom TLS certificates
- HSTS preload, HPKP

View File

@ -1,2 +1,4 @@
SecUploadDir /tmp
SecUploadKeepFiles Off
SecRule FILES_TMPNAMES "@inspectFile /opt/scripts/clamav.sh" \
"phase:2,t:none,block,msg:'Virus found in uploaded file',id:'399999'"
"phase:2,t:none,deny,msg:'Virus found in uploaded file',id:'399999'"

View File

@ -1,7 +1,7 @@
#!/bin/sh
output=$(clamscan -i --no-summary "$1" 2> /dev/null)
output=$(clamscan -i --no-summary $1 2> /dev/null)
rm -f $1
if echo "$output" | grep -q ".* FOUND$" ; then
echo "0 clamscan: $output"
else