-
Notifications
You must be signed in to change notification settings - Fork 13
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
First attempt using aquasecurity/trivy-action to scan for CVEs during build. #3461
Changes from 3 commits
cab0b0b
e6b1079
4eecaab
6410f3e
fa61840
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -214,6 +214,17 @@ jobs: | |
shell: bash | ||
run: parallelize results Build-Executor | ||
|
||
- # === Scan for CVEs (Linux only) === | ||
name: Scan for CVEs | ||
if: runner.os == 'Linux' | ||
uses: aquasecurity/[email protected] | ||
with: | ||
scan-type: rootfs | ||
scan-ref: build | ||
ignore-unfixed: true | ||
format: table | ||
exit-code: 1 | ||
|
||
- # === Prepare Windows Cert === | ||
name: Prepare Windows Cert | ||
shell: bash | ||
|
@@ -424,7 +435,7 @@ jobs: | |
name: Install Go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: ${{ matrix.go-version }} | ||
go-version: 1.22.x | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should update the matrix version instead. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The matrix does not exist for this job. Our action linter caught this. |
||
|
||
- # === Install State Tool === | ||
name: Install State Tool | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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.
We will need to scan for all platforms. It's ok if this runs ON linux, so long as we verify all binaries for all platforms.
Additionally, we should only run this on release branches and the nightly I think, no point slowing down regular PRs.
We could add a new job that runs in between build.yml and release.yml. Because we are already transferring all platform bits from build to release.yml, so we could inject something in the middle there for CVE validation.
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.
Well, that's what I was going to say...
For additional information you can run
go version -m <executable>
on a Go binary to see that there are differences in the modules used. It doesn't appear that versions are different but the Windows build may include modules that Linux does not and vice versa.It also appears that Trivy has releases for MacOS and Windows, if that helps: https://github.com/aquasecurity/trivy/releases
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.
Very well, I've added a new Scan action inbetween build and deploy that scans all platform-specific binaries in one go. I disagree that it should only run on release branches and nightlies. PRs should not introduce CVEs only for them to be caught later. We should be proactive. It took a whopping 5s to scan all generated binaries.
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.
@MDrakos did I hijack your review? 😅 Not my intention. When I reviewed this I was under the impression I was flagged, maybe I got my wires crossed.