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

build: Makefile: add Go vulnerability checker #14028

Merged
merged 5 commits into from
Dec 2, 2022

Conversation

odeke-em
Copy link
Collaborator

Adds the Go vulnerability checker to the Makefile as a directive dependency to the all directive to ensure that we get security updates scalably.

@odeke-em odeke-em requested a review from a team as a code owner November 26, 2022 00:38
Copy link
Member

@tac0turtle tac0turtle left a comment

Choose a reason for hiding this comment

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

Could you touch on what this does? Do we need to add it to ci? Git hook?

@julienrbrt
Copy link
Member

I am curious what overlaps it has with https://github.com/actions/dependency-review-action? We have this one in CI already.

@odeke-em
Copy link
Collaborator Author

odeke-em commented Nov 26, 2022

Could you touch on what this does? Do we need to add it to ci? Git hook?

@tac0turtle it uses Go's new vulnerability scanner to check for packages that are reported as vulnerable from a bunch of crowd sourced public vulnerability databases. It was announced for Go1.19 at https://go.dev/blog/vuln and there is a listing of vulnerabilities in https://pkg.go.dev/vuln/ -- it helps us scalably catch vulnerable code in supply chains. We shall need it in CI so that if for example a vulnerable unaudited downstream dependency is introduced, it'll fail loudly.

I am curious what overlaps it has with https://github.com/actions/dependency-review-action? We have this one in CI already.

@julienrbrt I believe that tagged Github action is a subset of what this new change does. That tagged Github action requires us to have a license to Github Advanced Security and it just checks from declared GHSAs which we have; The Go vulnerability checker reads from more diverse sources than just GHSA, like it reads from the National Vulnerability Database (NVD) as well where majority of the CVEs are reported directly. Please see this infographic from the website

image

Adds the Go vulnerability checker to the Makefile as a directive
dependency to the all directive to ensure that we get security
updates scalably.
@odeke-em odeke-em changed the title Makefile: add Go vulnerability checker build: Makefile: add Go vulnerability checker Nov 27, 2022
@fedekunze
Copy link
Collaborator

I think this is a great addition! However, I doubt engineers will remember to run the cmd so I recommend including it in a CI action as @tac0turtle mentioned

Copy link
Member

@tac0turtle tac0turtle left a comment

Choose a reason for hiding this comment

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

this needs to be added somewhere its automatically run instead of only a makefile command

@julienrbrt
Copy link
Member

Govulncheck exits successfully (exit code 0) if there are no vulnerabilities, and exits unsuccessfully if there are. It also exits successfully if -json flag is provided, regardless of the number of detected vulnerabilities.

https://pkg.go.dev/golang.org/x/vuln/cmd/govulncheck

This means we can simply add make vulncheck here: https://github.com/cosmos/cosmos-sdk/blob/main/.github/workflows/dependencies-review.yml

@julienrbrt julienrbrt added the backport/v0.47.x PR scheduled for inclusion in the v0.47's next stable release label Dec 2, 2022
@julienrbrt julienrbrt enabled auto-merge (squash) December 2, 2022 11:11
@sonarcloud
Copy link

sonarcloud bot commented Dec 2, 2022

[Cosmos SDK - Rosetta] Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@julienrbrt julienrbrt merged commit bcfb7dc into main Dec 2, 2022
@julienrbrt julienrbrt deleted the govulnchecker-to-Makefile branch December 2, 2022 11:31
mergify bot pushed a commit that referenced this pull request Dec 2, 2022
* build: Makefile: add Go vulnerability checker

Adds the Go vulnerability checker to the Makefile as a directive
dependency to the all directive to ensure that we get security
updates scalably.

* add gh action

* bump to 1.19.3 due to vulnerabilities

Co-authored-by: Julien Robert <julien@rbrt.fr>
(cherry picked from commit bcfb7dc)
tac0turtle pushed a commit that referenced this pull request Dec 2, 2022
* build: Makefile: add Go vulnerability checker

Adds the Go vulnerability checker to the Makefile as a directive
dependency to the all directive to ensure that we get security
updates scalably.

* add gh action

* bump to 1.19.3 due to vulnerabilities

Co-authored-by: Julien Robert <julien@rbrt.fr>
(cherry picked from commit bcfb7dc)

Co-authored-by: Emmanuel T Odeke <emmanuel@orijtech.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/v0.47.x PR scheduled for inclusion in the v0.47's next stable release Type: Build Type: CI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants