File Storage

Enabling Antivirus Scanning for Uploaded Files

Subscription

DXP 7.3 SP 1+, Portal 7.3 GA7+, and DXP 7.2 FP 9+

Note

This feature is not currently available on Portal 7.2 and earlier versions.

You can automatically scan any file uploaded to Liferay DXP for viruses. When enabled, the scanner checks every file upon upload, including Documents & Media file creations, Objects attachment fields, and more.

The scanner detects virus-infected files on upload to Documents and Media and other Liferay applications.

Liferay integrates with the ClamAV Daemon (Clamd). For best performance, run Clamd on a separate server.

Here’s how to enable the antivirus scanning:

  1. On a separate server, configure and start Clamd.

    Important

    Load your ClamAV database before starting Clamd.

  2. Enable antivirus for your File Store (Document Library) by setting the following portal property or Docker environment variable.

    Portal property:

    dl.store.antivirus.enabled=true
    

    Docker environment variable:

    -e LIFERAY_DL_PERIOD_STORE_PERIOD_ANTIVIRUS_PERIOD_ENABLED=true
    
  3. Start your Liferay server.

  4. Go to Control PanelSystem Settings and select Antivirus in the Security category.

  5. Select Antivirus Clamd Scanner in the menu.

    Antivirus Clamd Scanner configuration

  6. Enter the Clamd server’s hostname or IP address, port, and a connection timeout time (milliseconds).

  7. Click Save.

Now files are scanned when uploaded to Liferay applications. If a virus is detected, the scanner reports the infected file and cancels the upload.

Here's the virus detection message.