Comments (6)
I suppose Trivy does not check the spec version
Likely a bug in Trivy then.
All CycloneDX versions are backward compatible. In this case, the legacy bom->metadata->tools
continue to work just fine in v1.5. in fact, we have hundreds of test cases for this very reason.
For example, these two JSON test cases pass validation, and the deprecated one continues to validation in previous versions of CycloneDX, thus ensuring backward-compatibility.
However, CycloneDX is not forward-compatible, meaning that parsing logic only tested for version x
, may not continue to work when supporting version y.
In order for a tool to support version y
, the tool may need to be updated (including parsing logic) to support more recent versions. This is a forward-compatibility issue, not a backward-compatibility one. I'm not aware of any specification that guarantees forward-compatibility.
from specification.
@dn-scribe ,
Could you explain what the specific backwards-incompatibility you are referring to?
I mean, every valid CycloneDX JSON document MUST include a specVersion
-- trivy could just have implemented a proper check for this, and do the correct deseserialization based on that value, but they decided to not do it...
In terms of a document standard, we do not talk about specific implementations, but about the actual documents.
In these terms, for example, it is expected that CycloneDX 1.2 document is also a valid CycloneDX 1.3 document.
Not the other way around, nor that implementors do not need to do their job right. ;-)
from specification.
Although this deserves fixing Trivy, Trivy could work on both cycloneDX 1.4 and 1.5 had this change not been introduced in this way.
Looks like trivy does not support all features of CycloneDX 1.5 -- so I'd disagree ;-)
But anyway, could you provide an example data set, how this would have been possible, in your opinion?
from specification.
see also: aquasecurity/trivy#5976
from specification.
What I mean by backward compatible: I suppose Trivy does not check the spec version, but it was probably tested on some version - I guess 1.4. They assume that future cdx versions will not break the "basic" use of cdx - to describe software components (Trivy does not care about objects of type data, for example).
Attached is an SBOM generated from syft labeled superset-cdx-original.json
, and a patched version ```superset-cdx-patched.json". On the original - trivy fails, on the patched - it passes (also passes if the specVersion and schema are set to 1.4).
It also passes if I add to the tools an "externalReference" with a bom-link internal to the document (my understanding of the spec is that this is legal):
{
"$schema": "http://cyclonedx.org/schema/bom-1.4.schema.json",
"bomFormat": "CycloneDX",
"specVersion": "1.4",
"serialNumber": "urn:uuid:103c7f88-d7ed-4ab2-bec0-dc7fb3eeb2a6",
"version": 1,
"metadata": {
"timestamp": "2024-01-21T09:20:35+02:00",
"tools": [
{
"vendor": "anchore",
"name": "syft",
"version": "0.100.0",
"externalReferences":[
{
"url": "urn:cdx:uuid:103c7f88-d7ed-4ab2-bec0-dc7fb3eeb2a6/1/some-bom-ref",
"type": "bom"
}
]
}
],
In this way cdx 1.4 could give all the expresiveness of a component to the tools. And when services where added - they would be just another external reference of a tool - the tool section would not need to be updated.
superset-cdx-original.json
superset-cdx-patched.json
from specification.
@stevespringett , what do you think of the suggestion above, that could provide the same values of the new tools
section without any change to CycloneDX1.4 ?
Could it indeed provide the forward-compatibility, that although no one can commit to, but if gained is great?
from specification.
Related Issues (20)
- Show comments of JSON Schema in Documentation HOT 6
- Question about VEX HOT 1
- New field: `component.modelcard.modelType` HOT 4
- Add field for 1.6: Components.modelCard.baseModel HOT 1
- Add field for 1.6: Components.modelCard.parentModel HOT 3
- modelCard Input/output descriptions HOT 1
- Description of `metadata.supplier` is confusing HOT 2
- Should `manufacture` be a property of `component`, rather than `metadata`? HOT 6
- Add clarification on what a list of licenses means HOT 4
- missing documentation for `machineLearningApproachType`
- Deprecate and define EOL/EOS path for XML HOT 8
- Restructure JSON enum documentation
- Unclear definition of serialNumber and version HOT 2
- Additional properties should be set for nuget packages
- Introduce toggle button in Dependency Graph to toggle component scope
- bug: additional properties on `property` type in JSON HOT 5
- typo in CDX 1.6 counterClaim title HOT 2
- document RFC-9116 via CycloneDX
- Clarify whether base64 encoding of license content is really optional HOT 15
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from specification.