[VS] Fix discrepancies check. (#8066)

This commit is contained in:
Nicolo Maio 2023-11-30 09:58:04 +01:00
parent a5a2146cfb
commit ffdff17ebd
3 changed files with 18 additions and 5 deletions

View file

@ -1231,7 +1231,10 @@ function vs_utils.save_host_to_scan(scan_type, host, scan_result, last_scan_time
end
local host_info_differences
if trigger_alert and old_data and (not is_edit) then
if trigger_alert and old_data and (not is_edit) and
-- old scan and new scan must be successfully to perform discrepancies check
(old_data.is_ok_last_scan == vs_utils.scan_status.ok and new_item.is_ok_last_scan == vs_utils.scan_status.ok)
then
local already_scanned = (old_data.last_scan and old_data.last_scan.epoch)
if already_scanned then