How to override ClamAV antivirus settings in Liferay PaaS

Note: please note that Liferay has renamed its Liferay Experience Could offerings to Liferay SaaS (formerly LXC) and Liferay PaaS (formerly LXC-SM).

Issue

  • The default ClamAV settings such as MaxFileSize, MaxScanSize and StreamMaxLength may not be sufficient if the DAM is used to store large files, causing errors on file upload.
  • These settings are not configurable e.g. with Environment Variables when using the official ClamAV image.

Environment

  • Liferay PaaS with custom ClamAV antivirus service.

Resolution

  1. Update the existing antivirus service LCP.json, remove the image field and save.
  2. Create a file called 'Dockerfile' in the existing antivirus service folder, paste the text from the attached Dockerfile, and update the max values (i.e. the 750M values within the sed commands) as required.
  3. Follow the same approach to update additional values where the first part of the sed command is the original commented or uncommented value from the default clamd.conf e.g. #MaxFileSize 400M and the second part is the replacement e.g. MaxFileSize 750M
  4. Update the from command tag value if required.
  5. Save the updated Dockerfile.
  6. Deploy the newly created build that contains the changes above to the target environment and verify that the antivirus service starts as expected.
  7. Test that files of the expected file size can be uploaded successfully and review the Liferay DXP service logs etc.

Additional Information

  • See here for steps to enable ClamAV antivirus in Liferay PaaS

NOTE: Liferay Support does not recommend or endorse specific third-party products over others. The information provided about products not created by Liferay is for reference purposes only, and any implementation of these principles will be at your team's discretion.

¿Fue útil este artículo?
Usuarios a los que les pareció útil: 0 de 0