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

Add golang.org/x/vuln/vulncheck as a linter #3094

Closed
joerdav opened this issue Aug 12, 2022 · 14 comments
Closed

Add golang.org/x/vuln/vulncheck as a linter #3094

joerdav opened this issue Aug 12, 2022 · 14 comments
Labels
declined enhancement New feature or improvement linter: new Support new linter

Comments

@joerdav
Copy link

joerdav commented Aug 12, 2022

Your feature request related to a problem? Please describe.

govulncheck allows you to check if your code is calling any vulnerable code.

Describe the solution you'd like.

Add https://pkg.go.dev/golang.org/x/vuln/vulncheck as a linter.

Describe alternatives you've considered.

I can't find another vulnerability checker that can determine if the vulnerable code is being called or not.

Additional context.

No response

@joerdav joerdav added the enhancement New feature or improvement label Aug 12, 2022
@boring-cyborg
Copy link

boring-cyborg bot commented Aug 12, 2022

Hey, thank you for opening your first Issue ! 🙂 If you would like to contribute we have a guide for contributors.

@ldez ldez added linter: new Support new linter declined labels Aug 12, 2022
@ldez
Copy link
Member

ldez commented Aug 12, 2022

Hello,

There are several problems:

  • vulncheck doesn't use the go/analysis API
  • vulncheck is not designed to be used as a library

https://golangci-lint.run/contributing/new-linters/#how-to-add-a-public-linter-to-golangci-lint
https://github.com/golang/vuln/tree/master/cmd/govulncheck

So I will decline this proposal.

@ldez ldez closed this as completed Aug 12, 2022
@luxifer
Copy link

luxifer commented Sep 6, 2022

Hi,

I think the issue should be re-opened because of https://go.dev/blog/vuln and the vulncheck library that's used by the command govulncheck. I can work on it

@ryancurrah
Copy link
Member

Looks like they have a API now, I havent looked at it though.

To directly integrate vulnerability checking into other tools and processes, the vulncheck package exports govulncheck’s functionality as a Go API.

@Dentrax
Copy link

Dentrax commented Sep 12, 2022

It seems mentioned PR is currently Draft, and since they have an API as Ryan mentioned above, we can re-open this one. @ldez Wdyt?

@ldez
Copy link
Member

ldez commented Sep 12, 2022

As vulncheck is based on SSA, I think the integration will not work but I will re-open.

@ldez ldez reopened this Sep 12, 2022
@ldez ldez removed the declined label Sep 12, 2022
@Dentrax
Copy link

Dentrax commented Sep 12, 2022

Thanks!

@luxifer Is your PR final? If so, can you please remove draft tag?

@luxifer
Copy link

luxifer commented Sep 12, 2022 via email

@Dentrax

This comment was marked as off-topic.

@acabarbaye
Copy link

Having this tool running as part of the linters will be extremely useful

mihaitodor added a commit to mihaitodor/connect that referenced this issue Oct 12, 2022
This is temporary while golangci/golangci-lint#3094
is being worked on here: golangci/golangci-lint#3199
mihaitodor added a commit to mihaitodor/connect that referenced this issue Oct 12, 2022
This is temporary while golangci/golangci-lint#3094
is being worked on here: golangci/golangci-lint#3199
mihaitodor added a commit to mihaitodor/connect that referenced this issue Oct 13, 2022
This is temporary while golangci/golangci-lint#3094
is being worked on here: golangci/golangci-lint#3199
mihaitodor added a commit to mihaitodor/connect that referenced this issue Oct 13, 2022
This is temporary while golangci/golangci-lint#3094
is being worked on here: golangci/golangci-lint#3199
mihaitodor added a commit to mihaitodor/connect that referenced this issue Oct 13, 2022
This is temporary while golangci/golangci-lint#3094
is being worked on here: golangci/golangci-lint#3199
mihaitodor added a commit to mihaitodor/connect that referenced this issue Oct 13, 2022
This is temporary while golangci/golangci-lint#3094
is being worked on here: golangci/golangci-lint#3199
mihaitodor added a commit to mihaitodor/connect that referenced this issue Oct 13, 2022
This is temporary while golangci/golangci-lint#3094
is being worked on here: golangci/golangci-lint#3199
mihaitodor added a commit to mihaitodor/connect that referenced this issue Oct 13, 2022
This is temporary while golangci/golangci-lint#3094
is being worked on here: golangci/golangci-lint#3199
mihaitodor added a commit to mihaitodor/connect that referenced this issue Oct 13, 2022
This is temporary while golangci/golangci-lint#3094
is being worked on here: golangci/golangci-lint#3199
mihaitodor added a commit to mihaitodor/connect that referenced this issue Oct 13, 2022
This is temporary while golangci/golangci-lint#3094
is being worked on here: golangci/golangci-lint#3199
mihaitodor added a commit to mihaitodor/connect that referenced this issue Oct 13, 2022
This is temporary while golangci/golangci-lint#3094
is being worked on here: golangci/golangci-lint#3199
Jeffail pushed a commit to redpanda-data/connect that referenced this issue Oct 18, 2022
* Add govulncheck linter

This is temporary while golangci/golangci-lint#3094
is being worked on here: golangci/golangci-lint#3199

* Upgrade actions/setup-go

Also ensure that it installs the latest available matching Go
release.
@ldez
Copy link
Member

ldez commented Jul 14, 2023

I didn't really provide my opinion on this topic: I think that vulncheck is not a linter.
It's a vulnerability/security tool and should be run as a standalone tool.

Also, as the "rules" of vulncheck are outside the configuration file, golangci-lint will ignore any "rule" changes because it's not a part of the information used to handle the cache.
This will lead to the same kind of problems as ruleguard (a part of go-critic) #1999

As you can understand, for now, I disagree with the integration of vulncheck, but I'm not alone on this project, and I can change my mind over time, I will wait for feedback from other maintainers.

I'm not making any decision at this time.

@ldez ldez added the no decision No decision to fix or not label Jul 14, 2023
@luxifer
Copy link

luxifer commented Jul 15, 2023

I understand your concerns about that. And the afct that the database is external make it difficult to integrate properly with caching. Anyway, if it's not integrated, it's not a big deal for me and it helped me better understand the internal structure of this project.

@luxifer
Copy link

luxifer commented Sep 8, 2023

Maybe we can close this issue as well?

@ldez ldez added declined and removed no decision No decision to fix or not labels Sep 8, 2023
@ldez
Copy link
Member

ldez commented Sep 8, 2023

yes I will close it, thank you @luxifer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
declined enhancement New feature or improvement linter: new Support new linter
Projects
None yet
Development

No branches or pull requests

6 participants