fix(ci): fetch upstream tags before building fork image VULN-435#1
Merged
rodrigoechaide merged 1 commit intoJun 23, 2026
Conversation
Without upstream tags, Go's build info embeds a pseudo-version anchored to v3.0.0 (the only semver tag in the fork's history), causing Trivy to report false-positive CVEs for all vulnerabilities fixed after v3.0.0. Fetching upstream tags lets Go anchor the pseudo-version to the correct base (e.g. v3.7.5), so the embedded module version reflects the actual code the binary was built from. VULN-435 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
CiraciNicolo
approved these changes
Jun 23, 2026
MatteoManzoni
approved these changes
Jun 23, 2026
32ca717
into
docplanner/production-k8s-provider-perf
5 of 7 checks passed
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.
Summary
fork-image.yamlCI workflow to fetch tags from the upstreamtraefik/traefikrepo before building the binarydebug/buildinfoembeds a pseudo-version anchored tov3.0.0(the only semver tag in the fork's local git history), causing Trivy to report false-positive CVEs for all vulnerabilities fixed between v3.0.0 and the actual base version (e.g. v3.7.5)Root cause
The
actions/checkoutstep withfetch-depth: 0fetches full history from the fork remote only. Upstream semver tags are never present. Go's build toolchain usesgit describe --tags --match 'v*'to compute the module version embedded in the binary — finding onlyv3.0.0, it producesv3.0.0-0.<timestamp>-<hash>. Trivy reads this and treats the binary as if it were based onv3.0.0.Fix
This is placed immediately after checkout, before the Go build. It adds no meaningful CI time (tag fetch is fast, no history is downloaded).
Test plan
Fork imageworkflow after merging and confirm the new image is pushed to GHCRgo version -m ./traefiknow showsv3.7.x-0.<timestamp>-<hash>instead ofv3.0.0-...🤖 Generated with Claude Code