xwikisas / application-antivirus

Keeps your XWiki instance safe by scanning file attachments for viruses or malware.
GNU Lesser General Public License v2.1
0 stars 1 forks source link

Log incidents as soon as they happen during a running scan process #28

Open AndreeaChi opened 3 years ago

AndreeaChi commented 3 years ago

In the current state the incidents are logged at the end of the scanning. As the scan job can take even 20h to complete, it makes it vulnerable to several issues, such as not sending the report if the wiki server restarts during the scan process.

A proposal would be to make sure that incidents are logged as soon as they happen, since right now they are logged at the end of scanning, after the report was sent (https://github.com/xwikisas/application-antivirus/blob/master/application-antivirus-api/src/main/java/com/xwiki/antivirus/internal/AntivirusJob.java#L127-L129).

Incidents are individual and can be logged individually, as opposed to the report which needs to be sent only once, at the end (to avoid spam).