Foren

ClamAV scanning

Jair Irwin, geändert vor 8 Jahren.

ClamAV scanning

New Member Beiträge: 9 Beitrittsdatum: 28.11.14 Neueste Beiträge
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, geändert vor 8 Jahren.

RE: ClamAV scanning

Regular Member Beiträge: 228 Beitrittsdatum: 30.09.10 Neueste Beiträge
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, geändert vor 8 Jahren.

RE: ClamAV scanning

New Member Beiträge: 9 Beitrittsdatum: 28.11.14 Neueste Beiträge
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, geändert vor 8 Jahren.

RE: ClamAV scanning

Regular Member Beiträge: 228 Beitrittsdatum: 30.09.10 Neueste Beiträge
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