-
Notifications
You must be signed in to change notification settings - Fork 571
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
SBOMs are not the same on multiple runs of syft #1944
Comments
Thanks for filing the issue @tomersein - let me try and reproduce on my end and I'll write up what I think could be the issue here |
hi, were you able to reproduce? @spiffcs |
👋 hi @tomerse-sg - I saw the difference in the PURL that you had mentioned in the output files on Slack, however when building the image locally using the provided
Dockerfile downloaded - built
Generate json sbom
convert to cyclonedx
Screenshot of same PURL (top cyclonedx bottom original json output) Was there a reproduction step I might have missed here? I never saw the |
Can you copy paste the exact syft commands you're referring to that produced the above output? It might help me find the path you're going down =) Do you see no issue if you use something like |
➜ compare-convert syft war -o cyclonedx-json &> cyclone-war.json |
@tomerse-sg - I reproduced this yesterday thanks to your commands - I was pulled into a quick other thing but am now taking a look again at what a fix looks like for this |
can you share what is the root cause? just curious since I don't see any differences in the flow |
I'm still trying to find the root cause - when I ran the commands on Friday I was able to reproduce the PURL diff for the The other diffs I'm not concerned about as those are values that will change for newly generated documents. I tried to run this again this morning through my debugger and am getting equal PURL strings for the commands supplied above.
The original difference in our flows was that I was comparing the PURL from In the flow provided by @tomerse-sg a cyclonedx document was generated by syft as the original comparison. This would lead to exploring if the PURL generation went through different paths when doing convert vs doing the original document. Are you using syft Update: There is definitely some non deterministic behavior here which is causing the confusion. The good news is that I've been able to reproduce the diff without doing the
Different PURL for the same package here across formats is not what we want. Getting closer to the root cause, it looks like there are java packages (in this case Thanks for all the information and for filing the issue! Non deterministic behavior is being seen in v0.85.0 and is not specific to a package |
It looks like this is either related to, or a duplicate of: #1464 |
Quick update on this one - I've fixed the PURL/GroupID association to be deterministic across package generation: The final thing being looked at is when we add For the one of the above cases we've found that it can be matched on one of the following:
The bundle license value for the manifest is Basically the update here consists of making the archive parser a bit smarter so that rather than selecting at random from multiple glob matches, we're putting the correct properties/manifest together for a single package. Here is the uniqueness check that's causing packages to be merged: syft/syft/pkg/cataloger/java/archive_parser.go Lines 452 to 463 in 4ae94c3
|
@tomersein as of the latest release of syft we should be deterministically generating the PURL and generating a package for both orgs given your example. If this is not the case let me know and I will reopen the issue. |
What happened:
I did some tests to the convert endpoint in order to check results are the same -
1st output:
2nd output:
I compared the results and saw a difference in the purl line:
What you expected to happen:
same output
Steps to reproduce the issue:
I've attached the .war file to the slack channel since I can't put it here.
here is the link to the slack thread in order to reproduce:
https://anchorecommunity.slack.com/archives/C019BUXV7R6/p1689149422624669
Anything else we need to know?:
Environment:
syft version
: 0.84.1cat /etc/os-release
or similar): alpineThe text was updated successfully, but these errors were encountered: