-
Notifications
You must be signed in to change notification settings - Fork 43
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
Support Go dependency scanning for pull requests #1012
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.
I think that this patch is fine, some suggestions inline.
@@ -15,8 +15,8 @@ pull_request: | |||
vulnerability_database_endpoint: https://api.osv.dev/v1/query | |||
package_repository: | |||
url: https://registry.npmjs.org | |||
- name: go | |||
- name: Go |
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.
why did you change the name to start with an uppercase letter? btw I wonder if we should just compare the names in a case-insensitive manner so that we'd match all of go, Go, gO and GO.
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.
oh I understand now, OSV's databases are case-sensitive..I would honestly make the mediator ecosystems case-insensitive.. (but if you disagree, just tell me that it's a bad idea..).
tested with:
curl -X POST -d \
'{"version": "0.0.1",
"package": {"name": "golang.org/x/net", "ecosystem": "Go"}}' \
"https://api.osv.dev/v1/query" | jq
versus:
curl -X POST -d \
'{"version": "0.0.1",
"package": {"name": "golang.org/x/net", "ecosystem": "go"}}' \
"https://api.osv.dev/v1/query" | jq
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.
Yes, the names are case-sensitive and can be found here: https://ossf.github.io/osv-schema/#affectedpackage-field
I've changed it to lower-case mediator-wise, thanks.
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.
vulnerability_database_type: osv | ||
vulnerability_database_endpoint: https://vuln.go.dev | ||
vulnerability_database_endpoint: https://api.osv.dev/v1/query |
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.
Ah, I see, while vuln.dev.go
does export their data in the OSV format, they don't provide the same API. We might want to even serve our own and fetch their database periodically, but..not now.
@@ -29,13 +30,44 @@ func newEcosystemParser(eco DependencyEcosystem) ecosystemParser { | |||
switch eco { |
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.
if you agree about the case-insensitive comparison, maybe we should change this to strings.ToLower
and lowercase all the dependencies..
oh and it looks like a rebase is in order..too many patches are touching the protobuf structs lately.. |
(you'll want to rebase, then just call |
merged so I can send the next PR atop |
#912
Add Go PR vulnerabilities check
The vulnerability checks were tested against the following PR: #725
Proof of functional testing:
Closes #1012