-
Notifications
You must be signed in to change notification settings - Fork 371
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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, "-")) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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) || |
There was a problem hiding this comment.
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?
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)