fix: remediate gobinary vulnerabilities in scanner-trivy#46
Conversation
- bump Go directive to 1.26.2\n- upgrade vulnerable modules (docker/cli, docker, go-redis, x/net, containerregistry)\n- remove legacy go-containerregistry replace\n- adapt SBOM artifact detection to new go-containerregistry API\n- update related unit test for manifest artifact type handling
🤖 AI Code Review
SummaryThis PR upgrades vulnerable Go dependencies and removes the custom go-containerregistry fork in favor of upstream v0.21.4. Key changes include Go 1.24.0→1.26.2, Trivy v0.48.3→v0.70.0, and API adjustments for the new go-containerregistry that moves from Review Statistics
Warnings
Suggestions
Positive Feedback
ℹ️ About this reviewThis review was automatically generated using the
|
| @@ -1,23 +1,23 @@ | |||
| module github.com/aquasecurity/harbor-scanner-trivy | |||
|
|
|||
There was a problem hiding this comment.
Warning (bug/compatibility): Go version upgrade from 1.24.0 to 1.26.2 is a significant jump. Ensure comprehensive testing passes with the new Go version.
| setup: | ||
| curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s v1.21.0 | ||
| curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sh -s -- -b /usr/local/bin v0.48.3 | ||
| curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sh -s -- -b /usr/local/bin v0.70.0 |
There was a problem hiding this comment.
Warning (bug/compatibility): Trivy version upgrade from v0.48.3 to v0.70.0 is a major version jump (22 minor versions). Please verify no breaking changes in the scanner functionality.
| fakeImage := &fake.FakeImage{} | ||
| fakeImage.ManifestReturns(&v1.Manifest{ | ||
| ArtifactType: "application/vnd.goharbor.harbor.sbom.v1", | ||
| Config: v1.Descriptor{ |
There was a problem hiding this comment.
Suggestion (test/coverage): Consider adding a test case that sets Manifest.ArtifactType directly to ensure full coverage of the partial.ArtifactType function behavior, not just the Config.MediaType fallback path.
- replace removed mutate.ArtifactType with mutate.ConfigMediaType\n- normalize layer metadata in SBOM vulnerability assertion to avoid version-specific DiffID drift
Summary
Verification
Result