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

feat: Add artifact extractors #1531

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

another-rex
Copy link
Collaborator

@another-rex another-rex commented Jan 24, 2025

  • Adds the python wheel.egg and java jar archive extractors.

  • renames artifacts source from lockfile to artifact, so output will actually be "artifact:".

  • Reenable some of the image scanning tests accidentally removed from a previous PR. The unrelated snapshot changes will be from that.

This PR is not ready to be merged in yet, waiting on a osv-scalibr change to be merged in first. (google/osv-scalibr#407)

Copy link
Contributor

@hogo6002 hogo6002 left a comment

Choose a reason for hiding this comment

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

Thanks!

// Patch python package names to be normalized
if pkg.Ecosystem().Ecosystem == osvschema.EcosystemPyPI {
// per https://peps.python.org/pep-0503/#normalized-names
return strings.ToLower(cachedregexp.MustCompile(`[-_.]+`).ReplaceAllLiteralString(pkg.Inventory.Name, "-"))
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we add a TODO to remove this after the API query change is deployed to production?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yep good catch, I'll probably remove this entirely since I don't plan on merging this PR in until next week.

// Replace this with an actual implementation in OSV-Scalibr (potentially via full filesystem accountability).
for _, psr := range scanResult.PackageScanResults {
if strings.HasPrefix(psr.PackageInfo.Location(), "usr/") {
if (strings.HasPrefix(psr.PackageInfo.Location(), "usr/") && psr.PackageInfo.Ecosystem().Ecosystem == osvschema.EcosystemGo) ||
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: This logic for annotation seems quite complex now. Can we add some examples in the comments to clarify which cases will be annotated?

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.

3 participants