-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(Authoring): Run virus scanner on asset upload #191
feat(Authoring): Run virus scanner on asset upload #191
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Functionality seems to work great.
I have two suggestions regarding code:
- Allow users to set CLAMAV_ADDRESS in application.properties. This will allow users to change the address without having to recompile the code.
- Move the
if (clamavClient == null || isScanOk(clamavClient, file)) {
check fromaddAsset()
to theisUserAllowedToUpload()
function. This would simplify theaddAsset()
function and put code that returnsUPLOADING_THIS_FILE_NOT_ALLOWED_MESSAGE
together.
Also clean up code a little. #190
The clamav server address is now specified in the application.properties file. Test these scenarios and make sure everything still works
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
If you pass in a second param to getProperty() that gets used as a default value, can you get rid of the null check and it would behave the same?
String clamavServerAddress = appProperties.getProperty("clamav.server.address", "127.0.0.1");
If there's a default value, then it will always try to make a connection/scan request even if the server admin never intended to install Clam AV. This would be unnecessary processing. |
🎉 This PR is included in version 1.0.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Changes
Run virus scanner on files that are uploaded by an author.
Test
Install and start up Clam AV (you can look at the changes to scripts/beforeInstall.sh and perform the equivalent for your system)
Download mock virus files from https://www.eicar.org/download-anti-malware-testfile/ (if your browser prevents downloading the files, you can try downloading using wget).
Test uploading files on WISE
Closes #190