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 SBOM and related checks to project #140

Merged
merged 15 commits into from
Nov 7, 2024
Merged

Conversation

d33bs
Copy link
Member

@d33bs d33bs commented Nov 4, 2024

Description

This PR adds a software bill of materials (SBOM) to the project using the SPDX convention. It also adds a pre-commit based check to ensure the packages section of the SBOM is up to date with any changes which have occurred in the source which could be reflected as a difference in the SBOM (meaning the SBOM will stay up to date so long as checks are passing).

SBOM's are increasingly becoming commonplace to include within software projects and the use is also listed in RSMM framework (https://arxiv.org/pdf/2406.01788) under focus area 4 software adoptability, section 4.6 deployability as "the project has an SBOM".

This change is a first step towards following the convention and then checking for this convention in other work through the Almanack.

Closes #139

What is the nature of your change?

  • Content additions or updates (adds or updates content)
  • Bug fix (fixes an issue).
  • Enhancement (adds functionality).
  • Breaking change (these changes would cause existing functionality to not work as expected).

Checklist

Please ensure that all boxes are checked before indicating that this pull request is ready for review.

  • I have read the CONTRIBUTING.md guidelines.
  • My code follows the style guidelines of this project.
  • I have performed a self-review of my own contributions.
  • I have commented my content, particularly in hard-to-understand areas.
  • I have made corresponding changes to related documentation (outside of book content).
  • My changes generate no new warnings.
  • New and existing tests pass locally with my changes.
  • I have added tests that prove my additions are effective or that my feature works.
  • I have deleted all non-relevant text in this pull request template.

@d33bs d33bs marked this pull request as ready for review November 4, 2024 15:07
Copy link
Member

@gwaybio gwaybio left a comment

Choose a reason for hiding this comment

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

Is there a place to describe what these checks actually are? (sorry if i missed this)

@d33bs
Copy link
Member Author

d33bs commented Nov 5, 2024

Thanks @gwaybio - I added some comments to help better describe the check for the SBOM. All changes here pertain to the Almanack repo itself; we're adding an sbom.json file and a pre-commit check which makes sure this file is up to date. The pre-commit check uses a poethepoet shell script to ensure the diff is inconsequential (the date and checksum will differ slightly from file to file based on how they're generated but we don't need to update if the dependencies haven't changed). We use syft to help generate the SPDX-style SBOM. We use a newly added dev dependency sbomdiff to help with this diffing and to avoid more complicated solutions.

Eventually my hope would be to check for these files in other repos and make this a metric for the Almanack. The changes here were complex enough that I felt they should be standalone before an external-facing metric would be developed.

@d33bs d33bs requested a review from gwaybio November 5, 2024 15:13
Copy link
Contributor

@falquaddoomi falquaddoomi left a comment

Choose a reason for hiding this comment

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

Neat; I wasn't aware that there were formal formats for SBOMs, so thanks for the opportunity to learn. I left a minor comment, but otherwise this all looks reasonable to me.

pyproject.toml Show resolved Hide resolved
@d33bs
Copy link
Member Author

d33bs commented Nov 7, 2024

Thanks @falquaddoomi and @gwaybio for the reviews! Merging this in.

@d33bs d33bs merged commit a71cbd9 into software-gardening:main Nov 7, 2024
11 checks passed
@d33bs d33bs deleted the add-sbom branch November 7, 2024 15:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add software bill of materials (SBOM) to the project
3 participants