Forums de discussion

ClamAV scanning

Jair Irwin, modifié il y a 8 années.

ClamAV scanning

New Member Publications: 9 Date d'inscription: 28/11/14 Publications récentes
Hi all,

I have implemented ClamAV integration with liferay by adding the following to the portal-ext.properties file:
dl.store.antivirus.enabled=true
dl.store.antivirus.impl=com.liferay.portlet.documentlibrary.antivirus.ClamAntivirusScannerImpl

The scanning has been tested with the EICAR virus file and it works well. However, recently we manually updated our ClamAV virus DB (we are not able to do it automatically) and noticed that the DB files are quite large. This in turn has led to the uploading of content in liferay to take much longer than before (a small file takes about 20 seconds to scan and upload instead of the previous 3 seconds). I understand this may be more of a "ClamAV" question, but I'm wondering if anything could be done from a liferay perspective to speed things up? I know ClamAV has both "clamscan" and "clamdscan" - clamdscan is much faster than clamscan - not sure which one we invoke but wonder if it's possible to specify?

Thanks,

Jair.
thumbnail
Dennis Ju, modifié il y a 8 années.

RE: ClamAV scanning

Regular Member Publications: 228 Date d'inscription: 30/09/10 Publications récentes
It looks like Liferay's ClamAntivirusScannerImpl is hardcoded to run clamscan (and not clamdscan). The logic is pretty straightforward, so you can try rolling your own implementation calling clamdscan.
Jair Irwin, modifié il y a 8 années.

RE: ClamAV scanning

New Member Publications: 9 Date d'inscription: 28/11/14 Publications récentes
Thanks Dennis!
That is very interesting. I am not a programmer myself so I may have to ask my developer for assistance.
Looking at that piece of code, would it likely simply be a matter of replacing "clamscan" with "clamdscan" and leaving all the rest the same?
Thanks again,
Jair.
thumbnail
Dennis Ju, modifié il y a 8 années.

RE: ClamAV scanning

Regular Member Publications: 228 Date d'inscription: 30/09/10 Publications récentes
The parameters and return codes for clamdscan and clamscan look quite similar, so there's a good chance it's as simple as replacing clamscan with clamdscan, but I'm not 100% sure. Try and see! emoticon