Skip to content

Commit

Permalink
Fix: Apply exclude_hosts of target in CVE scans
Browse files Browse the repository at this point in the history
CVE scans now exclude IP addresses specified in the exclude_hosts of the
task target.

This makes the behavior consistent with normal OpenVAS scans.
  • Loading branch information
timopollmeier committed Mar 8, 2024
1 parent ddd1430 commit f660381
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/manage.c
Original file line number Diff line number Diff line change
Expand Up @@ -3167,7 +3167,7 @@ static int
fork_cve_scan_handler (task_t task, target_t target)
{
int pid;
char *report_id, *hosts;
char *report_id, *hosts, *exclude_hosts;
gvm_hosts_t *gvm_hosts;
gvm_host_t *gvm_host;

Expand Down Expand Up @@ -3234,14 +3234,20 @@ fork_cve_scan_handler (task_t task, target_t target)
exit (1);
}

exclude_hosts = target_exclude_hosts (target);

reset_task (task);
set_task_start_time_epoch (task, time (NULL));
set_scan_start_time_epoch (global_current_report, time (NULL));

/* Add the results. */

gvm_hosts = gvm_hosts_new (hosts);
gvm_hosts_exclude (gvm_hosts, exclude_hosts ?: "");

free (hosts);
free (exclude_hosts);

while ((gvm_host = gvm_hosts_next (gvm_hosts)))
if (cve_scan_host (task, global_current_report, gvm_host))
{
Expand Down

0 comments on commit f660381

Please sign in to comment.