Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Virus Scanner Lisa Simpson June 23, 2009 9:15 AM
RE: Virus Scanner Amos Fong June 23, 2009 9:55 AM
RE: Virus Scanner Lisa Simpson June 25, 2009 12:52 PM
RE: Virus Scanner Paul Martin January 5, 2010 4:43 PM
RE: Virus Scanner Juan Fernández January 12, 2010 11:53 PM
RE: Virus Scanner Tapas Ranjan Patra May 30, 2011 1:27 AM
RE: Virus Scanner Juan Fernández May 30, 2011 1:54 AM
RE: Virus Scanner Tapas Ranjan Patra May 30, 2011 10:25 PM
RE: Virus Scanner Juan Fernández May 31, 2011 12:15 AM
RE: Virus Scanner Juan Fernández May 31, 2011 2:51 AM
RE: Virus Scanner Xavier Moreno May 31, 2011 3:32 AM
RE: Virus Scanner Albert Coronado Calzada May 31, 2011 3:35 AM
RE: Virus Scanner Aritz Galdos May 31, 2011 3:42 AM
RE: Virus Scanner Juan Fernández May 31, 2011 3:51 AM
RE: Virus Scanner Aritz Galdos May 31, 2011 3:58 AM
RE: Virus Scanner Juan Fernández May 31, 2011 4:02 AM
RE: Virus Scanner Aritz Galdos May 31, 2011 4:10 AM
RE: Virus Scanner Juan Fernández May 31, 2011 4:15 AM
RE: Virus Scanner Albert Coronado Calzada May 31, 2011 4:53 AM
RE: Virus Scanner Juan Fernández May 31, 2011 4:59 AM
RE: Virus Scanner Tapas Ranjan Patra May 31, 2011 8:18 AM
RE: Virus Scanner Juan Fernández May 31, 2011 10:23 AM
RE: Virus Scanner Albert Coronado Calzada June 1, 2011 12:11 AM
RE: Virus Scanner Juan Fernández May 31, 2011 10:24 AM
RE: Virus Scanner Tapas Ranjan Patra May 31, 2011 10:13 PM
RE: Virus Scanner Aritz Galdos June 1, 2011 12:19 AM
RE: Virus Scanner Juan Fernández June 1, 2011 12:24 AM
RE: Virus Scanner Aritz Galdos June 1, 2011 12:32 AM
RE: Virus Scanner Juan Fernández June 1, 2011 12:34 AM
RE: Virus Scanner Albert Coronado Calzada June 1, 2011 12:55 AM
RE: Virus Scanner Juan Fernández June 1, 2011 1:05 AM
RE: Virus Scanner Tapas Ranjan Patra June 2, 2011 3:15 AM
RE: Virus Scanner Aritz Galdos June 2, 2011 6:00 AM
RE: Virus Scanner Tapas Ranjan Patra June 2, 2011 8:41 AM
RE: Virus Scanner Aritz Galdos June 2, 2011 8:44 AM
RE: Virus Scanner Tapas Ranjan Patra June 2, 2011 8:32 AM
RE: Virus Scanner Juan Fernández June 2, 2011 9:30 AM
RE: Virus Scanner Juan Fernández June 3, 2011 1:24 AM
RE: Virus Scanner Aritz Galdos June 3, 2011 1:44 AM
RE: Virus Scanner Juan Fernández June 3, 2011 2:55 AM
RE: Virus Scanner Aritz Galdos June 3, 2011 3:00 AM
RE: Virus Scanner Juan Fernández June 3, 2011 3:08 AM
RE: Virus Scanner Tapas Ranjan Patra June 3, 2011 3:42 AM
RE: Virus Scanner Juan Fernández June 3, 2011 9:03 AM
RE: Virus Scanner Tapas Ranjan Patra June 4, 2011 12:29 AM
RE: Virus Scanner Tarkan Corak June 5, 2011 4:09 AM
RE: Virus Scanner Tapas Ranjan Patra June 5, 2011 8:03 AM
RE: Virus Scanner Tarkan Corak June 5, 2011 10:34 AM
RE: Virus Scanner Tapas Ranjan Patra June 5, 2011 11:01 AM
RE: Virus Scanner Juan Fernández June 6, 2011 12:14 AM
RE: Virus Scanner Aritz Galdos June 6, 2011 1:51 AM
RE: Virus Scanner Tapas Ranjan Patra June 6, 2011 1:59 AM
RE: Virus Scanner Aritz Galdos June 6, 2011 2:02 AM
RE: Virus Scanner Tapas Ranjan Patra June 6, 2011 2:09 AM
RE: Virus Scanner Tapas Ranjan Patra June 6, 2011 2:16 AM
RE: Virus Scanner Aritz Galdos June 6, 2011 3:43 AM
RE: Virus Scanner Tarkan Corak June 6, 2011 7:46 AM
RE: Virus Scanner Jonas Yuan June 6, 2011 9:13 AM
RE: Virus Scanner Aritz Galdos June 6, 2011 9:15 AM
RE: Virus Scanner Jonas Yuan June 8, 2011 7:35 AM
RE: Virus Scanner Albert Coronado Calzada June 17, 2011 7:59 AM
RE: Virus Scanner Tapas Ranjan Patra June 6, 2011 6:48 AM
RE: Virus Scanner Juan Fernández June 8, 2011 11:54 PM
RE: Virus Scanner Juan Fernández June 20, 2011 2:57 AM
RE: Virus Scanner Tapas Ranjan Patra June 21, 2011 2:30 AM
RE: Virus Scanner Roshan Qureshi July 18, 2012 11:46 PM
RE: Virus Scanner Aritz Galdos July 19, 2012 12:06 AM
RE: Virus Scanner Roshan Qureshi July 19, 2012 12:42 AM
RE: Virus Scanner Aritz Galdos July 19, 2012 12:45 AM
RE: Virus Scanner Roshan Qureshi July 19, 2012 1:23 AM
RE: Virus Scanner Roshan Qureshi July 19, 2012 4:09 AM
RE: Virus Scanner Hitoshi Ozawa July 19, 2012 6:11 AM
Lisa Simpson
Virus Scanner
June 23, 2009 9:15 AM
Answer

Lisa Simpson

Rank: Liferay Legend

Posts: 2034

Join Date: March 5, 2009

Recent Posts

Can we integrate some sort of virus scanning for uploads? I'm having bad visions of an infected word document in the document manager.....
Amos Fong
RE: Virus Scanner
June 23, 2009 9:55 AM
Answer

Amos Fong

LIFERAY STAFF

Rank: Liferay Legend

Posts: 1844

Join Date: October 7, 2008

Recent Posts

Hi Lisa,

That sounds like a good idea. The best way to do it is to have an anti-virus program with a java API. Then you could run it in a model listener everytime it detects a document is uploaded.
Lisa Simpson
RE: Virus Scanner
June 25, 2009 12:52 PM
Answer

Lisa Simpson

Rank: Liferay Legend

Posts: 2034

Join Date: March 5, 2009

Recent Posts

Clam AV has a java API... It's an open source AV... not the most elegant solution, but... definitely workable on the *nix boxes... I don't don't if their sister project ClamWin has a Java API or not but it should be worth looking at since it would definitely be a selling point for you guys.
Paul Martin
RE: Virus Scanner
January 5, 2010 4:43 PM
Answer

Paul Martin

Rank: New Member

Posts: 11

Join Date: July 24, 2008

Recent Posts

Do you have anymore information on how to use ClamAv with the document library?
Juan Fernández
RE: Virus Scanner
January 12, 2010 11:53 PM
Answer

Juan Fernández

LIFERAY STAFF

Rank: Liferay Legend

Posts: 1227

Join Date: October 2, 2008

Recent Posts

Does anybody know an opensource antivirus library that we can add to the Document Library?
I think it would be a nice feature to add in the following releases
Regards
Juan Fernández

As far as I know, the way to solve this problem is by running an antivirus in a (different) machine and communicating Liferay with it (for example via web services) when we want to upload or download a file, as Yahoo mail does.

The steps to do now are searching an AV to which we can send a file (it has to be opensource) and then develope the connector so that we can integrate it wherever we want in Liferay. An interesting candidate is ClaimAV, as Lisa said... let's study that
Tapas Ranjan Patra
RE: Virus Scanner
May 30, 2011 1:27 AM
Answer

Tapas Ranjan Patra

Rank: New Member

Posts: 18

Join Date: December 22, 2010

Recent Posts

Hi Juan Fernández,
Any update on virus scanner. Please let me know .
Juan Fernández
RE: Virus Scanner
May 30, 2011 1:54 AM
Answer

Juan Fernández

LIFERAY STAFF

Rank: Liferay Legend

Posts: 1227

Join Date: October 2, 2008

Recent Posts

Hi Tapas:
no updates at all. There hasn't been any response from the community, so I assume there's no much interest in developing this feature.
Are you interested? Can you describe your use case and the features you'd like Liferay to have?
Tapas Ranjan Patra
RE: Virus Scanner
May 30, 2011 10:25 PM
Answer

Tapas Ranjan Patra

Rank: New Member

Posts: 18

Join Date: December 22, 2010

Recent Posts

Hi Juan,
Thanks for your response.Please find below use case for virus scanning.

1. Attachments will be virus scanned at the point of upload. In addition to the real-time scan at upload, an existing process will virus scan files on the server on a periodic basis. The addional periodic scan could identify in cases where the virus defination has been updated etc.

2. Offending files will appear on scan report which will be emailed tp the portal team.An operational proces will need to be defined from the Portal support team to remove the file and contact the client/person who uploaded it.


Waiting for your response.
Juan Fernández
RE: Virus Scanner
May 31, 2011 12:15 AM
Answer

Juan Fernández

LIFERAY STAFF

Rank: Liferay Legend

Posts: 1227

Join Date: October 2, 2008

Recent Posts

Hi Tapas:
To implement what you need, some steps are required:

1) Look for an OpenSource antivirus that can run on the server and has an API/Web services so that we can send it a document and receive a report. I think ClaimAV is a good candidate.

2) Develop a plugin for Liferay that will be a Service Wrapper or a Model Listener for the document library. This will allow you to intercept the calls to the service and submit the document to the AV

3) Extend/modify the document library to show some messages (warnings for the users) and to allow enabling/disabling of the antivirus filter

Let me know if you start working on this to help you solve your doubts. This would be a cool feature for Liferay.
Regards!
Juan Fernández
RE: Virus Scanner
May 31, 2011 2:51 AM
Answer

Juan Fernández

LIFERAY STAFF

Rank: Liferay Legend

Posts: 1227

Join Date: October 2, 2008

Recent Posts

Well, some updates:

after discussing with two community members from the spanish community (Artiz and Albert), they've found this proposal quite interesting and may want to participate in the implementation of a new infrastructure to plugin anti viruses in to the liferay architecture.

We can make this a community project, and we can focus on creating a flexible interface in a plugin (quite similar to the sanitizers) so that it can grow in the future.

Share your thougths!
Regards
Xavier Moreno
RE: Virus Scanner
May 31, 2011 3:32 AM
Answer

Xavier Moreno

Rank: New Member

Posts: 24

Join Date: March 24, 2009

Recent Posts

Hi everyone,
I'd like to help if it's possible :-)
Albert Coronado Calzada
RE: Virus Scanner
May 31, 2011 3:35 AM
Answer

Albert Coronado Calzada

Rank: Junior Member

Posts: 36

Join Date: February 10, 2009

Recent Posts

Interesting, I hope we can release a versión soon!!! Virus scanner in Liferay document library.

Regards,
Aritz Galdos
RE: Virus Scanner
May 31, 2011 3:42 AM
Answer

Aritz Galdos

Rank: Expert

Posts: 396

Join Date: May 15, 2007

Recent Posts

It will be a great experience. Community member developing together. Great!!
Juan Fernández
RE: Virus Scanner
May 31, 2011 3:51 AM
Answer

Juan Fernández

LIFERAY STAFF

Rank: Liferay Legend

Posts: 1227

Join Date: October 2, 2008

Recent Posts

Awesome, guys, you rock! emoticon

Well, let's see what infrastructure we need to do this.

1) Code Versioning System: Google Code, Sourceforge, GitHub? Tell me your preferences
2) Information exchange: I think forums are ok to discuss. When we have something stable we can create a wiki page to share experiences

Following steps:
1) Search for info about this AV (clamAV) and its API and search for others that may be more suitable to integrate
2) Design the best architecture for the plugin
Aritz Galdos
RE: Virus Scanner
May 31, 2011 3:58 AM
Answer

Aritz Galdos

Rank: Expert

Posts: 396

Join Date: May 15, 2007

Recent Posts

Hi
1)About code versioning. I have never used distributed code versioning systems and I feel like testing it. So my vote goes for GitHub
2) I think forums will do. And community can read here. Another option could be GitHub itself. I guess it has communication tools.
Juan Fernández
RE: Virus Scanner
May 31, 2011 4:02 AM
Answer

Juan Fernández

LIFERAY STAFF

Rank: Liferay Legend

Posts: 1227

Join Date: October 2, 2008

Recent Posts

I'm ok with github: would you manage the project creation, Artiz? (let's learn emoticon)
About communication, I think it's better to have a forum thread here, so more people can join us
Aritz Galdos
RE: Virus Scanner
May 31, 2011 4:10 AM
Answer

Aritz Galdos

Rank: Expert

Posts: 396

Join Date: May 15, 2007

Recent Posts

OK, I will create the project. I need some time to read about gitHub carefuly so I will create it this evening.
Juan Fernández
RE: Virus Scanner
May 31, 2011 4:15 AM
Answer

Juan Fernández

LIFERAY STAFF

Rank: Liferay Legend

Posts: 1227

Join Date: October 2, 2008

Recent Posts

No hurry! emoticon
Thanks Aritz
Albert Coronado Calzada
RE: Virus Scanner
May 31, 2011 4:53 AM
Answer

Albert Coronado Calzada

Rank: Junior Member

Posts: 36

Join Date: February 10, 2009

Recent Posts

ok, I will be in holidays until 13th of July. I can start working with AV interfice and looking for a good AV. I would like found a solution for integrate any AV easy.

@Juan For me, the hardest work is indentify Model and Service methods to hook. Can you identify this methods?¿
Juan Fernández
RE: Virus Scanner
May 31, 2011 4:59 AM
Answer

Juan Fernández

LIFERAY STAFF

Rank: Liferay Legend

Posts: 1227

Join Date: October 2, 2008

Recent Posts

I'll think about a good architecture for this (it'll be in my spare time... from 2:00 to 3:00 AM, I guess emoticon)
I'll reach you soon
Tapas Ranjan Patra
RE: Virus Scanner
May 31, 2011 8:18 AM
Answer

Tapas Ranjan Patra

Rank: New Member

Posts: 18

Join Date: December 22, 2010

Recent Posts

Hi ,
Its good to see the responses. I think its a good start up .Soon i will start work on that.

Can you help me to get the library(.jar file), i got the api only.

Is this the correct api API ?
Apart from that it seems we need to pass command to do scanning
Command
Juan Fernández
RE: Virus Scanner
May 31, 2011 10:23 AM
Answer

Juan Fernández

LIFERAY STAFF

Rank: Liferay Legend

Posts: 1227

Join Date: October 2, 2008

Recent Posts

Hi guys:
After analyzing the problem, I think the best way to implement this is:

1) Create a hook plugin
2) Add a new service wrapper for DLFileEntryLocalService called DLFileEntryAntiVirusLocalService
3) In this class we have to extend the following methods
addFileEntry
updateFileEntry
4) In both methods we should intercept the InputStream, analyze it (with the AV we will integrate) and then call parent method

That's a starting point
Juan Fernández
RE: Virus Scanner
May 31, 2011 10:24 AM
Answer

Juan Fernández

LIFERAY STAFF

Rank: Liferay Legend

Posts: 1227

Join Date: October 2, 2008

Recent Posts

@Tapas: I think this is a good example of how to use the API -> http://code.google.com/p/clamavj/
Tapas Ranjan Patra
RE: Virus Scanner
May 31, 2011 10:13 PM
Answer

Tapas Ranjan Patra

Rank: New Member

Posts: 18

Join Date: December 22, 2010

Recent Posts

ok.I will check and let you update. As there are different API available so i was bit confused.

Anyways thanks.
Albert Coronado Calzada
RE: Virus Scanner
June 1, 2011 12:11 AM
Answer

Albert Coronado Calzada

Rank: Junior Member

Posts: 36

Join Date: February 10, 2009

Recent Posts

@Juan

I'm agree. I was thinking in a hook, thanks for indentify the methods and classes.

We can define an interfice who defines the method analyze(byte[] b), then we can create as classes as AV we integrate. We can define what AV we want throught portal-ex.properties parameter (For example).

Tomorrow I start my holidays, when I come back talk about implementation.
Aritz Galdos
RE: Virus Scanner
June 1, 2011 12:19 AM
Answer

Aritz Galdos

Rank: Expert

Posts: 396

Join Date: May 15, 2007

Recent Posts

Hi,
I'am about to create a repo in GitHub. Iam in doubt about project name.
Some ideas... Liferay AV service or Liferay AV Hook,
Juan Fernández
RE: Virus Scanner
June 1, 2011 12:24 AM
Answer

Juan Fernández

LIFERAY STAFF

Rank: Liferay Legend

Posts: 1227

Join Date: October 2, 2008

Recent Posts

What about "Liferay AntiVirus Plugin"? I like that one emoticon
Aritz Galdos
RE: Virus Scanner
June 1, 2011 12:32 AM
Answer

Aritz Galdos

Rank: Expert

Posts: 396

Join Date: May 15, 2007

Recent Posts

I agree, it is mor than a hook and AntiVirus is more descriptive.

I created the repo

https://github.com/aritzg/Liferay-AntiVirus-Plugin

What are your GitHub userIds guys so I can add you as collaborators
Juan Fernández
RE: Virus Scanner
June 1, 2011 12:34 AM
Answer

Juan Fernández

LIFERAY STAFF

Rank: Liferay Legend

Posts: 1227

Join Date: October 2, 2008

Recent Posts

Cool!
My user is juanferrub
Thanks, Aritz!
Albert Coronado Calzada
RE: Virus Scanner
June 1, 2011 12:55 AM
Answer

Albert Coronado Calzada

Rank: Junior Member

Posts: 36

Join Date: February 10, 2009

Recent Posts

Perfect!!! I have registered to Github as 'acoronadoc'. Is the first time I use GitHub.
Juan Fernández
RE: Virus Scanner
June 1, 2011 1:05 AM
Answer

Juan Fernández

LIFERAY STAFF

Rank: Liferay Legend

Posts: 1227

Join Date: October 2, 2008

Recent Posts

Ok, guys: now we have to decide which version will we be developing for. I'd like to make this available for 6.1, but it is not really recommended to create plugins agains trunk (it's quite inestable lately, with the huge ammount of new features we're developing), so I think the best option is to start working on 6.0.6 and when we have a GA version for 6.1 we'll upgrade the plugin.
Are you ok with this? If so, let's start creating the service wrapper so that we have the infrastructure to start integrating the AV
Tapas Ranjan Patra
RE: Virus Scanner
June 2, 2011 3:15 AM
Answer

Tapas Ranjan Patra

Rank: New Member

Posts: 18

Join Date: December 22, 2010

Recent Posts

Can somebody tell me how to get the port number of ClamAV in windows.
Aritz Galdos
RE: Virus Scanner
June 2, 2011 6:00 AM
Answer

Aritz Galdos

Rank: Expert

Posts: 396

Join Date: May 15, 2007

Recent Posts

Hi guys:

I created a hook for the service wrapper for the DLFileEntry service and uploaded it to GitHub. I added the methods to be overriden the the class that implements the wrapper.

I am new to gitHub so... I hope it to be OK

Regards!
Tapas Ranjan Patra
RE: Virus Scanner
June 2, 2011 8:32 AM
Answer

Tapas Ranjan Patra

Rank: New Member

Posts: 18

Join Date: December 22, 2010

Recent Posts

Hi Folks,
I got the port number which is 3310. Also i am able to scan the file using clamAV , by using ClamAV java API..Bit happy after struggling alot .....I have tested in Windows enviornment. I need to check in Linux enviornment..

After thats its easy to integrate with LR Document library ..
Tapas Ranjan Patra
RE: Virus Scanner
June 2, 2011 8:41 AM
Answer

Tapas Ranjan Patra

Rank: New Member

Posts: 18

Join Date: December 22, 2010

Recent Posts

Hi my user name is tapaspatra .I have only read acess.I do not have write acess.\

I am also new to github.
Aritz Galdos
RE: Virus Scanner
June 2, 2011 8:44 AM
Answer

Aritz Galdos

Rank: Expert

Posts: 396

Join Date: May 15, 2007

Recent Posts

Hi Tapas:
I just added you as collaborator.
Juan Fernández
RE: Virus Scanner
June 2, 2011 9:30 AM
Answer

Juan Fernández

LIFERAY STAFF

Rank: Liferay Legend

Posts: 1227

Join Date: October 2, 2008

Recent Posts

That is awesome, Tapas!
Aritz has prepared the perfect environment to integrate with the document library, so after you're done with the testing, we can merge both projects into a hook and we'll be able to deploy it into a Liferay instance.
Guys, you're amazing: can you feel the good vibes that open source generates? emoticon
Juan Fernández
RE: Virus Scanner
June 3, 2011 1:24 AM
Answer

Juan Fernández

LIFERAY STAFF

Rank: Liferay Legend

Posts: 1227

Join Date: October 2, 2008

Recent Posts

Hi guys:
today a collegue sent me an email with some info we should take into account. I quote:
if it's synchronous then you're at the mercy of the antivirus performance when you upload a document so it can make things very slow for the end user (or fail completely). It's better to hold the document in quaratine and then make it available when antivirus passes. Thus, workflow...


We didn't have this into account, and I think it's quite important. Maybe we can do a first version as a wrapper, but it's true that this can affects the final user... I think that when we have this implemented we should convert it into a workflow status.

The cool thing here is that we can reuse all the code, so that changes/improvements wouldn't be that costly

What do you think?
Aritz Galdos
RE: Virus Scanner
June 3, 2011 1:44 AM
Answer

Aritz Galdos

Rank: Expert

Posts: 396

Join Date: May 15, 2007

Recent Posts

Hell.. thats true
I didn´t think about that. Clearly, It will have to be taken into account. But for a very first trial I think we should geet it working with the wrapper. I think that in some scenarios it can be a real solution. It will not be in vain.

Great to realize about that so soon.

Apart from that. We sould define an interface, after analizing diferent AV engines, which would be implemented for each engine.

Then, something like a Factory pattern, (based on properties to select the AV engine,) could instantiate the concrete implementation.

This is my approach

Great Juan. And thanks to your collegue!!
Juan Fernández
RE: Virus Scanner
June 3, 2011 2:55 AM
Answer

Juan Fernández

LIFERAY STAFF

Rank: Liferay Legend

Posts: 1227

Join Date: October 2, 2008

Recent Posts

Hi guys:
I've been thinking about the architecture for this. Here's a proposal, based on Aritz proposal:

- An antivirus.impl property
- AntivirusFactory (quite similar to HookFactory, with a getInstance() method that reads antivirus.impl and loads the class)
- Antivirus: a java interface with the methods we'll need
- AntivirusBaseImpl [implements Antivirus]: base implementation of the interface (it can be a dummy class)
- ClamAV [extends AntivirusBaseImpl], NortonAV [extends AntivirusBaseImpl]... concrete implementations of antivirus services

So in the wrapper (or in the workflow status) we can call something like this:

Antivirus antivirus = AntivirusFactory.getInstance();
antivirus.checkFile(dlFileEntry myFile);
Aritz Galdos
RE: Virus Scanner
June 3, 2011 3:00 AM
Answer

Aritz Galdos

Rank: Expert

Posts: 396

Join Date: May 15, 2007

Recent Posts

I do agree

Some research work will have to be done to define a general interface to fit as much AVs as possible.
I have been looking around, and there are not much AVs with an api, and not much info about creating third party integrations.

Not much open source in AVs world :S
Juan Fernández
RE: Virus Scanner
June 3, 2011 3:08 AM
Answer

Juan Fernández

LIFERAY STAFF

Rank: Liferay Legend

Posts: 1227

Join Date: October 2, 2008

Recent Posts

We can start with a generic interface based on clamAV and if somebody integrates other engines, he'll have to improve the interface.
We can not think about something we don't know...
Tapas Ranjan Patra
RE: Virus Scanner
June 3, 2011 3:42 AM
Answer

Tapas Ranjan Patra

Rank: New Member

Posts: 18

Join Date: December 22, 2010

Recent Posts

Hi Jaun & All,
I have integrated Av Scanner with LR. I have modefied addFileEntry(arg1, arg2 , ...) method. I have commited my code in "github". Please have a look once.

Now in addFileEntry() method if virus is detected i am just making the file as File file = new File(" ") and displaying liferay error message. Now how can set some valid message to show to the user.
Juan Fernández
RE: Virus Scanner
June 3, 2011 9:03 AM
Answer

Juan Fernández

LIFERAY STAFF

Rank: Liferay Legend

Posts: 1227

Join Date: October 2, 2008

Recent Posts

Hi guys!
Just committed some improvements to the repository.

@Tapas: I don't think it makes sense to add an empty file to the document library. It's better to throw an exception, alert the user and cancel the upload. What do you think?
Tapas Ranjan Patra
RE: Virus Scanner
June 4, 2011 12:29 AM
Answer

Tapas Ranjan Patra

Rank: New Member

Posts: 18

Join Date: December 22, 2010

Recent Posts

I agree, but i am stuck to proceed after virus detected. As we need to return the dlFileEnry object. and How can i set some valid message to show to the user.
Tarkan Corak
RE: Virus Scanner
June 5, 2011 4:09 AM
Answer

Tarkan Corak

Rank: Regular Member

Posts: 130

Join Date: October 7, 2008

Recent Posts

Tapas Ranjan Patra:
I agree, but i am stuck to proceed after virus detected. As we need to return the dlFileEnry object. and How can i set some valid message to show to the user.


Hi,

I'm already using ClamAV as Virus Scanner for my Document Library. Just for testing create your Excpetion as subclass of FileSizeException, as this will be handled by edit_file_entry.jsp.

Then add these hooks:

JSP Hook (edit_file_entry.jsp)
1<liferay-ui:error key="com.liferay.portlet.documentlibrary.antivirus.InfectedFileException" message="infected-file-exception" />

Langauge Hook (Language.properties)
1infected-file-exception=[your error message]


Tarkan
Tapas Ranjan Patra
RE: Virus Scanner
June 5, 2011 8:03 AM
Answer

Tapas Ranjan Patra

Rank: New Member

Posts: 18

Join Date: December 22, 2010

Recent Posts

@Tarkan : Yeah i got your point.

But If you have implemented you could have reply When this Virus scanner blog feature stated bit earlier.

Anyways thanks alot.
Tarkan Corak
RE: Virus Scanner
June 5, 2011 10:34 AM
Answer

Tarkan Corak

Rank: Regular Member

Posts: 130

Join Date: October 7, 2008

Recent Posts

Tapas Ranjan Patra:
But If you have implemented you could have reply When this Virus scanner blog feature stated bit earlier. Anyways thanks alot.

Since this week I didn't know this thread. Otherwise of course I'd have shared my knowledge with you earlier!
Tapas Ranjan Patra
RE: Virus Scanner
June 5, 2011 11:01 AM
Answer

Tapas Ranjan Patra

Rank: New Member

Posts: 18

Join Date: December 22, 2010

Recent Posts

Hi Tarak,
Ok no problem.
Now I am getting error "only type can be imported" while importing below package in edit_file_entry.jsp.

<%@page import="com.liferay.portlet.documentlibrary.antivirus.InfectedFileException" %>

I do not understand what is the problem.Any idea?
Juan Fernández
RE: Virus Scanner
June 6, 2011 12:14 AM
Answer

Juan Fernández

LIFERAY STAFF

Rank: Liferay Legend

Posts: 1227

Join Date: October 2, 2008

Recent Posts

Hi Tapas:
This usually happens when you import by mistake a package instead of a class.
Check the import route to verify that everything is fine
Good luck!

@Tarkan
Tarkan Çorak:

I'm already using ClamAV as Virus Scanner for my Document Library


Can you share your experience? How did you implement this? Was integrated with the workflow system or as a service wrapper?
Thanks!
Aritz Galdos
RE: Virus Scanner
June 6, 2011 1:51 AM
Answer

Aritz Galdos

Rank: Expert

Posts: 396

Join Date: May 15, 2007

Recent Posts

Hi guys:

I updated my source, and organized classes and so... I need to resolve this error before I commit.

08:46:28,847 ERROR [HotDeployUtil:112] com.liferay.portal.kernel.deploy.hot.HotDeployException: Error registering hook for Liferay-AntiVirus-hook
com.liferay.portal.kernel.deploy.hot.HotDeployException: Error registering hook for Liferay-AntiVirus-hook
at com.liferay.portal.kernel.deploy.hot.BaseHotDeployListener.throwHotDeployException(BaseHotDeployListener.java:45)
at com.liferay.portal.deploy.hot.HookHotDeployListener.invokeDeploy(HookHotDeployListener.java:221)
at com.liferay.portal.kernel.deploy.hot.HotDeployUtil._doFireDeployEvent(HotDeployUtil.java:109)
at com.liferay.portal.kernel.deploy.hot.HotDeployUtil._fireDeployEvent(HotDeployUtil.java:182)
at com.liferay.portal.kernel.deploy.hot.HotDeployUtil.fireDeployEvent(HotDeployUtil.java:38)
at com.liferay.portal.kernel.servlet.HookContextListener.contextInitialized(HookContextListener.java:36)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3972)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4467)
at org.apache.catalina.startup.HostConfig.checkResources(HostConfig.java:1244)
at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1342)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:303)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1337)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1601)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1610)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1590)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.NoSuchMethodException: com.liferay.portlet.documentlibrary.service.DLFileEntryAntiVirusLocalService.<init>(com.liferay.portlet.documentlibrary.service.DLFileEntryService)
at java.lang.Class.getConstructor0(Class.java:2706)
at java.lang.Class.getConstructor(Class.java:1657)
at com.liferay.portal.deploy.hot.HookHotDeployListener.doInvokeDeploy(HookHotDeployListener.java:575)
at com.liferay.portal.deploy.hot.HookHotDeployListener.invokeDeploy(HookHotDeployListener.java:218)
... 15 more



Any clue?

When I resolve this I will push it to gitHub and ask you all guys to update.

Regards!
Tapas Ranjan Patra
RE: Virus Scanner
June 6, 2011 1:59 AM
Answer

Tapas Ranjan Patra

Rank: New Member

Posts: 18

Join Date: December 22, 2010

Recent Posts

Hi Aritz,
open liferay-hook.xml and check there is space or not in com.liferay.portlet.documentlibrary.service.DLFileEntryAntiVirusLocalService.

<?xml version="1.0"?>
<!DOCTYPE hook PUBLIC "-//Liferay//DTD Hook 6.0.0//EN" "http://www.liferay.com/dtd/liferay-hook_6_0_0.dtd">

<hook>
<custom-jsp-dir>/custom_jsps</custom-jsp-dir>
<service>
<service-type>
com.liferay.portlet.documentlibrary.service.DLFileEntryLocalService
</service-type>
<service-impl>
com.liferay.portlet.documentlibrary.service.DLFileEntryAntiVirusLocalService
</service-impl>
</service>
</hook>

Hope this will resolve your issue.
Aritz Galdos
RE: Virus Scanner
June 6, 2011 2:02 AM
Answer

Aritz Galdos

Rank: Expert

Posts: 396

Join Date: May 15, 2007

Recent Posts

This is how it look like right now
 1<?xml version="1.0"?>
 2<!DOCTYPE hook PUBLIC "-//Liferay//DTD Hook 6.0.0//EN" "http://www.liferay.com/dtd/liferay-hook_6_0_0.dtd">
 3
 4
 5<hook>
 6    <!--
 7    <portal-properties>content/antivirus.properties</portal-properties>
 8     -->
 9    <service>
10        <service-type>
11            com.liferay.portlet.documentlibrary.service.DLFileEntryService
12        </service-type>
13        <service-impl>
14            com.liferay.portlet.documentlibrary.service.DLFileEntryAntiVirusLocalService
15        </service-impl>
16    </service>
17</hook>
Tapas Ranjan Patra
RE: Virus Scanner
June 6, 2011 2:09 AM
Answer

Tapas Ranjan Patra

Rank: New Member

Posts: 18

Join Date: December 22, 2010

Recent Posts

@Aritz: I faced same issue and resolved like that only.
Tapas Ranjan Patra
RE: Virus Scanner
June 6, 2011 2:16 AM
Answer

Tapas Ranjan Patra

Rank: New Member

Posts: 18

Join Date: December 22, 2010

Recent Posts

@Jaun : may package name inside the hook is com.liferay.portlet.documentlibrary.antivirus.

Trying to acess like <%@ page import="com.liferay.portlet.documentlibrary.antivirus.InfectedFileException" %>.

If i will use com.liferay.portlet.documentlibrary.antivirus.* then its not throwing any error but if i will use any of class from that package then its throwing error.
Aritz Galdos
RE: Virus Scanner
June 6, 2011 3:43 AM
Answer

Aritz Galdos

Rank: Expert

Posts: 396

Join Date: May 15, 2007

Recent Posts

Hi guys

1)I tried to tidy up the source a bit. Could you guys update to head revision?
2)I still have de same issue when deploying. even after updationg to 6.0.6
3) There are referenes to
import com.liferay.portlet.documentlibrary.service.ClamScan;
and
import com.liferay.portlet.documentlibrary.service.ScanResult;
But classes are not in repo. I guess Juan you added this references but not the casses to repo. Right?
So mean while, I commentedd out the references and commited.
Tapas Ranjan Patra
RE: Virus Scanner
June 6, 2011 6:48 AM
Answer

Tapas Ranjan Patra

Rank: New Member

Posts: 18

Join Date: December 22, 2010

Recent Posts

@Jaun : Tested in linux enviornment. Its working fine .
Tarkan Corak
RE: Virus Scanner
June 6, 2011 7:46 AM
Answer

Tarkan Corak

Rank: Regular Member

Posts: 130

Join Date: October 7, 2008

Recent Posts

Juan Fernández:
@Tarkan
Can you share your experience? How did you implement this? Was integrated with the workflow system or as a service wrapper?
Thanks!

Hi Juan,

As for me security was more important than (a little bit less) performance. Therefore I decided to implement it synchronous as a service wrapper, and not asynchronous with workflow. Similar to the solution above. The method addFileEntry is the perfect place, as at this point the (temporary) file has already been uploaded to the temp directory of the app server.

Tarkan
Jonas Yuan
RE: Virus Scanner
June 6, 2011 9:13 AM
Answer

Jonas Yuan

Rank: Liferay Master

Posts: 993

Join Date: April 26, 2007

Recent Posts

Hi Juan,

I guess it would be better to implement Virus Scanner in follows steps.

1) provide virus scanner interface in the portal core
like
1 com.liferay.portal.kernel.virusscanner.VirusScanner


2) provide dummy implementation in the portal impl
add property
1virusscanner.impl=com.liferay.portal.virusscanne.DummyVirusScannerImpl


3) call virus scanner when uploading documents based on the portal impl.

4) in any hook plugin - called AntiVirus plugin, virusscanner.imp could get overwritten.
use portal properties hooks like

1virusscanner.impl=com.liferay.antivirus.hook.virusscanner.AntiVirusScannerImpl


Clam AntiVirus is an open source (GPL) anti-virus toolkit for UNIX, designed especially for e-mail scanning on mail gateways. It would be a good example to show this new feature - automatic antivirus scanner.

Thanks

Jonas Yuan
Aritz Galdos
RE: Virus Scanner
June 6, 2011 9:15 AM
Answer

Aritz Galdos

Rank: Expert

Posts: 396

Join Date: May 15, 2007

Recent Posts

Hi Jonas

As far as we are community menbers It is much easier for us to implement this as plugin. At least for a kick start.

What we are doing is a hook which implements a wrapper for DLFileEntry service.

Based on some properties such antivirus.impl we select the implementation. Which is inviked in execution time by a creator/Factory class.

We are testing it against ClamAV which looks like it fits best for our purpuse.

Some posts earlier juan stated a problem. Synchronous virus testing will be a locking task which can take user to a timeout or toa worse user experience at least. We will face this in a further phase I think.

You can have a look and contribute (of course) in this github project

https://github.com/aritzg/Liferay-AntiVirus-Plugin

Regards!!!
Jonas Yuan
RE: Virus Scanner
June 8, 2011 7:35 AM
Answer

Jonas Yuan

Rank: Liferay Master

Posts: 993

Join Date: April 26, 2007

Recent Posts

Hi Aritz,

The plugin looks good. Thanks, nice job!

In order to leverage more AntiVirus apps, it would be better to provide a generic interface in the portal core. Thus any specific antivirus app could be integrated in the hook plugin easily, as mentioned in the previous post.

Thanks

Jonas Yuan
Juan Fernández
RE: Virus Scanner
June 8, 2011 11:54 PM
Answer

Juan Fernández

LIFERAY STAFF

Rank: Liferay Legend

Posts: 1227

Join Date: October 2, 2008

Recent Posts

@Tapas: awesome! Good news it works fine. Thanks, Tapas.

@Jonas: Aritz point is that before commiting this to trunk, we should look for a solution that is reliable and won't be a performance issue.

Right now, if there's a slow network, or if you send a big document, the user will have to wait for minuts till the AV sends its response, so it is much better to put the document into incubation state (via workflow), then send it to the AV services and after a response have been received, publish it.

We should definitely integrate this into the workflow system before thinking of comitting it to trunk, and we already have all the components needed to implement this, so it wouldn't be that difficult. I'm a bit overloaded right now, but if some of you can look at this, I can help you with the workflow definition.

Thanks, team! emoticon
Albert Coronado Calzada
RE: Virus Scanner
June 17, 2011 7:59 AM
Answer

Albert Coronado Calzada

Rank: Junior Member

Posts: 36

Join Date: February 10, 2009

Recent Posts

Hi,

Can anyone explain me the state of the project? I have been in holidays and this week I had a lot of work.

Thanks,
Juan Fernández
RE: Virus Scanner
June 20, 2011 2:57 AM
Answer

Juan Fernández

LIFERAY STAFF

Rank: Liferay Legend

Posts: 1227

Join Date: October 2, 2008

Recent Posts

Hi Albert:
we have implemented the antivirus plugin already.
It is integrated with ClamAV and it scans the documents before submiting it.
The next step is to integrate it with the workflow system.
Will you dare to implement this feature? emoticon
Regards!
Tapas Ranjan Patra
RE: Virus Scanner
June 21, 2011 2:30 AM
Answer

Tapas Ranjan Patra

Rank: New Member

Posts: 18

Join Date: December 22, 2010

Recent Posts

@Jaun : Good news that we have implemented the Antivirus feature. Not sure what will be the approach to integrate with work flow .

Anyways "well begun is half done"..Thanks to all.
Roshan Qureshi
RE: Virus Scanner
July 18, 2012 11:46 PM
Answer

Roshan Qureshi

Rank: Regular Member

Posts: 140

Join Date: August 24, 2010

Recent Posts

Hi All,

Can we get the plugin or it's not published yet?
If yes, can you share the path for it?

Thanks,
Roshan
Aritz Galdos
RE: Virus Scanner
July 19, 2012 12:06 AM
Answer

Aritz Galdos

Rank: Expert

Posts: 396

Join Date: May 15, 2007

Recent Posts

Hi,

https://github.com/aritzg/Liferay-AntiVirus-Plugin

Here is de url of the git hub repo were we developed de plugIn.

But check if new Liferay version provides anti-virus hooks.

Regards!
Roshan Qureshi
RE: Virus Scanner
July 19, 2012 12:42 AM
Answer

Roshan Qureshi

Rank: Regular Member

Posts: 140

Join Date: August 24, 2010

Recent Posts

Thanks Aritz for quick reply.
In Liferay 6.1 I found this feature and also one of the properties for setting this antivirus
dl.store.antivirus.impl=com.liferay.portlet.documentlibrary.antivirus.ClamAntivirusScannerImpl

Here I have one question. Is any installation is required for Clam to work or it's shipped with Liferay-6.1 and just the properties settings will work?

Thanks,
Roshan
Aritz Galdos
RE: Virus Scanner
July 19, 2012 12:45 AM
Answer

Aritz Galdos

Rank: Expert

Posts: 396

Join Date: May 15, 2007

Recent Posts

Hi
I never tested this option. But I am preaty sure you have to install Clam AV separately.

Regards,
Aritz
Roshan Qureshi
RE: Virus Scanner
July 19, 2012 1:23 AM
Answer

Roshan Qureshi

Rank: Regular Member

Posts: 140

Join Date: August 24, 2010

Recent Posts

Hi Aritz,

I think I have to install it on server.
I will test it. Can you please share your test environment for this.

Thanks.
Roshan Qureshi
RE: Virus Scanner
July 19, 2012 4:09 AM
Answer

Roshan Qureshi

Rank: Regular Member

Posts: 140

Join Date: August 24, 2010

Recent Posts

Hi,

I installed the Clam AV for windows and also followed wiki link :
http://www.liferay.com/documentation/liferay-portal/6.1/user-guide/-/ai/document-library-portlet
I tested this on LR 6.1CE-ga1 but did not find anything at UI side like whether it's checking for virus or not.

How can one know whether Clam AV is successfully integrated with Liferay and working fine.

Thanks,
Roshan
Hitoshi Ozawa
RE: Virus Scanner
July 19, 2012 6:11 AM
Answer

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7990

Join Date: March 23, 2010

Recent Posts

I'll also like to know how to remove infected file from the system.