Skip to content

Commit

Permalink
Fixup! Perf. on /vulnerabilities endpoint.
Browse files Browse the repository at this point in the history
  • Loading branch information
csavelief committed Sep 12, 2024
1 parent 09d07a3 commit 387f99d
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public function getVulnerabilitiesWithAssetInfo(?int $attackerId = null): array
->join('scans', 'scans.id', '=', 'ports.scan_id')
->join('assets', 'assets.cur_scan_id', '=', 'scans.ports_scan_id')
->get()
->filter(fn(Alert $alert) => !$attackerId || !$alert->cve_id || $alert->events($attackerId)->exists())
->filter(fn(Alert $alert) => !$attackerId || ($alert->cve_id && $alert->events($attackerId)->exists()))
->map(function (Alert $alert) use ($attackerId) {
return [
'alert' => $alert,
Expand Down

0 comments on commit 387f99d

Please sign in to comment.