-
Notifications
You must be signed in to change notification settings - Fork 723
fix: fix go purl with subpath to syft package name error #4107
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
base: main
Are you sure you want to change the base?
fix: fix go purl with subpath to syft package name error #4107
Conversation
580d144 to
8779f8e
Compare
|
@kzantow any chance this get view/merge? |
Signed-off-by: goatwu1993 <[email protected]>
8779f8e to
dddce0e
Compare
|
TY for the PR @goatwu1993 - I added a comment here on the original issue: Could you follow up there and show me how you got an SBOM that produced this PURL I don't think that PURL is correct and I would expect just two separate syft packages (go modules) to be in the SBOM: |
|
@spiffcs how to reproduce # init a minimal go dir
go mod init app
go get github.com/hashicorp/vault/api/auth/[email protected]
# use syft to scan the dir
syft . -o json=syft.json
cat syft.json@spiffcs |
ef31469 to
dddce0e
Compare
|
@spiffcs so is the go purl subpath valid? I think #2547 expect the purl name to be the project/repo name. Also the purl spec said that go may have subpath. So i think there is two options 1. grype support purl with sbpathkeep syft behavior and generate purl like pkg:golang/github.com/hashicorp/vault/@v0.9.0#api/auth/kubernetes grype support
Which is this pr 2. syft generate purl without subpathsyft generate purl like
instead of
grype support
this kind of purl only(which is already done). This means revert #2547 I personaaly prefer 1. since
|
|
@spiffcs any chance this get merged? the subpath seems to be an expected feature of syft |
Description
Fix anchore/grype#2838
https://pkg.go.dev/github.com/hashicorp/vault/api/auth/[email protected] is a package without vulnerability.
It is different from https://pkg.go.dev/github.com/hashicorp/[email protected] which is vulnerable.
syft produce purl like
pkg:golang/github.com/hashicorp/[email protected]#api/auth/kubernetes, which I believe is correct.However when running
It does not handle the subpath, interpreted it as name
github.com/hashicorp/vaultand versionv0.9.0, therefore report vulnerabilities such as CVE-2020-16250.Type of change
Checklist: