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

Report pip build dependencies in the SBOM #801

Merged
merged 2 commits into from
Feb 5, 2025

Conversation

brunoapimentel
Copy link
Contributor

Considering that the user configured his repository correctly, the only dependencies that should be present in files declared as requirements_build_files are build dependencies. Having this info in the SBOM will help future security analysis perfomed on the built artifact.

Since there is no default CycloneDx property for pip build dependencies, we're creating a custom Cachi2 one.

Maintainers will complete the following section

  • Commit messages are descriptive enough
  • Code coverage from testing does not decrease and new code is covered
  • Docs updated (if applicable)
  • Docs links in the code are still valid (if docs were updated)

@brunoapimentel brunoapimentel changed the title Report pip build dependencies in the SBOM. Report pip build dependencies in the SBOM Jan 29, 2025
@brunoapimentel
Copy link
Contributor Author

/retest

@brunoapimentel
Copy link
Contributor Author

/retest

Copy link
Member

@eskultety eskultety left a comment

Choose a reason for hiding this comment

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

Approach LGTM, will ACK once the CI failures are addressed.

@@ -194,6 +194,10 @@ def fetch_pip_source(request: Request) -> RequestOutput:
if dependency["package_type"] == "wheel":
pip_package_binary = True

Copy link
Member

Choose a reason for hiding this comment

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

Commit message nitpick:

s/declared as requirements_build_files/declared via the 'requirements_build_files' input JSON option

Cachi2's default approach to prefetching pip dependencies is to only
download sdists. This means that all wheels will need to be compiled
from source, which usually means that additional dependencies will be
necessary during the build process.

This patch prepares a property that will be used to indicate in the
SBOM that a dependency was defined in a requirements_build_file.

Signed-off-by: Bruno Pimentel <[email protected]>
@brunoapimentel brunoapimentel force-pushed the pip-build-deps branch 3 times, most recently from fa9294f to fa61c89 Compare February 4, 2025 21:09
@brunoapimentel
Copy link
Contributor Author

/retest

Considering that the user configured his repository correctly, the only
dependencies that should be present in files declared via the
'requirements_build_files' input JSON option are build dependencies.
Having this info in the SBOM will help future security analysis
perfomed on the built artifact.

Signed-off-by: Bruno Pimentel <[email protected]>
@brunoapimentel brunoapimentel added this pull request to the merge queue Feb 5, 2025
Merged via the queue into hermetoproject:main with commit 7433bbf Feb 5, 2025
15 checks passed
@brunoapimentel brunoapimentel deleted the pip-build-deps branch February 5, 2025 17:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

5 participants