Add support for inventory vulnerability scans.

This commit is contained in:
Ramon Novoa 2023-09-22 12:32:40 +02:00
parent 1ffebcf49c
commit b31b5df205
1 changed files with 9 additions and 5 deletions

View File

@ -7502,12 +7502,16 @@ sub process_inventory_module_data ($$$$$$$$) {
'INSERT INTO tagente_datos_inventory (id_agent_module_inventory, data, timestamp, utimestamp)
VALUES (?, ?, ?, ?)',
$id_agent_module_inventory, safe_input($data), $timestamp, $utimestamp);
return;
} else {
process_inventory_module_diff($pa_config, safe_input($data),
$inventory_module, $timestamp, $utimestamp, $dbh, $interval);
}
# Vulnerability scan.
my $vulnerability_data = enterprise_hook('process_inventory_vulnerabilities', [$pa_config, $agent->{'os_version'}, $data, $inventory_module, $dbh]);
if (defined($vulnerability_data) && $vulnerability_data ne '') {
process_inventory_module_data ($pa_config, $vulnerability_data, $server_id, $agent_name, 'Vulnerabilities', $interval, $timestamp, $dbh);
}
process_inventory_module_diff($pa_config, safe_input($data),
$inventory_module, $timestamp, $utimestamp, $dbh, $interval);
}
################################################################################