-
Notifications
You must be signed in to change notification settings - Fork 572
New issue
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
binary detection: openbsd OpenSSH and portable OpenSSH #3216
Comments
Issue/question: anchore#3216
👋 Thanks for the issue @krysgor and question about classifiers!. I'll point you to a recent PR that just landed that has a few examples in it: Note the classifiers being added here: On the If you wanted two classifiers that resulted in two different packages you would just use a single cpe and do something like:
The other path is to just do this as one classifier with one package where you add multiple CPE at the bottom of that struct. Happy to talk more about this or review some code if you've already written something 👍 |
Issue/question: anchore#3216
Issue/question: anchore#3216
Hi @spiffcs , It ends up being just the detection of the main version (without the portable binary). The reason for ignoring the portable version is that the portable executables have both version identifiers. For example the output of the
So after implementing the two-classifier solution, syft match both classifiers for the portable binary:
The non-portable binary always looks good:
I'm not sure what to do in this situation. But creating an sbom that contains two entries for openssh is (probably) wrong. So I decided to just match the main version of the binary. |
Issue/question: anchore#3216 * Conflicts: * syft/pkg/cataloger/binary/classifiers.go * syft/pkg/cataloger/binary/test-fixtures/config.yaml
agreed -- mind posting the code for the two regexes that were used in the dual-classifier approach? There might be more options, I think you really need one classifier with multiple evidence matchers, see an example here syft/syft/pkg/cataloger/binary/classifiers.go Lines 13 to 22 in d7005d7
This way we would never be finding duplicate packages since there would be one classifier. |
Hi,
(Not sure if i'm right here, because it's a contributor question and i'm not so familiar with go)
I would like to implement openbsd OpenSSH and portable OpenSSH binary detection with correct cpe's in one classifier.
So openbsd have two OpenSSH products with different cpe's:
cpe:2.3:a:openbsd:openssh:9.6:-:*:*:*:*:*:*
cpe:2.3:a:openbsd:openssh:9.6:p1:*:*:*:*:*:*
I alrady have the regex to match the version
\x00OpenSSH_(?P<version>[0-9]+\.[0-9]+)(p[0-9])?\x00
(is also match the optional portablep1
information).The question ist: how can I build this two different cpe in one classifier?
Is it possible to implement this with one classifier? If not I will make simply two classifyers: openssh-binary and openssh-portable-binary.
Thanks
The text was updated successfully, but these errors were encountered: