-
Notifications
You must be signed in to change notification settings - Fork 1
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
CVE de-duplication in VEX causes loss of information #7
Comments
This reverts commit 4dd0573. Fixes: savoirfairelinux#7 Signed-off-by: Jasper Orschulko <jasper@fancydomain.eu>
Hi, I see, this seem legit. I will look at that this afternoon |
deduplication was causing information loss when same vulns was reported by differents recipes with different status. More details issue #7
resolved when merging #8 |
This reverts commit 4dd0573. Fixes: savoirfairelinux#7 Signed-off-by: Jasper Orschulko <jasper@fancydomain.eu>
Hi @Jasper-Ben ! |
Hi @groetingc, technically that is possible, but it would probably require some major refactoring of the current code. The way meta-cyclonedx currently works is that is simply "extends" all .bb files with the content of the bbclass, writing the cyclonedx output directly to the deploy directory. That means that whenever any .bb file is used in the build process the cyclonedx tasks are run, regardless of whether the build output ends up in the image. Unfortunately, the way that scoping works in Yocto, there is no way to know whether the output ends up in the image at the point in time when the tasks for an individual recipe are run. Only once the rootfs is put together you can actually figure it out using the That's why the function in ROOTFS_POSTPROCESS_COMMAND:prepend = "${@'cve_check_write_rootfs_manifest; ' if d.getVar('CVE_CHECK_CREATE_MANIFEST') == '1' else ''}" So to achieve this, the code becomes a bit more complex. Before:
After:
|
IMO writing the cyclonedx output directly in the deploy directory while the process is still running is kind of bad practice anyways, as it will leave you with an incomplete sbom file in the deploy directly if the build is cancelled prematurely. Writing the SBOM data for the individual recipes into temporary files and then just combining them together after the build is complete would be the cleaner solution, so I was already thinking about changing this. In that case we could probably put the limitation to installed packages behind a feature flag. |
@groetingc I created a seperate issue to keep track of this: #9 Feel free to give this a shot. If not, I will probably address this at some point but I cannot exactly say when. |
deduplication was causing information loss when same vulns was reported by differents recipes with different status. More details issue #7
deduplication was causing information loss when same vulns was reported by differents recipes with different status. More details issue #7
Hi @loulou123546, I was looking at your commit 4dd0573 again and I noticed that this causes information loss:
However, the analysis state is stored for each CVE entry, e.g.:
Thus, a de-duplication here will cause multiple components with different analysis states to be thrown together into a single CVE entry, thus losing the actual analysis state of the CVE within any package following the first occurrence.
The problem gets more obvious when looking at my PR in which I additionally provide
analysis.detail
, which can differ from package to package:https://github.com/savoirfairelinux/meta-cyclonedx/pull/6/files#diff-a4ee7e0998b61bc3346a018617dce8ea248d8f0cefe23140ad613469ced57082R195-R197
Which makes sense: The reason to ignore CVE-X in package Y might differ from why it is ignored in package Z. Thus, it really only makes sense to have separate CVE entries per package.
I think what caused a lot of confusion on this (at least on my part) is an unfortunate formulation in the CycloneDX json schema.
Here it says for the description of the
id
field:Which I understood to mean that the
id
entry needs to be unique. But if you actually look at the json schema definition, theid
field is not set to unique (aka missing a"uniqueItems": true
):https://github.com/CycloneDX/cyclonedx-go/blob/6f53207eded10e9e2a362772b253621840e7ad94/schema/bom-1.4.schema.json#L1435-L1444
So what the description actually means is that from the provided
id
value the vulnerability must be uniquely identifiable (i.e. in the NIST DB), NOT that the entry needs to be unique.I would therefore suggest that we revert 4dd0573.
The text was updated successfully, but these errors were encountered: