Storage
Antivirus
Learn how to integrate with ClamAV
Integration with clamav antivirus relies on an external clamd service. When a file is uploaded hasura-storage
will create the file metadata first and then check if the file is clean with clamd
via its TCP socket. If the file is clean the rest of the process will continue as usual. If a virus is found details about the virus will be added to the virus
table and the rest of the process will be aborted.
To enable the antivirus you need to follow the next steps:
- Deploy using Nhost Run a dedicated instance of
clamd
with this one-click install link. - Select the project:
- Click on “Create”:
- Make sure you are running at least storage version 0.4.0 and enable the antivirus:
- Wait for the service to update and try to upload a sample virus file like eicar
- If the setup is working the upload should fail
- You can also head to hasura and verify entries were added to the
virus
table:
That entry should have useful information about like the filename, the virus found and the user session. In addition, the information on that table can be used a source for events.