From 06ad4377c62478d7fd1c4b8773d561224a1485b6 Mon Sep 17 00:00:00 2001 From: didier Date: Fri, 22 Nov 2024 18:27:51 +0100 Subject: [PATCH] work on CVE search --- app/Console/Commands/CVESearch.php | 24 +++++------------------- 1 file changed, 5 insertions(+), 19 deletions(-) diff --git a/app/Console/Commands/CVESearch.php b/app/Console/Commands/CVESearch.php index ecae3377..9249c372 100644 --- a/app/Console/Commands/CVESearch.php +++ b/app/Console/Commands/CVESearch.php @@ -55,9 +55,9 @@ public function handle() $check_frequency = config('mercator-config.cve.check-frequency'); // update provider - if ($provider === 'https//cve.circl.lu') { + if (($provider == 'https://cvepremium.circl.lu')||($provider === 'https//cve.circl.lu')) { // change variable - $provider = 'https://cvepremium.circl.lu'; + $provider = 'https://vulnerability.circl.lu';; config(['mercator-config.cve.provider' => $provider]); // Save configuration @@ -156,9 +156,9 @@ public function handle() // loop on all CVE foreach ($json as $cve) { - // check CVE in frequency range -#print_r("------------------------------\n"); +#print_r("-----------------------------------------------------\n"); #print_r($cve); + // check CVE in frequency range if (property_exists($cve,"dataType") && $cve->dataType=="CVE_RECORD") { if (strtotime($cve->cveMetadata->datePublished)>= $min_timestamp) { // put summary in lowercase @@ -189,22 +189,8 @@ public function handle() } else { Log::error("Unknown CVE format !"); - Log::error($cve); - } - /* - elseif (strtotime($cve->document->tracking->current_release_date) >= $min_timestamp) { - // put summary in lowercase - $text= strtolower($cve->document->title); - // Log::debug('CVESearch - CVE summary ' . $cve->summary); - foreach ($names as $name) { - // Log::debug('CVESearch - check ' . $name); - if (str_contains($tex, $name)) { - $message .= '' . $cve->application . ' : ' . $cve->id . ' - ' . $cve->document->title . '
'; - $found=true; - } - } + Log::error(json_encode($cve)); } - */ } $message .= '';