Change avscanner results priority #1890
Labels
enhancement
New feature or request
good first issue
Good for newcomers
help wanted
Extra attention is needed
javascript
Pull requests that update Javascript code
Currently, when multiple scanners are run against a given file, we get multiple possible results and only one is shown in the preview window. The priority is defined in https://github.com/gchq/Bailo/blob/main/frontend/src/entry/model/releases/FileDownload.tsx#L43-L55. However, if a file >100MB is uploaded then ClamAV will always fail to scan the file (due to a max size limit) and this is shown as higher priority than another scanner e.g. ModelScan finding that the file is infected.
This priority should be reordered to be (highest to lowest):
if file.avScan === undefined
,if threatsFound(file)
,if file.avScan.some((scan) => scan.state === ScanState.Error)
, and finally defaultreturn
value.The text was updated successfully, but these errors were encountered: