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

Record repaired libraries' provenance into wheel with SBOM #541

Open
sethmlarson opened this issue Feb 12, 2025 · 3 comments
Open

Record repaired libraries' provenance into wheel with SBOM #541

sethmlarson opened this issue Feb 12, 2025 · 3 comments

Comments

@sethmlarson
Copy link

Hello! I'm the author of PEP 770 which allows shipping SBOM files inside a Python package archive. PEP 770 is approaching provisional status and adds a new Metadata-Version, so the following work detailed below might take some time before it's usable end-to-end by PyPI and Python package builders.

I propose recording the software ID and provenance for the software libraries that are "repaired" and bundled into Python wheels for manylinux compliance.

Looking at many widely used binary Python packages, auditwheel and the bundling of libraries is quite common! This means there'd be value in recording this information automatically through auditwheel where possible.

This would look like:

  • If the operating system is supported:
  • For each library being repaired:
  • Look up which package provides the package path
  • Record the package name, version, and other identifiers into an SBOM file
  • Add the SBOM file into the Python wheel, adding the Sbom-File field to the Python package metadata.

I've created a rudimentary patch to auditwheel in the past that uses the above approach and have seen positive results with the SBOM/SCA tools Syft and Grype which can detect and report on the bundled software.

Not all software is automatable in this way, this only would cover software libraries that are distributed through a packaging tool like yum or rpm.

@lkollar
Copy link
Contributor

lkollar commented Feb 13, 2025

Hey @sethmlarson, this looks cool!

Do you think the code handling external package managers could live in a separate project? I'm concerned that having this in auditwheel will increase the project's maintenance burden. I'm actually surprised that this isn't something Syft can do since it seems useful for multiple package ecosystems, not just Python. Do you think it would make sense to implement this in Syft, or at least in a separate Python package, outside of auditwheel?

@sethmlarson
Copy link
Author

Do you think the code handling external package managers could live in a separate project?

I definitely think so, and I intend to create this as a separate project and then folks can decide how they want to include it, whether it's copy-pasting the file into their project or including it as an actual dependency :)

@mayeut
Copy link
Member

mayeut commented Feb 14, 2025

This was first requested in #398
I had a comment about a PEP being pre-requisite and we're almost there with PEP 770.
My other comment in there was similar in part to the one of @lkollar and it seems it's going to be addressed too.

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

No branches or pull requests

3 participants