Java and .NET components, FTP, TELNET, SMTP, POP3, IMAP, HTTP, SSH
Home Search Knowledge Base Support

Support

Click here for access to live sales support.

For technical support please submit a ticket to the Help Desk.

 

Java and .NET Help

iPod shuffle offer

For a limited time get the newly re-designed iPod shuffle free with qualifying purchase.

Click for details.


News

Secure iNet Factory 8.0 Released
04/04/2008 02:24 PM

Updates to Email Factory for .NET and Secure iNet Factory
03/29/2008 04:06 PM

JSCAPE Secure FTP Server 3.9 Preview
03/14/2008 12:19 PM

AnyClient Service and Application Launched
03/12/2008 03:41 PM

JSCAPE Secure FTP Server 3.8 Released
02/12/2008 10:50 AM


Tutorials

Email Validation with Java
04/15/2008 02:04 PM

Sending HTML Based Email Using Java
03/11/2008 02:47 PM

Secure FTP Using Java and FTPS (FTP over SSL)
03/10/2008 04:08 PM

FTP Directory Listing Using Java
03/10/2008 03:57 PM

Sending Email Using Java
03/09/2008 03:43 PM

SSH Using Java
03/09/2008 02:53 PM


Articles

DMZ File Transfer Streaming
03/28/2008 11:57 AM

Phishing looks to FTP to distribute malware
03/13/2008 05:14 PM

Ad Hoc File Transfer Explained
03/13/2008 09:16 AM

Password Policies Made Easy
03/12/2008 03:03 PM


Feedback

Request a feature or component

Request a Java or .NET component


 

JSCAPE Secure FTP Server - Automatic Virus Scanning using ClamAV

Overview

If you are like most organizations then your FTP server accepts file uploads from both internal users (employees) and external users (customers and business partners). In addition to ensuring that data is transmitted securely via encryption protocols such as FTPS and/or PGP, you should also take measures to verify that the data received does not contain a virus or trojan. The purpose of this tutorial is to demonstrate how you can automatically perform virus scans whenever a file is uploaded to your server. This tutorial focuses specifically on using the open-source ClamAV virus scanning software in a Linux environment. ClamAV is also available for Windows however you may use any anti-virus scanning software that can be invoked from the command line.

Prerequisites

Download and install JSCAPE Secure FTP Server

Download and install ClamAV

Updating virus definition files

Like most anti-virus software ClamAV uses a database of virus definition signatures to detect viruses. In order to maximize virus protection it is recommended that these definition files be updated frequently and automatically. The virus definition signatures for ClamAV may be easily updated using the freshclam command. However, to have these signatures updated automatically we will need to create a trigger. This trigger will invoke the freshclam command every 24 hours at 1 a.m.

1. Open JSCAPE Secure FTP Server Manager and click on the Triggers node.

2. Click the "Add" button to begin adding a new trigger.

3. In the "Name" field enter "Clamav Virus Definition Update" and in the "Event Type" field select the "Current Time" option. Click "Next" to continue.

ftp server virus scanning

4. Set the condition to "Hour EQUALS 1 AND Minute Equals 0". Click "Next" to continue.

ftp server virus scanning

5. Select the "Action Type" of "Run Process" and set the "Program" field to the full path of the freshclam binary. Click "OK" to continue.

ftp server virus scanning

Scanning uploaded files for viruses

Now that we have added the trigger for automatically updating the virus definitions, our next step is to add a trigger that will automatically scan files for viruses when they are uploaded.

1. In Triggers node of JSCAPE Secure FTP Server click the "Add" button to begin adding a new trigger.

2. Enter "Clamav Virus Scan" in the "Name" field and "File Upload" in the "Event Type" field. Click "Next" to continue.

2. Set the condition to "Success EQUALS true". Click "Next" to continue.

3. Set the "Action Type" field to "Run Process", the "Program" field to the full path of the clamscan binary, and the "Arguments" field to the arguments to pass to the clamscan binary. The --move=/opt/JSCAPE_Secure_FTP_Server/users/infected argument specifies the directory that infected files should be moved to. The %LocalPath% variable represents the uploaded file to be scanned.

Receiving notification on quarantined files

To be notified when an infected file is detected we will use a Directory Monitor combined with a Trigger.

1. In Directory Monitors node of JSCAPE Secure FTP Server Manager click on the "Add" button to begin adding a new monitor.

2. In "Name" field enter "Infected Files" and in "Directory" field enter the directory that infected files are moved to that are detected by ClamAV.

3. Check the "Monitor file add" button to only monitor files that are added to this directory.

4. Click "OK" to add the monitor.

5. Next we need to add a trigger to notify us via email when a new file is added to the infected directory. Go to the Triggers node in JSCAPE Secure FTP Server Manager and click on the "Add" button.

6. In the "Name" field enter "Clamav Virus Quarantined". For the "Event Type" field select "Directory Monitor File Added". Click "Next" to continue.

7. Set the Condition to "Monitor EQUALS Infected Files". Click "Next" to continue.

8. In the "Action Type" field select "Send Email". Complete the necessary fields for your SMTP server and email message. Click "OK" to finish.

9. At this point you should have 3 triggers and a directory monitor. Click "Apply" to save settings and begging detecting infected files.

Summary

In this tutorial you learned how to detect, quarantine and send an email notification for any virus infected files uploaded to the server using triggers. JSCAPE Secure FTP Server is ideal for automating virtually any file transfer business processes. To experience more Download JSCAPE Secure FTP Server .