Skip to content
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

feat: support for external components with version-ranges #586

Open
wants to merge 22 commits into
base: 1.7-dev
Choose a base branch
from

Conversation

jkowalleck
Copy link
Member

@jkowalleck jkowalleck commented Feb 4, 2025

As discussed in ticket #321, this PR adds the following abilities:

  • mark components as external

    Determine whether this component is external.
    An external component is one that is not part of an assembly, but is expected to be provided by the environment, regardless of the component's @scope. This setting can be useful for distinguishing which components are bundled with the product and which can be relied upon to be present in the deployment environment.
    This may be set to true for runtime components only. For /metadata/component, it must be set to false.

  • external components may have version-ranges instead of a specific version

    For an external component, this specifies the accepted version range.
    The value must adhere to the Package URL Version Range syntax (vers), as defined at https://github.com/package-url/purl-spec/blob/master/VERSION-RANGE-SPEC.rst.
    May only be used if .isExternal is set to true.
    Must be used exclusively, either 'version' or 'versionRange', but not both.

fixes #321


Note

this one supersedes #326 <-- read there for more background and previous discussions

implementing with components, because the objects referenced/required are actually used at runtime and therefore are considered a "component".

Sketch/proposal for #321 -- WORK IN PROGRESS

  • sketch JSON schema
    • properties and assert
    • test cases
  • sketch XML schema
    • elements & attributes.
      no asserts - this would require XSD1.1 which is not broadly implemented, yet.
    • test cases
  • sketch ProtoBuff schema
    • fields
    • test cases

ALL FEEDBACK IS WELCOME! Yes, everything.
but some might not be resolved in this very PR, but in the authoritative guides. See #586 (comment)

@jkowalleck jkowalleck requested a review from a team as a code owner February 4, 2025 19:59
@jkowalleck jkowalleck marked this pull request as draft February 4, 2025 19:59
@jkowalleck jkowalleck changed the base branch from master to 1.7-dev February 4, 2025 19:59
@jkowalleck jkowalleck added this to the 1.7 milestone Feb 4, 2025
schema/bom-1.7.schema.json Show resolved Hide resolved
schema/bom-1.7.xsd Outdated Show resolved Hide resolved
Copy link

@ppkarwasz ppkarwasz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, although I think we should clarify better, when isExtraneous is used.

For example I don't think isExtraneous makes sense in $.metadata.component even if versionRange is used.
Also, in a CycloneDX VDR/VEX document, isExtraneous does not make sense.

schema/bom-1.7.schema.json Outdated Show resolved Hide resolved
schema/bom-1.7.xsd Outdated Show resolved Hide resolved
Signed-off-by: Jan Kowalleck <[email protected]>
Signed-off-by: Jan Kowalleck <[email protected]>
Signed-off-by: Jan Kowalleck <[email protected]>
Signed-off-by: Jan Kowalleck <[email protected]>
@jkowalleck jkowalleck force-pushed the feat/extraneous-component branch from 3e1eb53 to 7a52828 Compare February 5, 2025 13:57
jkowalleck and others added 5 commits February 5, 2025 14:58
Co-authored-by: Piotr P. Karwasz <[email protected]>
Signed-off-by: Jan Kowalleck <[email protected]>
Signed-off-by: Jan Kowalleck <[email protected]>
Signed-off-by: Jan Kowalleck <[email protected]>
Signed-off-by: Jan Kowalleck <[email protected]>
Signed-off-by: Jan Kowalleck <[email protected]>
@raboof
Copy link

raboof commented Feb 6, 2025

This is great!

I guess it would be good to make explicit that you should not include hashes for extraneous components? Also, since different versions may have different transitive dependencies, does that mean no transitive dependencies should be listed for extraneous components? Or is it OK to keep listing those (as long as they're also marked extraneous) and leave it up to the downstream consumer of the sbom to drop no-longer-relevant extraneous components as needed?

Signed-off-by: Jan Kowalleck <[email protected]>
Signed-off-by: Jan Kowalleck <[email protected]>
@ppkarwasz
Copy link

Also, since different versions may have different transitive dependencies, does that mean no transitive dependencies should be listed for extraneous components? Or is it OK to keep listing those (as long as they're also marked extraneous) and leave it up to the downstream consumer of the sbom to drop no-longer-relevant extraneous components as needed?

I thought about dropping transitive dependencies too, but some usages require to have at least a draft of what transitive dependencies could appear.

For example we could link a CycloneDX SBOM to a CycloneDX VEX. In order to know, which CVEs published by dependencies will be analyzed in the VEX, we need to provide an approximate list of transitive dependencies. While commercial manufacturers might be required to answer questions like "Is my Java application vulnerable to this Go CVE", OSS projects will certainly not answer questions beyond the dependencies listed in the SBOM.

Signed-off-by: Jan Kowalleck <[email protected]>
Signed-off-by: Jan Kowalleck <[email protected]>
@jkowalleck
Copy link
Member Author

jkowalleck commented Feb 6, 2025

regarding transitive dependencies, hashes and such.

nope. hashes CAN be used, even for extraneous dependencies.
Imagine the following: you need a specific version of a dependency provided. Of course you may add hashes for that version.
Regarding transitive dependencies, you CAN omit them.

all is a MAY/CAN -- not a MUST.

Signed-off-by: Jan Kowalleck <[email protected]>
Signed-off-by: Jan Kowalleck <[email protected]>
schema/bom-1.7.schema.json Outdated Show resolved Hide resolved
@jkowalleck
Copy link
Member Author

jkowalleck commented Feb 6, 2025

thank you all for the early review and the interesting questions and remarks. 👍

If they were technical, then they are about to be addressed in this PR.
If they were use-case related, they may be addressed in CycloneDX/guides#29. Remember: CycloneDX is a document standard, the individual best practices and alike are addressed in the authoritative guides.

more questions and remarks are very welcome - better here in the PR or in the issue #321 than else where.

schema/bom-1.7.proto Outdated Show resolved Hide resolved
schema/bom-1.7.xsd Outdated Show resolved Hide resolved
@jkowalleck jkowalleck changed the title [WIP] feat: extraneous components [WIP] feat: external components Feb 8, 2025
@jkowalleck jkowalleck force-pushed the feat/extraneous-component branch from 80de26a to 24b028d Compare February 8, 2025 12:08
@jkowalleck jkowalleck force-pushed the feat/extraneous-component branch from 24b028d to 345c32c Compare February 8, 2025 12:49
@jkowalleck jkowalleck force-pushed the feat/extraneous-component branch from 345c32c to 21f8f42 Compare February 8, 2025 12:59
@jkowalleck
Copy link
Member Author

for the record:

I found that the word "external" is better fitting for what this is all about.
("extraneous" seams to have a second/alternative meaning that i was not aware of, when i write tis ticket originally.)

therefore, I propose to use "external". adapted in this PR

Signed-off-by: Jan Kowalleck <[email protected]>
@jkowalleck jkowalleck marked this pull request as ready for review February 8, 2025 13:59
@jkowalleck jkowalleck changed the title [WIP] feat: external components feat: external components Feb 8, 2025
@jkowalleck
Copy link
Member Author

jkowalleck commented Feb 8, 2025

refined the wordings based on your feedback.
revisited all changes and test cases.
I think this one is out of the WIP phase :) ready for review

@jkowalleck jkowalleck changed the title feat: external components feat: support for marking components as external Feb 8, 2025
@jkowalleck jkowalleck changed the title feat: support for marking components as external feat: support for external components with version-ranges Feb 8, 2025
@jkowalleck jkowalleck requested a review from mrutkows February 9, 2025 09:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature: documenting external/extraneous dependencies
3 participants