Uploads scanning with ClamAV

SYSTEM INFORMATION
OS type and version Linux Debian 12
Virtualmin version 7.20.2

Hi again everyone !

I have a new question regarding Virtualmin, this time, about the ClamAV antivirus scanning.

Context :
One of the websites I’ll host on Virtualmin should allow people browsing it to upload one or more files. This part works well and it’s OK.
I’ve tried uploading an EICAR test file, and it uploads with no problem, but it also stays there.

The question now :
Is there a way I can configure ClamAV to continuously scan some folders (like uploads) with its OnAccess feature using clamonacc ? I’ve looked a bit into this but I’m not sure I understand everything so some guidance would be more than welcome !

Thanks ! :slight_smile: :

Is this custom code or some 3rd party thing? In theory, from someone that has never thought about it before, it’s easy. :wink: Just pass it to clamscan as it is uploaded.

I probably wouldn’t use on-access scanning for this, but you could.

I’d probably enable clamd@scan (if it isn’t already) and run all uploaded files through clamdscan on upload, and either quarantine or delete the ones that return positive for viruses. You probably also want to limit how large files to be scanned are (even Google does this, and they have all the computers), maybe just by limiting the size of uploads.

None of this is a Virtualmin question, though. Nothing about Virtualmin changes how you’d implement this (except we do setup the clamd@scan service, but it’s just a generic scanning service, you could create your own dedicated instance if you wanted to, though that increases memory usage).

1 Like

I’d probably enable clamd@scan (if it isn’t already) and run all uploaded files through clamdscan on upload, and either quarantine or delete the ones that return positive for viruses.

Alright, I’ll look into this kind of solution, thank you.

None of this is a Virtualmin question, though.

You’re right, my bad. I’ll close this topic and look into ClamAV docs and tutorials to configure it the way I need to. Thanks again for your insight, I think that’ll get me on the right track.

Oh, it’s fine to talk about non-Virtualmin stuff here. Just wanted to be clear there’s nothing different about a Virtualmin system in this regard.

1 Like

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.