1

I start needing to scan for viruses all files uploaded to my website. I've implemented a pretty simple prototype which I tested locally and it seemed work well. However, I need to make it more complex by involving more antiviruses to be able scan an uploaded file by each of them. But I'm hesitating. Here are the possible issues:

a) Can I scan the same file concurrently by multiple antiviruses at the same time?

b) Should I run each antivirus only when it's needed (an user has uploaded a file and it has to be scan) and should they run all the time in background? If the second option, won't they conflict with each other?

c) In case, there are more files have to be scanned, should I run a new process-antivirus for each file or can I "queue" the files for each antivirus?

Yes, I'm aware about third-party services doing exactly this, I don't need them.

3

a) Can I scan the same file concurrently by multiple antiviruses at the same time?

Yes you should be able to scan the files concurrently. The only issue is if your server can handle the load of multiple scanners running at the same time. I might do 2 or 3 of them at a time, just to limit things.

b) Should I run each antivirus only when it's needed (an user has uploaded a file and it has to be scan) and should they run all the time in background? If the second option, won't they conflict with each other?

c) In case, there are more files have to be scanned, should I run a new process-antivirus for each file or can I "queue" the files for each antivirus?

I'd opt to scan them on demand, meaning scan them each time a file is uploaded, just to spread the burden out, assuming you don't get a ton of file uploads. If it's a high volume situation I'd change tactics slightly and scan them at designated times of the day.

Depending on how you structure your scanning, you'll likely need to delay making the files available until the scanning step has been completed.

  • Thanks. I'm not sure whether you answered on b and c questions. About b, for example, clam antivirus can scan a file by "clamscan 'fileName'". Does this mean, it's constantly running in background and once I say "clamscan 'fileName'" it switches to the file, scans it and goes on running in background again? Or it launches, scans the file and terminates itself each time? The same questions for other antiviruses. – アレックス Mar 2 '14 at 1:49
  • @Alex - no when you run `clamscan "filename" it runs and then stops. Unless you're running the clamav as as service on the system, or any other AV product, then they're typically not running until your launch them. – slm Mar 2 '14 at 2:01
  • I see. So is it better in terms of performance to run and stop it every time I need it? – アレックス Mar 2 '14 at 2:16
  • @Alex - if it's a few (10-20) files over the course of an hour I would say so, if it's going to be a large amount of uploads then you'll want to run it as a service. – slm Mar 2 '14 at 2:17
  • it's about 1 file per minute, so it'll 60 files per hour. Well, it should be run as a service then. – アレックス Mar 2 '14 at 2:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.