Skip to content

Instantly share code, notes, and snippets.

@angeloxx
angeloxx / modsec-clamscan.lua
Last active July 16, 2024 15:13
ModSecurity ClamAV integration script (LUA)
#!/usr/bin/lua
--[[
This script can be used to inspect uploaded files for viruses
via ClamAV. To implement, use with the following ModSecurity rule:
SecRule FILES_TMPNAMES "@inspectFile /opt/modsecurity/bin/modsec-clamscan.lua" "phase:2,t:none,log,deny"
Author: Angelo Conforti (based on Josh Amishav-Zlatin code)
Requires the clamav-server and clamav-scanner