Aligning SUSE & OpenSUSE identifiers with /etc/os-release values #7955
Closed
josegomezr
started this conversation in
Ideas
Replies: 2 comments 4 replies
-
proposed change would be fine for me. |
Beta Was this translation helpful? Give feedback.
4 replies
-
Opened #7971 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Description
A little bit of a follow-up of #7620
I started looking into how SUSE gets recognized in SBOM's and noticed that our SBOMs are not detected by trivy.
I try adding support for our SBOM generation tool describing the OperatingSystem (as suggested in #7620) into the SPDX report.
However I encounter a little bit of a wall, reports can be read by trivy but it doesn't understand what OS that is.
@msmeissn pointed me to what seems to be the culprit:
trivy/pkg/fanal/types/const.go
Line 41 in efdb68d
For trivy SUSE systems are called
suse linux enterprise {micro|server}
rather than the short namesle{s|m}
.When
trivy
is the creator of the SBOM report, it writes the long sentence and when it consumes it it matches as expected.However when consuming SBOM's it expects such sentence to be the OS name. That wouldn't be a problem if that sentence would be available in the rootfs when we're running 😅, so far I can confirm that
/etc/os-release
is a reliable source of intel, and there what's available is the short names likesle{s|m}
.Trivy logs then something like:
And for openSUSE Leap & Tumbleweed a similar issue happens. For trivy they're known as
opensuse.{leap|tumbleweed}
however the/etc/os-release
hasID="opensuse-{leap|tumbleweed}"
(notice the dash instead of dot).I have a small PoC in my personal fork aligning such identifiers (haven't run the tests yet) and it seems that by changing the const in fanal/types/const.go to the ID we can align detection for all tools.
https://github.com/aquasecurity/trivy/compare/main...josegomezr:trivy:main?expand=1
When aligning the ids trivy then reports:
What do y'all think?
Target
SBOM
Scanner
Vulnerability
Beta Was this translation helpful? Give feedback.
All reactions