Open jkowalleck opened 1 year ago
A PR would be good. Or at a minimum, a prototype on this ticket describing a proposal. FYI, v1.6 has a new top-level element called definitions
which are not included in the inventory of the BOM but can still be referenced. That may be useful here, although there are likely other ways to achieve this as well.
[...] v1.6 has a new top-level element called
definitions
which are not included in the inventory of the BOM but can still be referenced.
Did not find "definitions" in the current (draft) state of 1.6-dev
nor any of (the work-in-progress) branches that eventually will be merged into 1.6-dev
.
As soon as it is there, I will see if it fits the idea. No rush.
[...] although there are likely other ways to achieve this as well.
:+1: I might sketch out possible schema changes and new test cases based on "component". This might not be best solution, but should help visualize the concept.
The definitions
property is here: https://github.com/CycloneDX/specification/blob/1.6-dev-attestations/schema/bom-1.6.schema.json#L473
It currently only consists of standards
, but can (and likely should) be expanded to include additional objects (e.g. licenses, components, services, etc)
re: https://github.com/CycloneDX/specification/issues/321#issuecomment-1763703364
A PR would be good.
here is a sketch: https://github.com/CycloneDX/specification/pull/326
read: https://github.com/CycloneDX/specification/issues/293#issuecomment-1869969390
scope
is a way to include a component but not assert that that component is delivered or included in the inventory. For example, you may want to includeWindows XP Embedded
as a component, mark the scope as excluded, as a way to indicate that the entire stack will include the OS, but that the supplier does not provide it with the software. There is ongoing discussions within CISA on how to specify runtime requirements. Expect this capability to expand in the future.
read: #293 (comment)
scope
is a way to include a component but not assert that that component is delivered or included in the inventory. For example, you may want to includeWindows XP Embedded
as a component, mark the scope as excluded, as a way to indicate that the entire stack will include the OS, but that the supplier does not provide it with the software. There is ongoing discussions within CISA on how to specify runtime requirements. Expect this capability to expand in the future.
Does this invalidate your change request? Sound like scope
was meant exactly as a solution to the depicted problem?
However, scope cannot currently not describe a difference between an extraneous optional and required component.
What about dev dependencies? In the dotnet tool those currently get marked as external. But they are external for a completely different reason. Maybe there should be a better distinction of why a component is external? (because it can be added, because it must be added/be installed on the target system or because it was once used in the production process but is not part of the scope of delivery?)
Dropped this issue/request from the 1.6 milestone goals, and moved it to 1.7 for the following reasons: did not finish in time for 1.6, needs further discussion.
@jerod might have additional ideas how he implemented a process to get around todays limitations ...
@stevespringett proposed to
need to think about all of this. will come back later. :-)
now that the enum cases for scope
are documented, lets rethink possible solutions.
https://github.com/CycloneDX/specification/blob/d6835a98e427215e54168ee5be233c0660ed6a4e/schema/bom-1.6.schema.json#L930-L934
I've seen a need for this when dealing with Java -- you release a jar or war artifact and it defines dependencies. There is no indication on if they're what you say you need or what's packaged within/distributed with what you're describing.
My thoughts:
scope
is ambiguous in that different languages/build tools treat the concept differently, but they all do seem to result into the three distinct dx scope
's abovescope
of it -- mayhaps they are still optional.That being said I am for a provides
-relation instead of any extraneous/intrinsic declaration. The component states what it states, but it does/cannot reflect what the consumer will do with it. If the component is compiled, it seems like it should state the specific version it was compiled with (even if it doesn't provide it). If it's not compiled it seems fair to state what you tested with. Why does it matter if i can use Foo>=1.0
when i tested with 1.0
and when you use me, you provide Foo
? Even if we state Foo>=1.0
its disingenuous to think that 2.0
may cause regressions and not work anyway.
I know there's some edge cases in that maybe I tested with python 3.6, 3.8, and 3.11 -- do i list them all as dependencies? I can't attest 3.9
works, but do i include it anyway?
@DarthHater could you check https://github.com/CycloneDX/specification/issues/321#issuecomment-1992640752 and see how CDX fits in the Java world when it comes to "externals"?
So, with 1.6 out of the way now, I'd like to revisit this. So far scope
doesn't seem to work out and ComponentType "runtime" from #233 doesn't tell whether it's included or not either. @jkowalleck : Following the list you put into cyclonedx-php-composer/#435 I think it comes down to:
and both of these are orthogonal to scope (whether the component is used for runtime or other purposes) and ComponentType.
current state
CycloneDX allows describing components, and the dependency graph. Each component can have exactly one version, no version range. Components can be connected in a dependency graph.
feature
Make it possible to describe external dependencies that are not part of a shipped product, like runtime environments, shared objects and dynamically linked libraries, operating system, hardware (architecture) etc.
use cases
It would enable identifying vendor locks, dependency to outdated external software, and enable DevOps better spec runtime environments.
php-fpm
,php-executable, etc), nor required php-extensions and runtime libraries(libssl
, etc). see the php/composer spec. The SBOM I get handed out with the product should tell which version range of PHP is required to run the software, and which version of required PHP-extensions are required to be installed/enabled. This would help identify risks with the product, that are implied by locks or depending on outdated external software.libSSL
. Therefore,libSSL
is a dependency of my product. For licensing reasons, I ship only my product and none of the dynamically linked dependencies.My SBOM must express these dependencies (name, version-range, distribution-options(download-URL)), so that my clients know what they need to provide, in order to run the software I've shipped.
possible solution
Idea: a new boolean property of
Component
, to indicate the fact that something is not part of the assembly, but needs to be provided. ( "external"? "extraneous"? wording unclear) Alternative: add a new value forComponenScope
. Current values: { "required", "optional", "excluded"} -- see https://github.com/CycloneDX/specification/issues/321#issuecomment-1870321969 :exclamation: see discussion belowadd an optional property to
Component
that allowed documenting a version-range, instead of a disjunctive version. might utilize existing schema definition for "range", which uses the still unfinished purlspec's VERS: https://github.com/package-url/purl-spec/blob/version-range-spec/VERSION-RANGE-SPEC.rstunchanged: allow components to be vendor-less. Some externals need to be able to describe a product-class, instead of an exact product.
document the following, and if possible, then formulate it in schema language:
version
MUST be omitted, if component's is "external"version-range
MUST be omitted, if component's is not "external"might utilize new
ComponentType
"runtime" -- #233Discussion
First of, the goal is to allow describing externals, this is not SBOM in the traditional way, this is about the capability of CycloneDX.
Question: Where to put a marker that signals the fact that something is external?
Is
scope
the best place to put this? No! What if something is eternal and optional at the same time?! So it might be better to have a dedicated marker for that purpose.Question: Which element/object to use? The existing "Component" seams good, but might be just to broad. Maybe use "Definitions"' child element, as soon as it is clear? see https://github.com/CycloneDX/specification/issues/321#issuecomment-1763703364
motivation / need
As requested by the community:
As described by German Cybersecurity Agency BSI
As a solution for the package registries that (are planning to) provide SBOMS for libraries which do not include all their dependencies. These SBOMs pretend/predict the dependencies as "components" but in fact, the components are not packaged with these libraries, but need to be fetched additionally. It these package registries would make unresolved dependencies as "extraneous", that would be great.