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

SOLR-16796: Add Maven SBOMs via cyclonedx #1203

Merged
merged 10 commits into from
Jun 10, 2024

Conversation

raboof
Copy link
Member

@raboof raboof commented Nov 30, 2022

This draft PR shows one way to generate an SBOM for Solr, mostly for discussion at https://lists.apache.org/thread/j35clzm48s7xxc9671qogzr54bsdj1lz . If we want to take this further I'll create a JIRA issue and fill out the rest of the PR template ;).

(I haven't looked in depth at the quality of the output yet, as at this point I just wanted a starting point for experimenting with VEX)

https://issues.apache.org/jira/browse/SOLR-16796

Description

It would be nice if Solr published an 'SBOM' (Software Bill of Materials) for its artifacts. An SBOM gives an overview of the components included in the artifact, which can be useful for example for scanner software that looks for dependencies with potential security vulnerabilities.

Such consumers of the SBOM should probably combine it with the VEX published for Solr (https://solr.apache.org/security.html#vex) to avoid getting reports for known false positives.

Solution

Introduce the org.cyclonedx.bom plugin which helps with generating SBOM's for the build products.

Checklist

Please review the following and check all that apply:

  • I have reviewed the guidelines for How to Contribute and my code conforms to the standards described there to the best of my ability.
  • I have created a Jira issue and added the issue ID to my pull request title.
  • I have given Solr maintainers access to contribute to my PR branch. (optional but recommended)
  • I have developed this patch against the main branch.
  • I have run ./gradlew check.
  • I have added tests for my changes.
  • I have added documentation for the Reference Guide

build.gradle Outdated Show resolved Hide resolved
@risdenk
Copy link
Contributor

risdenk commented Feb 6, 2023

@raboof I pushed a change to your PR branch that moves the logic to gradle/validation/cyclonedx-bom.gradle to match other build plugins. As far as I can tell this is a decent first step.

@epugh
Copy link
Contributor

epugh commented Apr 30, 2023

@gus-asf you may find this idea interesting ;-)

@HoustonPutman
Copy link
Contributor

We should create a JIRA for this btw.

@raboof raboof force-pushed the gradle-cyclonedx-sbom branch from 7599de8 to 5a6bac6 Compare May 10, 2023 15:26
@raboof raboof changed the title introduce org.cyclonedx.bom gradle plugin SOLR-16796: introduce org.cyclonedx.bom gradle plugin Jan 15, 2024
@raboof
Copy link
Member Author

raboof commented Jan 15, 2024

We should create a JIRA for this btw.

Created https://issues.apache.org/jira/browse/SOLR-16796

There's probably more to improve from here, such as:

.. but this might already be a nice start.

@raboof raboof marked this pull request as ready for review January 15, 2024 15:14
@raboof raboof requested a review from risdenk January 15, 2024 15:14
includeBomSerialNumber = true
}

// Unless explicitly enabled, do not attach owasp to check. It has a large download
Copy link
Contributor

Choose a reason for hiding this comment

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

What does CycloneDX have to do with OWASP? What checking/verification does cyclonedxBom do?

Choose a reason for hiding this comment

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

It helps you to build a bom.xml/json file so you can evaluate that file later on Sonatype Lifecycle and see your app vulnerabilities.

Copy link

github-actions bot commented Apr 2, 2024

This PR had no visible activity in the past 60 days, labeling it as stale. Any new activity will remove the stale label. To attract more reviewers, please tag someone or notify the [email protected] mailing list. Thank you for your contribution!

@github-actions github-actions bot added the stale PR not updated in 60 days label Apr 2, 2024
@janhoy
Copy link
Contributor

janhoy commented Apr 29, 2024

I'm positive to including this as a first step and then proceeding with publishing SBOM as a release artifact as proposed.

@github-actions github-actions bot removed the stale PR not updated in 60 days label May 2, 2024
@HoustonPutman
Copy link
Contributor

Ok, so I've changed this to create and SBOM for each of our maven artifacts, and they are included in what will be uploaded to maven central.

So far there is no solr-wide sbom (for either the full tgz or the slim tgz), but that is kind of a nightmare to do with the cyclonedx gradle plugin. It would be much easier if we could use syft to generate an sbom from the resulting tgz(s). But maybe this is a problem to solve later and we take the first win?

@anshumg
Copy link
Contributor

anshumg commented Jun 5, 2024

Thanks @HoustonPutman . I think this would be a good first step considering we've been stuck with this for a while.

@HoustonPutman HoustonPutman changed the title SOLR-16796: introduce org.cyclonedx.bom gradle plugin SOLR-16796: Add Maven SBOMs via cyclonedx Jun 10, 2024
@HoustonPutman HoustonPutman merged commit a42c605 into apache:main Jun 10, 2024
2 of 3 checks passed
HoustonPutman pushed a commit that referenced this pull request Jun 10, 2024
Co-authored-by: Kevin Risden <[email protected]>
Co-authored-by: Houston Putman <[email protected]>
(cherry picked from commit a42c605)
HoustonPutman added a commit that referenced this pull request Jun 13, 2024
HoustonPutman added a commit that referenced this pull request Jun 13, 2024
HoustonPutman added a commit to HoustonPutman/solr that referenced this pull request Aug 26, 2024
Co-authored-by: Kevin Risden <[email protected]>
Co-authored-by: Houston Putman <[email protected]>
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.

8 participants