We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Version : server OCS Reports 2.12.0
Matching CVEs with software inventory behaves differently according to the number of regexes defined.
Defining the following single regex...:
... will match apr (as in Apache APR) software name and associate HAProxy CVEs to machines whose software inventory contains Apache APR.
apr
Now if we define these two regexes:
Then HAProxy CVEs won't be associated to Apache APR anymore.
It seems this problem comes from this test in cve.php. I dont understand the logic or necessity of this test coming from #1137 by @charleneauger
cve.php
In the first scenario wildcards will be ignored because stringMatchWithWildcard isn't called.
stringMatchWithWildcard
Correct CPEs <> CVEs matching regardless of the number of regexes defined.
The text was updated successfully, but these errors were encountered:
The following diff seems to fix the matching in the first scenario:
--- a/require/cve/Cve.php +++ b/require/cve/Cve.php @@ -268,8 +268,13 @@ private function match($values) { if(!empty($regs)) { foreach($regs as $key => $reg) { - if(count($regs) == 1) { - $reg_publish = true; - $reg_name = true; - } else { - $reg_publish = $this->stringMatchWithWildcard(trim($values['VENDOR']), $reg['NAME_REG']); - $reg_name = $this->stringMatchWithWildcard(trim($values['NAME']), $reg['NAME_REG']); - } + $reg_publish = $this->stringMatchWithWildcard(trim($values['VENDOR']), $reg['NAME_REG']); + $reg_name = $this->stringMatchWithWildcard(trim($values['NAME']), $reg['NAME_REG']); if($reg_name || $reg_publish) { if($reg['NAME_RESULT'] != "") {
But it may not be the correct approach.
PS : pas de problème pour échanger en français si vous le souhaitez :)
Sorry, something went wrong.
Bonjour @c0bw3b ,
Merci pour votre retour. Nous allons regarder ça de plus près et voir pour proposer un correctif/amélioration prochainement.
Je vous tiendrai au courant de lorsque ça sera disponible :)
Cordialement, Charlène
gillesdubois
damienbelliard
RudyLaurent
charleneauger
Successfully merging a pull request may close this issue.
OCS Inventory version
Version : server OCS Reports 2.12.0
Describe the bug
Matching CVEs with software inventory behaves differently according to the number of regexes defined.
To Reproduce
Defining the following single regex...:
... will match
apr
(as in Apache APR) software name and associate HAProxy CVEs to machines whose software inventory contains Apache APR.Now if we define these two regexes:
Then HAProxy CVEs won't be associated to Apache APR anymore.
It seems this problem comes from this test in
cve.php
.I dont understand the logic or necessity of this test coming from #1137 by @charleneauger
In the first scenario wildcards will be ignored because
stringMatchWithWildcard
isn't called.Expected behavior
Correct CPEs <> CVEs matching regardless of the number of regexes defined.
The text was updated successfully, but these errors were encountered: