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

Add support for dependencies and purl for Native Image SBOMs #3399

Merged
merged 1 commit into from
Oct 31, 2024

Conversation

rudsberg
Copy link
Contributor

Description

This PR adds support for the "dependencies" and "purl" fields in SBOMs embedded in Native Images. These fields will be included in SBOMs starting from GraalVM for JDK 24.

Other fixes:

  • Resolves empty package ID warnings by setting the package ID. For example, warnings like the one below were previously emitted for valid SBOM components.
[0000]  WARN found package with empty ID while adding to the collection: Pkg(name="commons-validator" version="1.9.0" type="graalvm-native-image" id="")
  • Added support for including the component listed under metadata/component in "components".
    Note: While such a component ideally belong under metadata/component, the Cataloger interface ([]pkg.Package, []artifact.Relationship, error) does not allow specifying that.

Type of change

  • New feature (non-breaking change which adds functionality)

Checklist:

  • Added unit tests for new behavior
  • Tested common scenarios to prevent regressions
  • Added code comments for complex sections

Copy link
Contributor

@kzantow kzantow left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution, @rudsberg -- overall this looks great, I'm debating whether it's important enough to centralize the CycloneDX -> Syft data model using the format package. I think that would be the only hold up, though

syft/pkg/cataloger/java/graalvm_native_image_cataloger.go Outdated Show resolved Hide resolved
Copy link
Contributor

@kzantow kzantow left a comment

Choose a reason for hiding this comment

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

🎉

@kzantow kzantow merged commit fcf1350 into anchore:main Oct 31, 2024
12 checks passed
@kzantow kzantow added the bug Something isn't working label Nov 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants