-
-
Notifications
You must be signed in to change notification settings - Fork 86
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
Generated bom is invalid #579
Comments
we need to share a reproducer to analyze together: do you have a basic project to simply build, for example on a personal GH Git repo? I don't have time to create a pom.xml from instructions, only build from an existing content |
does this help? |
yes, it helps: I can reproduce and look more in depth
looking at cited line number 2636 and position 443, I find but on this one, I would not say the generated SBOM is invalid
I started to read the issues reported and compared to what is in the json documentation https://cyclonedx.org/docs/1.5/json/#metadata_lifecycles_items_oneOf_i0_phase all the issues I read from My overall conclusion: do you agree on that, when you read the validation output and look at the SBOMs that the tool read? |
I'll be honest here that I never had to deal with SBOM before as I was mostly dealing with saas. Now I'm dealing with a corporate b2b and suddenly this is important. But I do not have the necessary knowledge/experience to declare with certainty that the sbom is valid. To me, all the errors from the validator seems minor and some sort of implementation deviating slightly from the spec issue; either on maven plugin part or the validator part. Do you think I should raise an issue on validator's issue tracker? btw, while i have your attention, can you tell me why the generated bom has |
Since the schema and bom looks "fine" but the validator doesn't make any sense... I tried the following:
So without any deep sbom knowledge, from the simple json validation perspective, validator seems to be wrong, to me at least. |
@crimsonvspurple Could you please also attach the json SBOM to your example? My guess is that the root cause is at the same location as in the xml file:
i.e. this is not a valid url. I also only recently noticed that JsonSchema.Net (which is used by the cyclonedx-cli) generates very verbose validation messages. This is particularly true if you have conditional subschemas by the use of anyOf, oneOf, etc. Then, the cli currently reports the validation messages for all case distinctions, compare also: I have tried to prune out misleading validation message in this PR: In any case, the CycloneDX specification enforces that urls are iri-reference values, thus if you enter an invalid url this will result in an invalid BOM. I tend to think that it would be the responsibility of the BOM generator package to validate that it is a proper url and otherwise maybe skip it and issue a warning. |
@andreas-hilti I have updated the repo with bom and new results from 0.27.2 cli.
The issue seems to be coming from here. Who do knock about a fix? Maven plugin to use project.url instead of project.scm.url? or json-schema-validator to update the pom? |
external references extracted by the CycloneDX Maven Plugin from POM are described here: https://cyclonedx.github.io/cyclonedx-maven-plugin/external-references.html is the issue in the SBOM happening with |
oh now I see: I see it has been done, probably as a consequence of the current discussion networknt/json-schema-validator#1131 thank you @rpoet-jh :) |
notice that:
|
So there were three issues:
@hboutemy can you please shed some light on this issue? Really appreciate everyone being so helpful around here :) |
2.9.1 release just done, you can test if it works around the issue in jcip pom |
Seems like there are two jcip packages, the original one from 2006 has no pom file at all. I'll test and update you |
I did a test and didn't seem to help. I posted on #573 |
Everything mentioned here seems to be fixed now. Thank you all. |
In build:
In deps:
makeAggregateBom
:cyclonedx-win-x64.exe validate --input-file bom.xml --input-version v1_5 --fail-on-errors
cyclonedx-win-x64.exe validate --input-file bom.json --input-version v1_5 --fail-on-errors
and 100s of more validation fails.
Can someone tell me what am I doing wrong?
The text was updated successfully, but these errors were encountered: