Repository navigation
ci: scan the release and main binaries with trivy - #129
Merged
Merged
Conversation
Two jobs on push to main, weekly, and after a release publishes, so the red X says what to do: the release job scans the last published binary (red means cut a release) and the main job scans a fresh build of the commit (red means bump the dependency). rootfs mode because fs mode does not read go binaries; unfixed findings are skipped and anything triaged out goes in .github/trivyignore. Same workflow as katbyte/tctest#146 and #147.
… a new one A workflow_run rescan attaches as new check runs beside the original push failure, so the commit stays red (seen on katbyte/tctest after v1.3.4). Only a rerun replaces a check run in place. The release workflow now reruns the failed jobs of any binary scan on main's head; that one job gets actions: write.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Scan the last released binary and a fresh build of main with trivy, on every push to main, weekly, and after each release publishes. Same workflow as katbyte/tctest#146 and #149, in one change.
Why: govulncheck only reports advisories whose code is actually reachable, so it stays green while a version-based scanner, or a user running one, flags the shipped binary. Nothing today turns main red for "the binary users are running has a known vulnerability".
Two jobs, so the red X says what to do. Each is its own check on the main commit.
release binarydownloads the latest release's linux_amd64 tarball and scans it. Red means cut a release.build of mainbuilds the commit and scans that. Red means bump a dependency.Release red with main green means the fix is merged and a tag is all that is left. Both red means bump.
Rescans once a release publishes, by rerunning in place. Without that, shipping the fix would leave main red until the next push or the Monday cron. A last job in the release workflow, with
actions: write, finds every binary scan run on main's head that failed and reruns its failed jobs, which re-downloads the release just published. A rerun replaces the red check run; a scan started from a new event would sit beside it and the commit would stay red, which is what happened on katbyte/tctest after v1.3.4 with theworkflow_runapproach (fixed there in katbyte/tctest#149).Scanned in rootfs mode, not fs. Checked locally on extracted releases: fs mode reported zero packages and zero findings for every binary, rootfs mode read the embedded module list and Go version. The Go version matters, since an old toolchain shows up as stdlib advisories.
Unfixed findings are skipped, everything else fails the job. High and Critical only, with
ignore-unfixedso an advisory with no fixed version cannot make the check permanently red. Fixable findings the binary can never reach go in.github/trivyignorewith a reason, which is empty today.Expect the first run to be green. A local trivy run with the same flags on a build of main is clean, and the 1.0.1 release scanned clean earlier today. tctest's first run went red on x/text as predicted, so the workflow is known to fail when it should.
Things that are fine as they are